must not set tip4p atom and bond types when restarting from a restart file

This commit is contained in:
Axel Kohlmeyer
2024-08-13 16:07:20 -04:00
parent 444e85d46c
commit 5da737fd11
7 changed files with 56 additions and 35 deletions

View File

@ -437,12 +437,15 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg)
void PairLJCutTIP4PLongSoft::coeff(int narg, char **arg)
{
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
PairLJCutCoulLongSoft::coeff(narg, arg);
}

View File

@ -394,12 +394,15 @@ void PairTIP4PLongSoft::settings(int narg, char **arg)
void PairTIP4PLongSoft::coeff(int narg, char **arg)
{
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
PairCoulLongSoft::coeff(narg, arg);
}

View File

@ -451,12 +451,15 @@ void PairLJCutTIP4PLong::settings(int narg, char **arg)
void PairLJCutTIP4PLong::coeff(int narg, char **arg)
{
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
PairLJCutCoulLong::coeff(narg, arg);
}

View File

@ -1468,12 +1468,15 @@ void PairLJLongTIP4PLong::settings(int narg, char **arg)
void PairLJLongTIP4PLong::coeff(int narg, char **arg)
{
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
PairLJLongCoulLong::coeff(narg, arg);
}

View File

@ -407,12 +407,15 @@ void PairTIP4PLong::settings(int narg, char **arg)
void PairTIP4PLong::coeff(int narg, char **arg)
{
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
PairCoulLong::coeff(narg, arg);
}

View File

@ -457,12 +457,15 @@ void PairLJCutTIP4PCut::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
int ilo,ihi,jlo,jhi;
utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error);

View File

@ -396,12 +396,15 @@ void PairTIP4PCut::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
// set atom types from pair_style command
// set atom types from pair_style command unless we were restarted
// and the types are already set and the strings are empty.
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
if (typeO_str.size() > 0) {
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, typeH_str, Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, typeB_str, Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, typeA_str, Atom::ANGLE, lmp);
}
int ilo,ihi,jlo,jhi;
utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error);