Unverified Commit 15cd007d authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2283 from abhiShandy/soft-test

Add unit tests for /soft pair styles
parents 6f1055a9 5ee43467
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -161,11 +161,11 @@ Examples

   pair_style coul/long/soft 1.0 10.0 9.5
   pair_coeff * * 1.0
   pair_coeff 1 1 1.0 9.5
   pair_coeff 1 1 1.0

   pair_style tip4p/long/soft 1 2 7 8 0.15 2.0 0.5 10.0 9.8
   pair_coeff * * 1.0
   pair_coeff 1 1 1.0 9.5
   pair_coeff 1 1 1.0

   pair_style morse/soft 4 0.9 10.0
   pair_coeff * * 100.0 2.0 1.5 1.0
@@ -284,7 +284,9 @@ core. Hence, if used by themselves, there will be no repulsion to keep two
oppositely charged particles from overlapping each other. In this case, if
:math:`\lambda = 1`, a singularity may occur.  These sub-styles are suitable to
represent charges embedded in the Lennard-Jones radius of another site (for
example hydrogen atoms in several water models).
example hydrogen atoms in several water models). The :math:`\lambda` must
be defined for each pair, and *coul/cut/soft* can accept an optional cutoff as
the second coefficient.

.. note::

+2 −2
Original line number Diff line number Diff line
@@ -689,7 +689,7 @@ void PairLJCharmmCoulLong::init_style()
  int irequest;
  int respa = 0;

  if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
  if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
    if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
    if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
  }
@@ -718,7 +718,7 @@ void PairLJCharmmCoulLong::init_style()

  // set & error check interior rRESPA cutoffs

  if (strstr(update->integrate_style,"respa") &&
  if (utils::strmatch(update->integrate_style,"^respa") &&
      ((Respa *) update->integrate)->level_inner >= 0) {
    cut_respa = ((Respa *) update->integrate)->cutoff;
    cut_in_off = cut_respa[0];
+2 −2
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ void PairLJCutCoulLong::init_style()
  int irequest;
  int respa = 0;

  if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
  if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
    if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
    if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
  }
@@ -676,7 +676,7 @@ void PairLJCutCoulLong::init_style()

  // set rRESPA cutoffs

  if (strstr(update->integrate_style,"respa") &&
  if (utils::strmatch(update->integrate_style,"^respa") &&
      ((Respa *) update->integrate)->level_inner >= 0)
    cut_respa = ((Respa *) update->integrate)->cutoff;
  else cut_respa = NULL;
+13 −31
Original line number Diff line number Diff line
@@ -691,38 +691,20 @@ void PairLJCharmmCoulLongSoft::init_style()
  // request regular or rRESPA neighbor lists

  int irequest;

  if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
  int respa = 0;

  if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
   if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
   if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
  }

    if (respa == 0) irequest = neighbor->request(this,instance_me);
    else if (respa == 1) {
  irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 1;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respainner = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 3;
      neighbor->requests[irequest]->half = 0;

  if (respa >= 1) {
   neighbor->requests[irequest]->respaouter = 1;
    } else {
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 1;
      neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->respainner = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 2;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respamiddle = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 3;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respaouter = 1;
  }

  } else irequest = neighbor->request(this,instance_me);
  if (respa == 2) neighbor->requests[irequest]->respamiddle = 1;

  // require cut_lj_inner < cut_lj

@@ -739,7 +721,7 @@ void PairLJCharmmCoulLongSoft::init_style()

  // set & error check interior rRESPA cutoffs

  if (strstr(update->integrate_style,"respa") &&
  if (utils::strmatch(update->integrate_style,"^respa") &&
      ((Respa *) update->integrate)->level_inner >= 0) {
    cut_respa = ((Respa *) update->integrate)->cutoff;
    if (MIN(cut_lj,cut_coul) < cut_respa[3])
+10 −28
Original line number Diff line number Diff line
@@ -634,44 +634,26 @@ void PairLJCutCoulLongSoft::init_style()
  // request regular or rRESPA neighbor lists

  int irequest;

  if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
  int respa = 0;

  if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
    if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
    if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
  }

    if (respa == 0) irequest = neighbor->request(this,instance_me);
    else if (respa == 1) {
  irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 1;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respainner = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 3;
      neighbor->requests[irequest]->half = 0;

  if (respa >= 1) {
    neighbor->requests[irequest]->respaouter = 1;
    } else {
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 1;
      neighbor->requests[irequest]->half = 0;
    neighbor->requests[irequest]->respainner = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 2;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respamiddle = 1;
      irequest = neighbor->request(this,instance_me);
      neighbor->requests[irequest]->id = 3;
      neighbor->requests[irequest]->half = 0;
      neighbor->requests[irequest]->respaouter = 1;
  }

  } else irequest = neighbor->request(this,instance_me);
  if (respa == 2) neighbor->requests[irequest]->respamiddle = 1;

  cut_coulsq = cut_coul * cut_coul;

  // set rRESPA cutoffs

  if (strstr(update->integrate_style,"respa") &&
  if (utils::strmatch(update->integrate_style,"^respa") &&
      ((Respa *) update->integrate)->level_inner >= 0)
    cut_respa = ((Respa *) update->integrate)->cutoff;
  else cut_respa = NULL;
Loading