From c091515427cb0fcf1fb8d1bcf62afdafd3f99bd9 Mon Sep 17 00:00:00 2001 From: Plimpton Date: Thu, 21 Jan 2021 15:12:16 -0700 Subject: [PATCH] changed syntax for virial tallying in standard package fixes --- src/COLLOID/fix_wall_colloid.cpp | 2 +- src/KOKKOS/fix_shake_kokkos.cpp | 3 +-- src/MISC/fix_efield.cpp | 11 +++++------ src/POEMS/fix_poems.cpp | 8 +++----- src/RIGID/fix_ehex.cpp | 1 - src/RIGID/fix_rattle.cpp | 1 - src/RIGID/fix_rigid.cpp | 10 +++------- src/RIGID/fix_rigid_small.cpp | 10 +++------- src/RIGID/fix_shake.cpp | 7 +++---- 9 files changed, 19 insertions(+), 34 deletions(-) diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp index 665c34fe50..ad2cd66f95 100644 --- a/src/COLLOID/fix_wall_colloid.cpp +++ b/src/COLLOID/fix_wall_colloid.cpp @@ -153,7 +153,7 @@ void FixWallColloid::wall_particle(int m, int which, double coord) if (evflag) { if (side < 0) vn = -fwall*delta; else vn = fwall*delta; - v_tally(dim, i, vn); + v_tally(dim,i,vn); } } diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 00db34ce20..d7162a98cc 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -331,8 +331,7 @@ void FixShakeKokkos::post_force(int vflag) // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // reallocate per-atom arrays if necessary diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 9f50439158..5ba83ed7a6 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -49,13 +49,13 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : vector_flag = 1; scalar_flag = 1; size_vector = 3; - energy_global_flag = 1; global_freq = 1; extvector = 1; extscalar = 1; respa_level_support = 1; ilevel_respa = 0; - virial_flag = 1; + energy_global_flag = 1; + virial_global_flag = virial_peratom_flag = 1; qe2f = force->qe2f; xstr = ystr = zstr = nullptr; @@ -257,10 +257,9 @@ void FixEfield::post_force(int vflag) imageint *image = atom->image; int nlocal = atom->nlocal; - // energy and virial setup + // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // reallocate efield array if necessary @@ -319,7 +318,7 @@ void FixEfield::post_force(int vflag) v[3] = fx*unwrap[1]; v[4] = fx*unwrap[2]; v[5] = fy*unwrap[2]; - v_tally(i, v); + v_tally(i,v); } } } diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index a220216fdd..529757abb1 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -73,7 +73,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; centroidstressflag = CENTROID_NOTAVAIL; thermo_virial = 1; dof_flag = 1; @@ -684,8 +684,7 @@ void FixPOEMS::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set velocities from angmom & omega @@ -732,8 +731,7 @@ void FixPOEMS::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords and velocities of atoms in rigid bodies diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a3346b3d1c..5af363af15 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -309,7 +309,6 @@ double FixEHEX::compute_scalar() return scale; } - /* ---------------------------------------------------------------------- memory usage of local atom-based arrays ------------------------------------------------------------------------- */ diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 2d2c11974c..e8e5eebd63 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -79,7 +79,6 @@ FixRattle::~FixRattle() { memory->destroy(vp); - if (RATTLE_DEBUG) { // communicate maximum distance error diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 9ce28438d3..2724fb1c78 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -37,8 +37,6 @@ #include "error.h" #include "rigid_const.h" - - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -64,7 +62,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -887,8 +885,7 @@ void FixRigid::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set velocities from angmom & omega @@ -951,8 +948,7 @@ void FixRigid::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // set coords/orient and velocity/rotation of atoms in rigid bodies // from quarternion and omega diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 1b022f35c4..706e660ec0 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -41,8 +41,6 @@ #include "error.h" #include "rigid_const.h" - - #include using namespace LAMMPS_NS; @@ -69,7 +67,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; time_integrate = 1; rigid_flag = 1; - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -725,8 +723,7 @@ void FixRigidSmall::setup(int vflag) // virial setup before call to set_v - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // compute and forward communicate vcm and omega of all bodies @@ -797,8 +794,7 @@ void FixRigidSmall::initial_integrate(int vflag) // virial setup before call to set_xv - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // forward communicate updated info of all bodies diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index cb2daaac2a..71017aac30 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -59,7 +59,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - virial_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_virial = 1; create_attribute = 1; dof_flag = 1; @@ -569,8 +569,7 @@ void FixShake::post_force(int vflag) // virial setup - if (vflag) v_setup(vflag); - else evflag = 0; + v_init(vflag); // loop over clusters to add constraint forces @@ -616,7 +615,7 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop) // and if pressure is requested // virial accumulation happens via evflag at last iteration of each level - if (ilevel == 0 && iloop == loop_respa[ilevel]-1 && vflag) v_setup(vflag); + if (ilevel == 0 && iloop == loop_respa[ilevel]-1 && vflag) v_init(vflag); if (iloop == loop_respa[ilevel]-1) evflag = 1; else evflag = 0;