Apply CENTROID_* constants

This commit is contained in:
Richard Berger
2020-11-16 11:01:31 -05:00
parent c0f3697d9e
commit 1ba9dd7435
27 changed files with 30 additions and 30 deletions

View File

@ -35,7 +35,7 @@ PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp)
{ {
respa_enable = 1; respa_enable = 1;
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -33,7 +33,7 @@ using namespace MathConst;
PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp) PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -41,7 +41,7 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) {
one_coeff = 1; one_coeff = 1;
reinitflag = 0; reinitflag = 0;
cut_global = 0.0; cut_global = 0.0;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
py_potential = nullptr; py_potential = nullptr;
skip_types = nullptr; skip_types = nullptr;

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCoulCutSoft::PairCoulCutSoft(LAMMPS *lmp) : Pair(lmp) { PairCoulCutSoft::PairCoulCutSoft(LAMMPS *lmp) : Pair(lmp) {
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -33,7 +33,7 @@ using namespace MathConst;
PairLJClass2CoulCutSoft::PairLJClass2CoulCutSoft(LAMMPS *lmp) : Pair(lmp) PairLJClass2CoulCutSoft::PairLJClass2CoulCutSoft(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -32,7 +32,7 @@ using namespace MathConst;
PairLJClass2Soft::PairLJClass2Soft(LAMMPS *lmp) : Pair(lmp) PairLJClass2Soft::PairLJClass2Soft(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -37,7 +37,7 @@ using namespace MathConst;
PairLJCutCoulCutSoft::PairLJCutCoulCutSoft(LAMMPS *lmp) : Pair(lmp) PairLJCutCoulCutSoft::PairLJCutCoulCutSoft(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -43,7 +43,7 @@ PairLJCutSoft::PairLJCutSoft(LAMMPS *lmp) : Pair(lmp)
respa_enable = 1; respa_enable = 1;
writedata = 1; writedata = 1;
allocated = 0; allocated = 0;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -812,13 +812,13 @@ void Pair::ev_setup(int eflag, int vflag, int alloc)
cvflag_atom = 0; cvflag_atom = 0;
if (vflag & VIRIAL_CENTROID) { if (vflag & VIRIAL_CENTROID) {
if (centroidstressflag & 2) { if (centroidstressflag & CENTROID_AVAIL) {
cvflag_atom = 1; cvflag_atom = 1;
} else { } else {
vflag_atom = 1; vflag_atom = 1;
} }
// extra check, because both bits might be set // extra check, because both bits might be set
if (centroidstressflag & 1) vflag_atom = 1; if (centroidstressflag & CENTROID_SAME) vflag_atom = 1;
} }
vflag_either = vflag_global || vflag_atom; vflag_either = vflag_global || vflag_atom;

View File

@ -33,7 +33,7 @@ using namespace MathSpecial;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairBeck::PairBeck(LAMMPS *lmp) : Pair(lmp) { PairBeck::PairBeck(LAMMPS *lmp) : Pair(lmp) {
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -32,7 +32,7 @@ using namespace MathConst;
PairBuck::PairBuck(LAMMPS *lmp) : Pair(lmp) PairBuck::PairBuck(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -36,7 +36,7 @@ using namespace MathConst;
PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp) PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -29,7 +29,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) { PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) {
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -44,7 +44,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairCoulDSF::PairCoulDSF(LAMMPS *lmp) : Pair(lmp) { PairCoulDSF::PairCoulDSF(LAMMPS *lmp) : Pair(lmp) {
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -36,7 +36,7 @@ using namespace MathConst;
PairCoulWolf::PairCoulWolf(LAMMPS *lmp) : Pair(lmp) PairCoulWolf::PairCoulWolf(LAMMPS *lmp) : Pair(lmp)
{ {
single_enable = 0; // NOTE: single() method below is not yet correct single_enable = 0; // NOTE: single() method below is not yet correct
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -45,7 +45,7 @@ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp),
// assume pair hybrid always supports centroid atomic stress, // assume pair hybrid always supports centroid atomic stress,
// so that cflag_atom gets set when needed // so that cflag_atom gets set when needed
centroidstressflag = 2; centroidstressflag = CENTROID_AVAIL;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -168,7 +168,7 @@ void PairHybrid::compute(int eflag, int vflag)
if (cvflag_atom) { if (cvflag_atom) {
n = atom->nlocal; n = atom->nlocal;
if (force->newton_pair) n += atom->nghost; if (force->newton_pair) n += atom->nghost;
if (styles[m]->centroidstressflag & 2) { if (styles[m]->centroidstressflag & CENTROID_AVAIL) {
double **cvatom_substyle = styles[m]->cvatom; double **cvatom_substyle = styles[m]->cvatom;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
for (j = 0; j < 9; j++) for (j = 0; j < 9; j++)
@ -401,7 +401,7 @@ void PairHybrid::flags()
if (styles[m]->dispersionflag) dispersionflag = 1; if (styles[m]->dispersionflag) dispersionflag = 1;
if (styles[m]->tip4pflag) tip4pflag = 1; if (styles[m]->tip4pflag) tip4pflag = 1;
if (styles[m]->compute_flag) compute_flag = 1; if (styles[m]->compute_flag) compute_flag = 1;
if (styles[m]->centroidstressflag & 4) centroidstressflag |= 4; if (styles[m]->centroidstressflag & CENTROID_NOTAVAIL) centroidstressflag |= CENTROID_NOTAVAIL;
} }
single_enable = (single_enable == nstyles) ? 1 : 0; single_enable = (single_enable == nstyles) ? 1 : 0;
respa_enable = (respa_enable == nstyles) ? 1 : 0; respa_enable = (respa_enable == nstyles) ? 1 : 0;

View File

@ -33,7 +33,7 @@ using namespace PairLJCubicConstants;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
PairLJCubic::PairLJCubic(LAMMPS *lmp) : Pair(lmp) { PairLJCubic::PairLJCubic(LAMMPS *lmp) : Pair(lmp) {
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -41,7 +41,7 @@ PairLJCut::PairLJCut(LAMMPS *lmp) : Pair(lmp)
{ {
respa_enable = 1; respa_enable = 1;
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -33,7 +33,7 @@ using namespace MathConst;
PairLJCutCoulCut::PairLJCutCoulCut(LAMMPS *lmp) : Pair(lmp) PairLJCutCoulCut::PairLJCutCoulCut(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -46,7 +46,7 @@ using namespace MathConst;
PairLJCutCoulDSF::PairLJCutCoulDSF(LAMMPS *lmp) : Pair(lmp) PairLJCutCoulDSF::PairLJCutCoulDSF(LAMMPS *lmp) : Pair(lmp)
{ {
single_enable = 0; single_enable = 0;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -37,7 +37,7 @@ PairLJCutCoulWolf::PairLJCutCoulWolf(LAMMPS *lmp) : Pair(lmp)
{ {
single_enable = 0; single_enable = 0;
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -32,7 +32,7 @@ using namespace MathConst;
PairLJExpand::PairLJExpand(LAMMPS *lmp) : Pair(lmp) PairLJExpand::PairLJExpand(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
PairLJGromacsCoulGromacs::PairLJGromacsCoulGromacs(LAMMPS *lmp) : Pair(lmp) PairLJGromacsCoulGromacs::PairLJGromacsCoulGromacs(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
PairLJSmooth::PairLJSmooth(LAMMPS *lmp) : Pair(lmp) PairLJSmooth::PairLJSmooth(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
PairLJSmoothLinear::PairLJSmoothLinear(LAMMPS *lmp) : Pair(lmp) { PairLJSmoothLinear::PairLJSmoothLinear(LAMMPS *lmp) : Pair(lmp) {
single_hessian_enable = 1; single_hessian_enable = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
PairMorse::PairMorse(LAMMPS *lmp) : Pair(lmp) PairMorse::PairMorse(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -36,7 +36,7 @@ using namespace LAMMPS_NS;
PairUFM::PairUFM(LAMMPS *lmp) : Pair(lmp) PairUFM::PairUFM(LAMMPS *lmp) : Pair(lmp)
{ {
writedata = 1; writedata = 1;
centroidstressflag = 1; centroidstressflag = CENTROID_SAME;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */