convert e3b and srp
This commit is contained in:
@ -50,8 +50,9 @@ Examples
|
|||||||
pair_style hybrid/overlay e3b 1 lj/cut/tip4p/long 1 2 1 1 0.15 8.5
|
pair_style hybrid/overlay e3b 1 lj/cut/tip4p/long 1 2 1 1 0.15 8.5
|
||||||
pair_coeff * * e3b preset 2011
|
pair_coeff * * e3b preset 2011
|
||||||
|
|
||||||
labelmap atom 1 C 2 H 3 O 4 N 5 OW 6 HW
|
|
||||||
pair_style e3b OW
|
pair_style e3b OW
|
||||||
|
labelmap atom 1 C 2 H 3 O 4 N 5 OW 6 HW
|
||||||
|
pair_coeff * * Ea 35.85 Eb -240.2 Ec 449.3 E2 108269.9 K3 1.907 K2 4.872 Rc3 5.2 Rc2 5.2 Rs 5.0 bondL 0.9572
|
||||||
|
|
||||||
Used in example input script:
|
Used in example input script:
|
||||||
|
|
||||||
@ -105,6 +106,11 @@ atom type is inferred from the ordering of the atoms.
|
|||||||
Each water molecule must have consecutive IDs with the oxygen first.
|
Each water molecule must have consecutive IDs with the oxygen first.
|
||||||
This pair style does not test that this criteria is met.
|
This pair style does not test that this criteria is met.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If using type labels, the type labels must be defined before calling
|
||||||
|
the :doc:`pair_coeff <pair_coeff>` command.
|
||||||
|
|
||||||
The *pair_coeff* command must have at least one keyword/value pair, as
|
The *pair_coeff* command must have at least one keyword/value pair, as
|
||||||
described above. The *preset* keyword sets the potential parameters to
|
described above. The *preset* keyword sets the potential parameters to
|
||||||
the values used in :ref:`(Tainter 2011) <Tainter2011>` or
|
the values used in :ref:`(Tainter 2011) <Tainter2011>` or
|
||||||
|
|||||||
@ -23,7 +23,7 @@ Syntax
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
*bptype* value = atom type for bond particles
|
*bptype* value = atom type (numeric or type label) for bond particles
|
||||||
*exclude* value = *yes* or *no*
|
*exclude* value = *yes* or *no*
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
@ -121,6 +121,11 @@ is used.
|
|||||||
between atom type *bptype* and all other types of atoms. An error
|
between atom type *bptype* and all other types of atoms. An error
|
||||||
will be flagged if :doc:`pair_style hybrid <pair_hybrid>` is not used.
|
will be flagged if :doc:`pair_style hybrid <pair_hybrid>` is not used.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If using type labels, the type labels must be defined before calling
|
||||||
|
the :doc:`pair_coeff <pair_coeff>` command.
|
||||||
|
|
||||||
The optional *exclude* keyword determines if forces are computed
|
The optional *exclude* keyword determines if forces are computed
|
||||||
between first neighbor (directly connected) bonds. For a setting of
|
between first neighbor (directly connected) bonds. For a setting of
|
||||||
*no*, first neighbor forces are computed; for *yes* they are not
|
*no*, first neighbor forces are computed; for *yes* they are not
|
||||||
|
|||||||
@ -373,7 +373,7 @@ void PairE3B::allocateE3B()
|
|||||||
void PairE3B::settings(int narg, char **arg)
|
void PairE3B::settings(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (narg != 1) error->all(FLERR, "Illegal pair_style command");
|
if (narg != 1) error->all(FLERR, "Illegal pair_style command");
|
||||||
typeO = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
|
typeO_str = arg[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -387,6 +387,8 @@ void PairE3B::coeff(int narg, char **arg)
|
|||||||
//1=* 2=* 3/4=1st keyword/value
|
//1=* 2=* 3/4=1st keyword/value
|
||||||
if (narg < 4) error->all(FLERR, "There must be at least one keyword given to pair_coeff");
|
if (narg < 4) error->all(FLERR, "There must be at least one keyword given to pair_coeff");
|
||||||
|
|
||||||
|
typeO = utils::expand_type_int(FLERR, typeO_str, Atom::ATOM, lmp);
|
||||||
|
|
||||||
// clear setflag since coeff() called once with I,J = * *
|
// clear setflag since coeff() called once with I,J = * *
|
||||||
int n = atom->ntypes;
|
int n = atom->ntypes;
|
||||||
for (int i = 1; i <= n; i++)
|
for (int i = 1; i <= n; i++)
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class PairE3B : public Pair {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
//potential parameters
|
//potential parameters
|
||||||
|
std::string typeO_str;
|
||||||
int typeO;
|
int typeO;
|
||||||
double ea, eb, ec; //three body energies
|
double ea, eb, ec; //three body energies
|
||||||
double k3; //three body exponential decay (units inverse length)
|
double k3; //three body exponential decay (units inverse length)
|
||||||
|
|||||||
@ -353,9 +353,7 @@ void PairSRP::settings(int narg, char **arg)
|
|||||||
if (strcmp(arg[1],"*") == 0) {
|
if (strcmp(arg[1],"*") == 0) {
|
||||||
btype = 0;
|
btype = 0;
|
||||||
} else {
|
} else {
|
||||||
btype = utils::expand_type_int(FLERR, arg[1], Atom::BOND, lmp);
|
btype_str = arg[1];
|
||||||
if ((btype > atom->nbondtypes) || (btype <= 0))
|
|
||||||
error->all(FLERR,"Illegal pair_style command");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
@ -383,20 +381,10 @@ void PairSRP::settings(int narg, char **arg)
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"bptype") == 0) {
|
} else if (strcmp(arg[iarg],"bptype") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair srp command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair srp command");
|
||||||
bptype = utils::inumeric(FLERR, arg[iarg+1], false, lmp);
|
bptype_str = arg[iarg+1];
|
||||||
if ((bptype < 1) || (bptype > atom->ntypes))
|
|
||||||
error->all(FLERR,"Illegal bond particle type for srp");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal pair srp command");
|
} 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");
|
error->all(FLERR,"PairSRP: Incorrect args for pair coeff");
|
||||||
if (!allocated) allocate();
|
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
|
// set ij bond-bond cutoffs
|
||||||
int ilo, ihi, jlo, jhi;
|
int ilo, ihi, jlo, jhi;
|
||||||
utils::bounds(FLERR,arg[0], 1, bptype, ilo, ihi, error);
|
utils::bounds(FLERR,arg[0], 1, bptype, ilo, ihi, error);
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class PairSRP : public Pair {
|
|||||||
double **a0;
|
double **a0;
|
||||||
double **srp;
|
double **srp;
|
||||||
double cut_global;
|
double cut_global;
|
||||||
|
std::string bptype_str, btype_str;
|
||||||
int bptype;
|
int bptype;
|
||||||
int btype;
|
int btype;
|
||||||
class Fix *f_srp;
|
class Fix *f_srp;
|
||||||
|
|||||||
Reference in New Issue
Block a user