diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index b281897b0d..54ab4aa128 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -3629,7 +3629,7 @@ void PairReaxCKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, /* ---------------------------------------------------------------------- setup for energy, virial computation - see integrate::ev_set() for values of eflag (0-3) and vflag (0-6) + see integrate::ev_set() for values of eflag and vflag ------------------------------------------------------------------------- */ template @@ -3645,7 +3645,7 @@ void PairReaxCKokkos::ev_setup(int eflag, int vflag, int) vflag_either = vflag; vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); - vflag_atom = vflag / 4; // TODO + vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); // reallocate per-atom arrays if necessary @@ -3673,11 +3673,11 @@ void PairReaxCKokkos::ev_setup(int eflag, int vflag, int) Kokkos::parallel_for(Kokkos::RangePolicy(0,maxvatom),*this); } - // if vflag_global = 2 and pair::compute() calls virial_fdotr_compute() + // if vflag_global = VIRIAL_FDOTR and pair::compute() calls virial_fdotr_compute() // compute global virial via (F dot r) instead of via pairwise summation // unset other flags as appropriate - if (vflag_global == 2 && no_virial_fdotr_compute == 0) { + if (vflag_global == VIRIAL_FDOTR && no_virial_fdotr_compute == 0) { vflag_fdotr = 1; vflag_global = 0; if (vflag_atom == 0) vflag_either = 0; diff --git a/src/fix.cpp b/src/fix.cpp index 3814cd4cb8..aabbc58473 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -16,6 +16,7 @@ #include "atom.h" #include "atom_masks.h" #include "error.h" +#include "force.h" #include "group.h" #include "memory.h" @@ -189,12 +190,12 @@ void Fix::ev_setup(int eflag, int vflag) evflag = 1; eflag_either = eflag; - eflag_global = eflag % 2; // TODO - eflag_atom = eflag / 2; // TODO + eflag_global = eflag & ENERGY_GLOBAL; + eflag_atom = eflag & ENERGY_ATOM; vflag_either = vflag; - vflag_global = vflag % 4; // TODO - vflag_atom = vflag / 4; // TODO + vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); + vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); // reallocate per-atom arrays if necessary @@ -234,7 +235,7 @@ void Fix::ev_setup(int eflag, int vflag) /* ---------------------------------------------------------------------- if thermo_virial is on: setup for virial computation - see integrate::ev_set() for values of vflag (0-6) + see integrate::ev_set() for values of vflag fixes call this if use v_tally() else: set evflag=0 ------------------------------------------------------------------------- */ @@ -250,8 +251,8 @@ void Fix::v_setup(int vflag) evflag = 1; - vflag_global = vflag % 4; // TODO - vflag_atom = vflag / 4; // TODO + vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); + vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); // reallocate per-atom array if necessary diff --git a/src/kspace.cpp b/src/kspace.cpp index a373c65a9d..ef7970e2ec 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -221,7 +221,7 @@ void KSpace::pair_check() eflag_atom = 1 if ENERGY_ATOM bit of eflag set eflag_either = 1 if eflag_global or eflag_atom is set vflag_global = 1 if VIRIAL_PAIR or VIRIAL_FDOTR bit of vflag set - vflag_atom = 1 if VIRIAL_ATOM bit of vflag set + vflag_atom = 1 if VIRIAL_ATOM or VIRIAL_CENTROID bit of vflag set vflag_either = 1 if vflag_global or vflag_atom is set ------------------------------------------------------------------------- */ @@ -237,7 +237,7 @@ void KSpace::ev_setup(int eflag, int vflag, int alloc) vflag_either = vflag; vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR); - vflag_atom = vflag / 4; // TODO + vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID); if (eflag_atom || vflag_atom) evflag_atom = 1; else evflag_atom = 0; diff --git a/src/min.cpp b/src/min.cpp index b62bceba7a..ca0d508e95 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -798,25 +798,20 @@ void Min::ev_setup() } /* ---------------------------------------------------------------------- - TODO: comment - set eflag,vflag for current iteration invoke matchstep() on all timestep-dependent computes to clear their arrays eflag/vflag based on computes that need info on this ntimestep always set eflag_global = 1, since need energy every iteration - eflag = 0 = no energy computation - eflag = 1 = global energy only - eflag = 2 = per-atom energy only - eflag = 3 = both global and per-atom energy - vflag = 0 = no virial computation (pressure) - vflag = 1 = global virial with pair portion via sum of pairwise interactions - vflag = 2 = global virial with pair portion via F dot r including ghosts - vflag = 4 = per-atom virial only - vflag = 5 or 6 = both global and per-atom virial - vflag = 8 = per-atom centroid virial only - vflag = 9 or 10 = both global and per-atom centroid virial - vflag = 12 = both per-atom virial and per-atom centroid virial - vflag = 13 or 15 = global, per-atom virial and per-atom centroid virial + eflag: set any or no bits + ENERGY_GLOBAL bit for global energy + ENERGY_ATOM bit for per-atom energy + vflag: set any or no bits, but GLOBAL/FDOTR bit cannot both be set + VIRIAL_PAIR bit for global virial as sum of pairwise terms + VIRIAL_FDOTR bit for global virial via F dot r + VIRIAL_ATOM bit for per-atom virial + VIRIAL_CENTROID bit for per-atom centroid virial + all force components (pair,bond,angle,...,kspace) use eflag/vflag + in their ev_setup() method to set local energy/virial flags ------------------------------------------------------------------------- */ void Min::ev_set(bigint ntimestep)