activate virial contribution in fix lb/rigid/pc/sphere by default and protect virial computation with evflag

This commit is contained in:
Axel Kohlmeyer
2017-09-17 21:10:41 -04:00
parent 66130f5557
commit 5f1842829e
4 changed files with 166 additions and 164 deletions

0
examples/USER/lb/polymer/data.polymer Executable file → Normal file
View File

0
examples/USER/lb/polymer/in.polymer_default_gamma Executable file → Normal file
View File

0
examples/USER/lb/polymer/in.polymer_setgamma Executable file → Normal file
View File

View File

@ -51,6 +51,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) :
rigid_flag = 1;
create_attribute = 1;
virial_flag = 1;
thermo_virial = 1;
// perform initial allocation of atom-based arrays
// register with Atom class
@ -744,6 +745,7 @@ void FixLbRigidPCSphere::setup(int vflag)
// Set the velocities
set_v();
if (evflag) {
if (vflag_global)
for (n = 0; n < 6; n++) virial[n] *= 2.0;
if (vflag_atom) {
@ -751,7 +753,7 @@ void FixLbRigidPCSphere::setup(int vflag)
for (n = 0; n < 6; n++)
vatom[i][n] *= 2.0;
}
}
}
/* ---------------------------------------------------------------------- */