convert rest of tip4p

This commit is contained in:
Jacob Gissinger
2024-08-08 18:13:19 -04:00
parent 4f0e99793f
commit c12974f006
12 changed files with 102 additions and 23 deletions

View File

@ -145,10 +145,10 @@ Examples
pair_style tip4p/long 1 2 7 8 0.15 10.0
pair_coeff * *
pair_style tip4p/cut OW HW HW-OW HW-OW-HW 0.15 12.0
labelmap atom 1 OW 2 HW
labelmap bond 1 HW-OW
labelmap angle 1 HW-OW-HW
pair_style tip4p/cut OW HW HW-OW HW-OW-HW 0.15 12.0
pair_coeff * *
Description
@ -320,6 +320,11 @@ Coulombic solver (Ewald or PPPM).
atom. For example, if the atom ID of an O atom in a TIP4P water
molecule is 500, then its 2 H atoms must have IDs 501 and 502.
.. note::
If using type labels, the type labels must be defined before calling
the :doc:`pair_coeff <pair_coeff>` command.
See the :doc:`Howto tip4p <Howto_tip4p>` page for more information
on how to use the TIP4P pair styles and lists of parameters to set.
Note that the neighbor list cutoff for Coulomb interactions is
@ -394,9 +399,10 @@ Restrictions
""""""""""""
The *coul/long*, *coul/msm*, *coul/streitz*, and *tip4p/long* styles are
part of the KSPACE package. The *coul/cut/global* and *coul/exclude* are
part of the EXTRA-PAIR package. A pair style is only enabled if LAMMPS was
built with its corresponding package. See the :doc:`Build package <Build_package>`
part of the KSPACE package. The *coul/cut/global*, *coul/exclude* styles are
part of the EXTRA-PAIR package. The *tip4p/cut* style is part of the MOLECULE
package. A pair style is only enabled if LAMMPS was built with its
corresponding package. See the :doc:`Build package <Build_package>`
doc page for more info.
Related commands

View File

@ -161,10 +161,12 @@ Examples
pair_coeff * * 0.155 3.1536 1.0
pair_coeff 1 1 0.155 3.1536 1.0 9.5
pair_style lj/cut/tip4p/long/soft OW HW HW-OW HW-OW-HW 0.15 2.0 0.5 10.0 9.8
labelmap atom 1 OW 2 HW
labelmap bond 1 HW-OW
labelmap angle 1 HW-OW-HW
pair_style lj/cut/tip4p/long/soft OW HW HW-OW HW-OW-HW 0.15 2.0 0.5 10.0 9.8
pair_coeff * * 0.155 3.1536 1.0
pair_coeff OW OW 0.155 3.1536 1.0 9.5
pair_style lj/charmm/coul/long 2.0 0.5 10.0 8.0 10.0
pair_style lj/charmm/coul/long 2.0 0.5 10.0 8.0 10.0 9.0
@ -280,6 +282,11 @@ TIP4P water model and before the cutoffs. The activation parameter lambda is
supplied as an argument of the :doc:`pair_coeff <pair_coeff>` command, after
epsilon and sigma and before the optional cutoffs.
.. note::
If using type labels, the type labels must be defined before calling
the :doc:`pair_coeff <pair_coeff>` command.
Style *lj/charmm/coul/long/soft* implements a soft-core version of the modified
12-6 LJ potential used in CHARMM and documented in the :doc:`pair_style
lj/charmm/coul/long <pair_charmm>` style. In the soft version the parameters

View File

@ -55,10 +55,12 @@ Examples
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_style lj/cut/tip4p/long OW HW HW-OW HW-OW-HW 0.15 12.0
labelmap atom 1 OW 2 HW
labelmap bond 1 HW-OW
labelmap angle 1 HW-OW-HW
pair_style lj/cut/tip4p/long OW HW HW-OW HW-OW-HW 0.15 12.0
pair_coeff * * 100.0 3.0
pair_coeff OW OW 100.0 3.5 9.0
Description
"""""""""""
@ -86,6 +88,11 @@ with a long-range Coulombic solver (Ewald or PPPM).
atom. For example, if the atom ID of an O atom in a TIP4P water
molecule is 500, then its 2 H atoms must have IDs 501 and 502.
.. note::
If using type labels, the type labels must be defined before calling
the :doc:`pair_coeff <pair_coeff>` command.
See the :doc:`Howto tip4p <Howto_tip4p>` page for more information
on how to use the TIP4P pair styles and lists of parameters to set.
Note that the neighbor list cutoff for Coulomb interactions is

View File

@ -66,10 +66,12 @@ Examples
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0
pair_style lj/long/tip4p/long long long OW HW HW-OW HW-OW-HW 0.15 12.0
labelmap atom 1 OW 2 HW
labelmap bond 1 HW-OW
labelmap angle 1 HW-OW-HW
pair_style lj/long/tip4p/long long long OW HW HW-OW HW-OW-HW 0.15 12.0
pair_coeff * * 100.0 3.0
pair_coeff OW OW 100.0 3.5 9.0
Description
"""""""""""
@ -118,6 +120,11 @@ massless charge site are specified as pair_style arguments.
atom. For example, if the atom ID of an O atom in a TIP4P water
molecule is 500, then its 2 H atoms must have IDs 501 and 502.
.. note::
If using type labels, the type labels must be defined before calling
the :doc:`pair_coeff <pair_coeff>` command.
See the :doc:`Howto tip4p <Howto_tip4p>` page for more
information on how to use the TIP4P pair style. Note that the
neighbor list cutoff for Coulomb interactions is effectively extended

View File

@ -408,10 +408,10 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg)
{
if (narg < 9 || narg > 10) error->all(FLERR,"Illegal pair_style command");
typeO = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, arg[1], Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, arg[2], Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, arg[3], Atom::ANGLE, lmp);
typeO_str = arg[0];
typeH_str = arg[1];
typeB_str = arg[2];
typeA_str = arg[3];
qdist = utils::numeric(FLERR, arg[4], false, lmp);
nlambda = utils::numeric(FLERR, arg[5], false, lmp);
alphalj = utils::numeric(FLERR, arg[6], false, lmp);
@ -431,6 +431,22 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg)
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLJCutTIP4PLongSoft::coeff(int narg, char **arg)
{
// set atom types from pair_style command
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);
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */

View File

@ -30,6 +30,7 @@ class PairLJCutTIP4PLongSoft : public PairLJCutCoulLongSoft {
~PairLJCutTIP4PLongSoft() override;
void compute(int, int) override;
void settings(int, char **) override;
void coeff(int, char **) override;
void init_style() override;
double init_one(int, int) override;
void write_restart_settings(FILE *fp) override;
@ -38,6 +39,7 @@ class PairLJCutTIP4PLongSoft : public PairLJCutCoulLongSoft {
double memory_usage() override;
protected:
std::string typeH_str, typeO_str, typeA_str, typeB_str;
int typeH, typeO; // atom types of TIP4P water H and O atoms
int typeA, typeB; // angle and bond types of TIP4P water
double alpha; // geometric constraint parameter for TIP4P

View File

@ -376,10 +376,10 @@ void PairTIP4PLongSoft::settings(int narg, char **arg)
{
if (narg != 8) error->all(FLERR,"Illegal pair_style command");
typeO = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, arg[1], Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, arg[2], Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, arg[3], Atom::ANGLE, lmp);
typeO_str = arg[0];
typeH_str = arg[1];
typeB_str = arg[2];
typeA_str = arg[3];
qdist = utils::numeric(FLERR, arg[4], false, lmp);
nlambda = utils::numeric(FLERR, arg[5], false, lmp);
@ -388,6 +388,22 @@ void PairTIP4PLongSoft::settings(int narg, char **arg)
cut_coul = utils::numeric(FLERR, arg[7], false, lmp);
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairTIP4PLongSoft::coeff(int narg, char **arg)
{
// set atom types from pair_style command
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);
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */

View File

@ -30,6 +30,7 @@ class PairTIP4PLongSoft : public PairCoulLongSoft {
~PairTIP4PLongSoft() override;
void compute(int, int) override;
void settings(int, char **) override;
void coeff(int, char **) override;
void init_style() override;
double init_one(int, int) override;
void write_restart_settings(FILE *fp) override;
@ -38,6 +39,7 @@ class PairTIP4PLongSoft : public PairCoulLongSoft {
double memory_usage() override;
protected:
std::string typeH_str, typeO_str, typeA_str, typeB_str;
int typeH, typeO; // atom types of TIP4P water H and O atoms
int typeA, typeB; // angle and bond types of TIP4P water
double alpha; // geometric constraint parameter for TIP4P

View File

@ -426,10 +426,10 @@ void PairLJCutTIP4PCut::settings(int narg, char **arg)
{
if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command");
typeO = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, arg[1], Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, arg[2], Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, arg[3], Atom::ANGLE, lmp);
typeO_str = arg[0];
typeH_str = arg[1];
typeB_str = arg[2];
typeA_str = arg[3];
qdist = utils::numeric(FLERR, arg[4], false, lmp);
cut_lj_global = utils::numeric(FLERR, arg[5], false, lmp);
@ -457,6 +457,13 @@ 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
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);
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);

View File

@ -50,6 +50,7 @@ class PairLJCutTIP4PCut : public Pair {
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4, **offset;
std::string typeH_str, typeO_str, typeA_str, typeB_str;
int typeH, typeO; // atom types of TIP4P water H and O atoms
int typeA, typeB; // angle and bond types of TIP4P water
double alpha; // geometric constraint parameter for TIP4P

View File

@ -375,10 +375,10 @@ void PairTIP4PCut::settings(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
typeO = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
typeH = utils::expand_type_int(FLERR, arg[1], Atom::ATOM, lmp);
typeB = utils::expand_type_int(FLERR, arg[2], Atom::BOND, lmp);
typeA = utils::expand_type_int(FLERR, arg[3], Atom::ANGLE, lmp);
typeO_str = arg[0];
typeH_str = arg[1];
typeB_str = arg[2];
typeA_str = arg[3];
qdist = utils::numeric(FLERR, arg[4], false, lmp);
cut_coul = utils::numeric(FLERR, arg[5], false, lmp);
@ -396,6 +396,13 @@ 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
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);
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);

View File

@ -45,6 +45,7 @@ class PairTIP4PCut : public Pair {
double cut_coul, cut_coulsq;
double cut_coulsqplus; // extended value for cut_coulsq
std::string typeH_str, typeO_str, typeA_str, typeB_str;
int typeH, typeO; // atom types of TIP4P water H and O atoms
int typeA, typeB; // angle and bond types of TIP4P water
double alpha; // geometric constraint parameter for TIP4P