Merge pull request #2481 from lammps/energy_virial_constants
Introduce enums for energy and virial flags
This commit is contained in:
18
src/fix.cpp
18
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"
|
||||
|
||||
@ -103,7 +104,8 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) :
|
||||
|
||||
maxeatom = maxvatom = 0;
|
||||
vflag_atom = 0;
|
||||
|
||||
centroidstressflag = CENTROID_SAME;
|
||||
|
||||
// KOKKOS per-fix data masks
|
||||
|
||||
execution_space = Host;
|
||||
@ -190,12 +192,12 @@ void Fix::ev_setup(int eflag, int vflag)
|
||||
evflag = 1;
|
||||
|
||||
eflag_either = eflag;
|
||||
eflag_global = eflag % 2;
|
||||
eflag_atom = eflag / 2;
|
||||
eflag_global = eflag & ENERGY_GLOBAL;
|
||||
eflag_atom = eflag & ENERGY_ATOM;
|
||||
|
||||
vflag_either = vflag;
|
||||
vflag_global = vflag % 4;
|
||||
vflag_atom = vflag / 4;
|
||||
vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR);
|
||||
vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID);
|
||||
|
||||
// reallocate per-atom arrays if necessary
|
||||
|
||||
@ -235,7 +237,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
|
||||
------------------------------------------------------------------------- */
|
||||
@ -251,8 +253,8 @@ void Fix::v_setup(int vflag)
|
||||
|
||||
evflag = 1;
|
||||
|
||||
vflag_global = vflag % 4;
|
||||
vflag_atom = vflag / 4;
|
||||
vflag_global = vflag & (VIRIAL_PAIR | VIRIAL_FDOTR);
|
||||
vflag_atom = vflag & (VIRIAL_ATOM | VIRIAL_CENTROID);
|
||||
|
||||
// reallocate per-atom array if necessary
|
||||
|
||||
|
||||
Reference in New Issue
Block a user