UB testing

This commit is contained in:
Steve Plimpton
2022-03-08 15:37:16 -07:00
parent 095ddbd370
commit 844ea0ab8e
5 changed files with 9787 additions and 14 deletions

View File

@ -103,7 +103,9 @@ void AngleAmoeba::compute(int eflag, int vflag)
ev_init(eflag,vflag);
// DEBUG
int ubn = 0;
double eub = 0.0;
for (n = 0; n < nanglelist; n++) {
i1 = anglelist[n][0];
@ -132,11 +134,12 @@ void AngleAmoeba::compute(int eflag, int vflag)
if (uflag) {
ubn++;
tinker_urey_bradley(i1,i3,type,eflag);
eub += tinker_urey_bradley(i1,i3,type,eflag);
}
}
printf("UB N %d\n",ubn);
// DEBUG
printf("UreyBradley n %d eng %g\n",ubn,eub);
}
/* ---------------------------------------------------------------------- */
@ -540,7 +543,7 @@ void AngleAmoeba::tinker_bondangle(int i1, int i2, int i3, int type, int eflag)
/* ---------------------------------------------------------------------- */
void AngleAmoeba::tinker_urey_bradley(int i1, int i2, int type, int eflag)
double AngleAmoeba::tinker_urey_bradley(int i1, int i2, int type, int eflag)
{
double delx,dely,delz;
double rsq,r,dr,rk;
@ -582,6 +585,8 @@ void AngleAmoeba::tinker_urey_bradley(int i1, int i2, int type, int eflag)
}
if (evflag) ev_tally2(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
return ebond;
}
/* ---------------------------------------------------------------------- */

View File

@ -46,7 +46,7 @@ class AngleAmoeba : public Angle {
void tinker_angle(int, int, int, int, int);
void tinker_anglep(int, int, int, int, int);
void tinker_bondangle(int, int, int, int, int);
void tinker_urey_bradley(int, int, int, int);
double tinker_urey_bradley(int, int, int, int);
void allocate();
};

View File

@ -658,6 +658,13 @@ void ReadData::command(int narg, char **arg)
error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
if (firstpass) anglecoeffs(2);
else skip_lines(nangletypes);
} else if (strcmp(keyword,"UreyBradley Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: UreyBradley Coeffs");
if (force->angle == nullptr)
error->all(FLERR,"Must define angle_style before UreyBradley Coeffs");
if (firstpass) anglecoeffs(3);
else skip_lines(nangletypes);
} else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
@ -1852,6 +1859,7 @@ void ReadData::anglecoeffs(int which)
if (which == 0) parse_coeffs(buf,nullptr,0,1,aoffset);
else if (which == 1) parse_coeffs(buf,"bb",0,1,aoffset);
else if (which == 2) parse_coeffs(buf,"ba",0,1,aoffset);
else if (which == 3) parse_coeffs(buf,"ub",0,1,aoffset);
if (ncoeffarg == 0) error->all(FLERR,"Unexpected empty line in AngleCoeffs section");
force->angle->coeff(ncoeffarg,coeffarg);
buf = next + 1;