Unverified Commit 1ca236da authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2119 from akohlmey/more-test-files

More unit test files
parents e449cdf9 7ebad527
Loading
Loading
Loading
Loading
+8 −27
Original line number Diff line number Diff line
@@ -739,37 +739,18 @@ void PairLJCharmmfswCoulLong::init_style()

  int irequest;

  if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
  int respa = 0;
  if (update->whichflag == 1 && strstr(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

+1 −1
Original line number Diff line number Diff line
@@ -295,5 +295,5 @@ double AngleCosinePeriodic::single(int type, int i1, int i2, int i3)
  if (c < -1.0) c = -1.0;

  c = cos(acos(c)*multiplicity[type]);
  return k[type]*(1.0-b[type]*powsign(multiplicity[type])*c);
  return 2.0*k[type]*(1.0-b[type]*powsign(multiplicity[type])*c);
}
+0 −39
Original line number Diff line number Diff line
@@ -639,42 +639,3 @@ void BondTable::uf_lookup(int type, double x, double &u, double &f)
      tb->deltasq6;
  }
}

/* ----------------------------------------------------------------------
   calculate potential u at distance x
   insure x is between bond min/max
------------------------------------------------------------------------- */

void BondTable::u_lookup(int type, double x, double &u)
{
  if (!std::isfinite(x)) {
    error->one(FLERR,"Illegal bond in bond style table");
  }

  double fraction,a,b;
  char estr[128];
  const Table *tb = &tables[tabindex[type]];
  const int itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
  if (itable < 0) {
    sprintf(estr,"Bond length < table inner cutoff: "
            "type %d length %g",type,x);
    error->one(FLERR,estr);
  } else if (itable >= tablength) {
    sprintf(estr,"Bond length > table outer cutoff: "
            "type %d length %g",type,x);
    error->one(FLERR,estr);
  }

  if (tabstyle == LINEAR) {
    fraction = (x - tb->r[itable]) * tb->invdelta;
    u = tb->e[itable] + fraction*tb->de[itable];
  } else if (tabstyle == SPLINE) {
    fraction = (x - tb->r[itable]) * tb->invdelta;

    b = (x - tb->r[itable]) * tb->invdelta;
    a = 1.0 - b;
    u = a * tb->e[itable] + b * tb->e[itable+1] +
      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
      tb->deltasq6;
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ void BondGromosOMP::eval(int nfrom, int nto, ThrData * const thr)

    fbond = -4.0 * kdr;

    if (EFLAG) ebond = kdr;
    if (EFLAG) ebond = kdr*dr;

    // apply force to each of 2 atoms

+1 −2
Original line number Diff line number Diff line
@@ -125,7 +125,6 @@ void PairLJCharmmCoulCharmmImplicitOMP::eval(int iifrom, int iito, ThrData * con
      dely = ytmp - x[j].y;
      delz = ztmp - x[j].z;
      rsq = delx*delx + dely*dely + delz*delz;
      jtype = type[j];

      if (rsq < cut_bothsq) {
        r2inv = 1.0/rsq;
@@ -137,7 +136,7 @@ void PairLJCharmmCoulCharmmImplicitOMP::eval(int iifrom, int iito, ThrData * con
              (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * invdenom_coul;
            switch2 = 12.0*rsq * (cut_coulsq-rsq) *
              (rsq-cut_coul_innersq) * invdenom_coul;
            forcecoul *= switch1 + switch2;
            forcecoul *= switch1 + 0.5*switch2;
          }
          forcecoul *= factor_coul;
        } else forcecoul = 0.0;
Loading