convert e3b and srp

This commit is contained in:
Jacob Gissinger
2024-08-08 18:57:53 -04:00
parent c12974f006
commit 444e85d46c
6 changed files with 36 additions and 17 deletions

View File

@ -353,9 +353,7 @@ void PairSRP::settings(int narg, char **arg)
if (strcmp(arg[1],"*") == 0) {
btype = 0;
} else {
btype = utils::expand_type_int(FLERR, arg[1], Atom::BOND, lmp);
if ((btype > atom->nbondtypes) || (btype <= 0))
error->all(FLERR,"Illegal pair_style command");
btype_str = arg[1];
}
// settings
@ -383,20 +381,10 @@ void PairSRP::settings(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"bptype") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal pair srp command");
bptype = utils::inumeric(FLERR, arg[iarg+1], false, lmp);
if ((bptype < 1) || (bptype > atom->ntypes))
error->all(FLERR,"Illegal bond particle type for srp");
bptype_str = arg[iarg+1];
iarg += 2;
} else error->all(FLERR,"Illegal pair srp command");
}
// reset cutoffs if explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= bptype; i++)
for (j = i; j <= bptype; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
@ -409,6 +397,22 @@ void PairSRP::coeff(int narg, char **arg)
error->all(FLERR,"PairSRP: Incorrect args for pair coeff");
if (!allocated) allocate();
btype = utils::expand_type_int(FLERR, btype_str, Atom::BOND, lmp);
if ((btype > atom->nbondtypes) || (btype <= 0))
error->all(FLERR,"Illegal pair_style command");
bptype = utils::expand_type_int(FLERR, bptype_str, Atom::ATOM, lmp);
if ((bptype < 1) || (bptype > atom->ntypes))
error->all(FLERR,"Illegal bond particle type for srp");
// reset cutoffs if explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= bptype; i++)
for (j = i; j <= bptype; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
// set ij bond-bond cutoffs
int ilo, ihi, jlo, jhi;
utils::bounds(FLERR,arg[0], 1, bptype, ilo, ihi, error);