move pair style and fix whitespace

This commit is contained in:
Axel Kohlmeyer
2024-09-09 20:58:01 -04:00
parent 48689d1925
commit 68e134773c
5 changed files with 51 additions and 49 deletions

View File

@ -181,17 +181,17 @@ on atoms via the matrix inversion method. A tolerance of 1.0e-6 is
usually a good number. Keyword *alpha* can be used to change the Slater
type orbital exponent.
The *qeq/ctip* style describes partial charges on atoms in the same way as
style *qeq/shielded* but also enables the definition of charge bounds. Only
the *chi*, *eta*, *gamma*, *qmin*, *qmax*, and *omega* parameters from the
*qfile* file are used. When using the string *coul/ctip* as filename, these
parameters are extracted directly from an active *coul/ctip* pair style.
This style solves partial charges on atoms via the matrix inversion method.
Keyword *cdamp* can be used to change the damping parameter used to calculate
Coulomb interactions. Keyword *maxrepeat* can be used to adjust the number of
equilibration cycles allowed to ensure no atoms have crossed the charge bounds.
A value of 10 is usually a good choice. A tolerance between 1.0e-6 and 1.0e-8
is usually a good choice but should be checked in conjunction with the timestep
The *qeq/ctip* style describes partial charges on atoms in the same way as
style *qeq/shielded* but also enables the definition of charge bounds. Only
the *chi*, *eta*, *gamma*, *qmin*, *qmax*, and *omega* parameters from the
*qfile* file are used. When using the string *coul/ctip* as filename, these
parameters are extracted directly from an active *coul/ctip* pair style.
This style solves partial charges on atoms via the matrix inversion method.
Keyword *cdamp* can be used to change the damping parameter used to calculate
Coulomb interactions. Keyword *maxrepeat* can be used to adjust the number of
equilibration cycles allowed to ensure no atoms have crossed the charge bounds.
A value of 10 is usually a good choice. A tolerance between 1.0e-6 and 1.0e-8
is usually a good choice but should be checked in conjunction with the timestep
for adequate energy conservation during dynamic runs.
The *qeq/dynamic* style describes partial charges on atoms as point

View File

@ -288,14 +288,14 @@ Streitz-Mintmire parameterization for the material being modeled.
----------
Style *coul/ctip* computes the Coulomb interations as described in
:ref:`Plummer <Plummer1>`. It uses the the damped shifted model as in
style *coul/dsf* but is further extended to the second derivative of
the potential and incorporates empirical charge shielding meant to
approximate the more expensive Coulomb integrals used in style *coul/streitz*.
Style *coul/ctip* computes the Coulomb interations as described in
:ref:`Plummer <Plummer1>`. It uses the the damped shifted model as in
style *coul/dsf* but is further extended to the second derivative of
the potential and incorporates empirical charge shielding meant to
approximate the more expensive Coulomb integrals used in style *coul/streitz*.
More details can be found in the referenced paper. Like the style *coul/streitz*,
style *coul/ctip* is a variable charge potential and must be hybridized
with a short-range potential via the :doc:`pair_style hybrid/overlay <pair_hybrid>`
style *coul/ctip* is a variable charge potential and must be hybridized
with a short-range potential via the :doc:`pair_style hybrid/overlay <pair_hybrid>`
command. Charge equilibration must be performed with the :doc:`fix qeq/ctip
<fix_qeq>` command. For example:
@ -306,8 +306,8 @@ command. Charge equilibration must be performed with the :doc:`fix qeq/ctip
pair_coeff * * coul/ctip NiO.ctip Ni O
fix 1 all qeq/ctip 1 12.0 1.0e-8 100 coul/ctip cdamp 0.30 maxrepeat 10
See the examples/ctip directory for an example input script using the CTIP
potential. An Ni-O CTIP and EAM/FS parametrization are included for use with
See the examples/ctip directory for an example input script using the CTIP
potential. An Ni-O CTIP and EAM/FS parametrization are included for use with
the example.
----------
@ -430,16 +430,18 @@ Restrictions
""""""""""""
The *coul/long*, *coul/msm*, *coul/streitz*, and *tip4p/long* styles are
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.
part of the KSPACE package. The *coul/cut/global*, *coul/exclude*, and
*coul/ctip* 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>` page for more info.
Related commands
""""""""""""""""
:doc:`pair_coeff <pair_coeff>`, :doc:`pair_style, hybrid/overlay <pair_hybrid>`, :doc:`kspace_style <kspace_style>`
:doc:`pair_coeff <pair_coeff>`,
:doc:`pair_style hybrid/overlay <pair_hybrid>`,
:doc:`kspace_style <kspace_style>`
Default
"""""""

View File

@ -44,7 +44,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairCoulCTIP::PairCoulCTIP(LAMMPS *lmp) : Pair(lmp)
PairCoulCTIP::PairCoulCTIP(LAMMPS *lmp) : Pair(lmp)
{
params= nullptr;
}
@ -145,7 +145,7 @@ void PairCoulCTIP::compute(int eflag, int vflag)
selfion = self(&params[iparam_i],qtmp);
if (evflag) ev_tally(i,i,nlocal,0,0.0,selfion,0.0,0.0,0.0,0.0);
if (evflag) ev_tally(i,i,nlocal,0,0.0,selfion,0.0,0.0,0.0,0.0);
if (eflag) {
double e_self = self_factor[iparam_i][iparam_i] * qtmp * qtmp;
@ -164,8 +164,8 @@ void PairCoulCTIP::compute(int eflag, int vflag)
if (rsq < cut_coulsq) {
jtype = map[type[j]];
jparam_j = elem1param[jtype];
r = sqrt(rsq);
jparam_j = elem1param[jtype];
r = sqrt(rsq);
reff = cbrt(rsq * r + 1/shieldcu[iparam_i][jparam_j]);
reffsq = reff * reff;
reff4 = reffsq * reffsq;
@ -207,12 +207,12 @@ double PairCoulCTIP::self(Param *param, double qi)
{
double s1=param->chi, s2=param->eta, s3=param->qmin, s4=param->qmax, s5=param->omega;
if ( qi < s3 ) {
return qi*((s1-2*s3*s5)+qi*(0.50*s2+s5))+s3*s3*s5;
} else if ( qi < s4 ) {
return qi*(s1+qi*(0.50*s2));
} else {
return qi*((s1-2*s4*s5)+qi*(0.50*s2+s5))+s4*s4*s5;
if ( qi < s3 ) {
return qi*((s1-2*s3*s5)+qi*(0.50*s2+s5))+s3*s3*s5;
} else if ( qi < s4 ) {
return qi*(s1+qi*(0.50*s2));
} else {
return qi*((s1-2*s4*s5)+qi*(0.50*s2+s5))+s4*s4*s5;
}
return 0.0;
@ -343,9 +343,9 @@ void PairCoulCTIP::read_file(char *file)
params[nparams].gamma = values.next_double();
params[nparams].zeta = values.next_double();
params[nparams].zcore = values.next_double();
params[nparams].qmin = values.next_double();
params[nparams].qmax = values.next_double();
params[nparams].omega = values.next_double();
params[nparams].qmin = values.next_double();
params[nparams].qmax = values.next_double();
params[nparams].omega = values.next_double();
} catch (TokenizerException &e) {
error->one(FLERR, e.what());
@ -505,7 +505,7 @@ void *PairCoulCTIP::extract(const char *str, int &dim)
for (int i = 1; i <= atom->ntypes; i++)
if (map[i] >= 0) qeq_q1[i] = params[map[i]].qmin;
else qeq_q1[i] = 0.0;
return (void *) qeq_q1;
return (void *) qeq_q1;
}
if (strcmp(str,"qmax") == 0 && qeq_q2) {
dim = 1;

View File

@ -154,7 +154,7 @@ void FixQEqCTIP::init_matvec()
double r = cutoff;
double rsq = r*r;
double r6 = rsq*rsq*rsq;
double erfcd_cut = exp(-cdamp * cdamp * rsq);
double t_cut = 1.0 / (1.0 + EWALD_P * cdamp * r);
double erfcc_cut = (t_cut * (A1 + t_cut * (A2 + t_cut * (A3 + t_cut * (A4 + t_cut * A5)))) * erfcd_cut) / r;
@ -176,7 +176,7 @@ void FixQEqCTIP::init_matvec()
for (ii = 0; ii < inum; ++ii) {
i = ilist[ii];
if (atom->mask[i] & groupbit) {
qi=q[i];
if (qi < qmin[atom->type[i]]) {
Hdia_inv[i] = 1. / (eta[atom->type[i]]+2*omega[atom->type[i]]-s2d_self[atom->type[i]-1]);
@ -188,7 +188,7 @@ void FixQEqCTIP::init_matvec()
Hdia_inv[i] = 1. / (eta[atom->type[i]]+2*omega[atom->type[i]]-s2d_self[atom->type[i]-1]);
b_s[i] = -((chi[atom->type[i]]-2*qmax[atom->type[i]]*omega[atom->type[i]]) + chizj[i]);
}
b_t[i] = -1.0;
t[i] = t_hist[i][2] + 3 * (t_hist[i][0] - t_hist[i][1]);
s[i] = 4*(s_hist[i][0]+s_hist[i][2])-(6*s_hist[i][1]+s_hist[i][3]);
@ -227,7 +227,7 @@ void FixQEqCTIP::compute_H()
cutoffcu = cutoffsq * cutoff;
cutoff4 = cutoffsq * cutoffsq;
cdampcu = cdamp * cdamp * cdamp;
erfcd_cut = exp(-cdamp * cdamp * cutoffsq);
t_cut = 1.0 / (1.0 + EWALD_P * cdamp * cutoff);
erfcc_cut = t_cut * (A1 + t_cut * (A2 + t_cut * (A3 + t_cut * (A4 + t_cut * A5)))) * erfcd_cut;
@ -297,7 +297,7 @@ void FixQEqCTIP::sparse_matvec(sparse_matrix *A, double *x, double *b)
double r = cutoff;
double rsq = r*r;
double r6 = rsq*rsq*rsq;
double erfcd_cut = exp(-cdamp * cdamp * rsq);
double t_cut = 1.0 / (1.0 + EWALD_P * cdamp * r);
double erfcc_cut = (t_cut * (A1 + t_cut * (A2 + t_cut * (A3 + t_cut * (A4 + t_cut * A5)))) * erfcd_cut) / r;
@ -353,8 +353,8 @@ int FixQEqCTIP::calculate_check_Q()
double *q = atom->q;
double qi_old,qi_new;
double qi_check1,qi_check2;
double qi_check3;
int n;
double qi_check3;
int n;
inum = list->inum;
ilist = list->ilist;
@ -379,7 +379,7 @@ int FixQEqCTIP::calculate_check_Q()
qi_new = q[i];
qi_check1=(qi_new-qmin[atom->type[i]])*(qi_old-qmin[atom->type[i]]);
qi_check2=(qi_new-qmax[atom->type[i]])*(qi_old-qmax[atom->type[i]]);
qi_check2=(qi_new-qmax[atom->type[i]])*(qi_old-qmax[atom->type[i]]);
if ( qi_check1 < 0.0 || qi_check2 < 0.0 ) {
qi_check3=abs(qi_new-qi_old);
if (qi_check3 > tolerance) n++;
@ -390,5 +390,5 @@ int FixQEqCTIP::calculate_check_Q()
pack_flag = 4;
comm->forward_comm( this ); //Dist_vector( atom->q );
return n;
return n;
}