diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 46b15a60d0..4f2d90f3de 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -70,8 +70,9 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - virial_flag = 1; - thermo_virial = 1; + energy_global_flag = 1; + virial_global_flag = 1; + thermo_energy = thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE // null pointer means LATTE will compute Coulombic potential @@ -117,12 +118,9 @@ FixLatte::~FixLatte() int FixLatte::setmask() { int mask = 0; - //mask |= INITIAL_INTEGRATE; - //mask |= FINAL_INTEGRATE; mask |= PRE_REVERSE; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; return mask; } @@ -267,9 +265,6 @@ void FixLatte::post_force(int vflag) // hardwire these unsupported flags for now int coulombflag = 0; - // pe_peratom = 0; - // virial_global = 1; // set via vflag_global at some point - // virial_peratom = 0; neighflag = 0; // set flags used by LATTE diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 79cfd09f96..4c0cb1c9bf 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -2334,9 +2334,9 @@ double FixGCMC::energy_full() if (modify->n_post_force) modify->post_force(vflag); if (modify->n_end_of_step) modify->end_of_step(); - // NOTE: all fixes with THERMO_ENERGY mask set and which + // NOTE: all fixes with energy_global_flag set and which // operate at pre_force() or post_force() or end_of_step() - // and which user has enable via fix_modify thermo yes, + // and which user has enabled via fix_modify energy yes, // will contribute to total MC energy via pe->compute_scalar() update->eflag_global = update->ntimestep; diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index c06573ab1a..318314992f 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -1061,9 +1061,9 @@ double FixWidom::energy_full() if (modify->n_pre_force) modify->pre_force(vflag); if (modify->n_end_of_step) modify->end_of_step(); - // NOTE: all fixes with THERMO_ENERGY mask set and which + // NOTE: all fixes with energy_global_flag set and which // operate at pre_force() or post_force() or end_of_step() - // and which user has enable via fix_modify thermo yes, + // and which user has enabled via fix_modify energy yes, // will contribute to total MC energy via pe->compute_scalar() update->eflag_global = update->ntimestep; diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index cd0d45cda7..7482a33110 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -42,7 +42,8 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : { if (lmp->clientserver != 1) error->all(FLERR,"Fix client/md requires LAMMPS be running as a client"); - if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix client/md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Fix client/md requires atom map"); if (sizeof(tagint) != 4) error->all(FLERR,"Fix client/md only supports 32-bit atom IDs"); @@ -54,8 +55,8 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - virial_flag = 1; - thermo_virial = 1; + energy_global_flag = virial_global_flag = 1; + thermo_energy = thermo_virial = 1; inv_nprocs = 1.0 / comm->nprocs; if (domain->dimension == 2) @@ -89,7 +90,6 @@ int FixClientMD::setmask() int mask = 0; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index fd81448b2b..9f50439158 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -49,6 +49,7 @@ 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; @@ -138,7 +139,6 @@ FixEfield::~FixEfield() int FixEfield::setmask() { int mask = 0; - mask |= THERMO_ENERGY; mask |= POST_FORCE; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index b6ab2545ad..f7a266be83 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -67,7 +67,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - + energy_global_flag = 1; peratom_flag = 1; size_peratom_cols = 2; peratom_freq = 1; @@ -202,7 +202,6 @@ int FixOrientBCC::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f718df07ad..7dc89df977 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -65,7 +65,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - + energy_global_flag = 1; peratom_flag = 1; size_peratom_cols = 2; peratom_freq = 1; @@ -200,7 +200,6 @@ int FixOrientFCC::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index d8aee3e181..7fa5adf292 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -70,10 +70,10 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : restart_global = 1; restart_peratom = 1; - peatom_flag = 1; - virial_flag = 1; + energy_global_flag = energy_peratom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; + thermo_energy = thermo_virial = 1; centroidstressflag = CENTROID_NOTAVAIL; - thermo_virial = 1; peratom_freq = 1; scalar_flag = 1; global_freq = 1; @@ -154,7 +154,6 @@ int FixCMAP::setmask() mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; mask |= MIN_POST_FORCE; return mask; diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index d29aa36e31..8d0bc5bd2e 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -50,6 +50,7 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : hyperflag = 1; scalar_flag = 1; + energy_global_flag = 1; vector_flag = 1; size_vector = 12; global_freq = 1; @@ -104,7 +105,6 @@ int FixHyperGlobal::setmask() int mask = 0; mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index 4a18a47176..d0186006d4 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -31,7 +31,6 @@ #include "memory.h" #include "error.h" - using namespace LAMMPS_NS; using namespace FixConst; @@ -63,6 +62,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : hyperflag = 2; scalar_flag = 1; + energy_global_flag = 1; vector_flag = 1; size_vector = 26; //size_vector = 28; // can add 2 for debugging @@ -237,7 +237,6 @@ int FixHyperLocal::setmask() mask |= PRE_NEIGHBOR; mask |= PRE_REVERSE; mask |= MIN_PRE_NEIGHBOR; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 148a532d41..7e05c694c2 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -49,6 +49,8 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : eta_dot_b(nullptr), f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), temperature(nullptr), pressure(nullptr) { + if (tstat_flag || pstat_flag) ecouple_flag = 1; + // error checks: could be moved up to FixRigid if ((p_flag[0] == 1 && p_period[0] <= 0.0) || @@ -186,8 +188,6 @@ int FixRigidNH::setmask() { int mask = 0; mask = FixRigid::setmask(); - if (tstat_flag || pstat_flag) mask |= THERMO_ENERGY; - return mask; } diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 17e5d30aaf..354ef08dbb 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -51,6 +51,8 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), temperature(nullptr), pressure(nullptr) { + if (tstat_flag || pstat_flag) ecouple_flag = 1; + // error checks if ((p_flag[0] == 1 && p_period[0] <= 0.0) || @@ -199,8 +201,6 @@ int FixRigidNHSmall::setmask() { int mask = 0; mask = FixRigidSmall::setmask(); - if (tstat_flag || pstat_flag) mask |= THERMO_ENERGY; - return mask; } diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index a73409e584..3947811a52 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -33,8 +33,6 @@ #include "memory.h" #include "error.h" - - using namespace LAMMPS_NS; using namespace FixConst; @@ -55,6 +53,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 1; extvector = 0; + ecouple_flag = 1; // set defaults @@ -238,7 +237,6 @@ int FixMSST::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - mask |= THERMO_ENERGY; return mask; } diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 6ebddff602..c9cb0fa2ec 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -35,7 +35,6 @@ #include "respa.h" #include "update.h" - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -47,12 +46,6 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : { if (narg != 6) error->all(FLERR,"Illegal langevin/spin command"); - dynamic_group_allow = 1; - scalar_flag = 1; - global_freq = 1; - extscalar = 1; - nevery = 1; - temp = utils::numeric(FLERR,arg[3],false,lmp); alpha_t = utils::numeric(FLERR,arg[4],false,lmp); seed = utils::inumeric(FLERR,arg[5],false,lmp); @@ -77,7 +70,6 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : // random = new RanPark(lmp,seed + comm->me); random = new RanMars(lmp,seed + comm->me); - } /* ---------------------------------------------------------------------- */ @@ -92,10 +84,6 @@ FixLangevinSpin::~FixLangevinSpin() int FixLangevinSpin::setmask() { int mask = 0; - mask |= POST_FORCE; - mask |= POST_FORCE_RESPA; - mask |= END_OF_STEP; - mask |= THERMO_ENERGY; return mask; } @@ -156,7 +144,6 @@ void FixLangevinSpin::add_tdamping(double spi[3], double fmi[3]) void FixLangevinSpin::add_temperature(double fmi[3]) { - // double rx = sigma*(2.0*random->uniform() - 1.0); // double ry = sigma*(2.0*random->uniform() - 1.0); // double rz = sigma*(2.0*random->uniform() - 1.0); @@ -175,14 +162,4 @@ void FixLangevinSpin::add_temperature(double fmi[3]) fmi[0] *= gil_factor; fmi[1] *= gil_factor; fmi[2] *= gil_factor; - } - - -/* ---------------------------------------------------------------------- */ - -void FixLangevinSpin::post_force_respa(int vflag, int ilevel, int /*iloop*/) -{ - if (ilevel == nlevels_respa-1) post_force(vflag); -} - diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 81fb0ed9eb..70ea7e1a09 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -44,7 +44,8 @@ enum{CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ -FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(nullptr) +FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), emag(nullptr) { if (narg < 7) error->all(FLERR,"Illegal precession/spin command"); @@ -56,6 +57,7 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm scalar_flag = 1; global_freq = 1; extscalar = 1; + energy_global_flag = 1; respa_level_support = 1; ilevel_respa = 0; @@ -165,12 +167,10 @@ int FixPrecessionSpin::setmask() int mask = 0; mask |= POST_FORCE; mask |= MIN_POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; } - /* ---------------------------------------------------------------------- */ void FixPrecessionSpin::init() @@ -245,7 +245,6 @@ void FixPrecessionSpin::min_setup(int vflag) void FixPrecessionSpin::post_force(int /* vflag */) { - // update mag field with time (potential improvement) if (varflag != CONSTANT) { diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index f90a1ab23e..88175fbb06 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -65,21 +65,20 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_eco); - // get rank of this processor MPI_Comm_rank(world, &me); - // check for illegal command if (narg != 7) error->all(FLERR, "Illegal fix orient/eco command"); - // set fix flags scalar_flag = 1; // computes scalar global_freq = 1; // values can be computed at every timestep extscalar = 1; // scalar scales with # of atoms + energy_global_flag = 1; peratom_flag = 1; // quantities are per atom quantities size_peratom_cols = 2; // # of per atom quantities peratom_freq = 1; // // parse input parameters + u_0 = utils::numeric(FLERR, arg[3],false,lmp); sign = (u_0 >= 0.0 ? 1 : -1); eta = utils::numeric(FLERR, arg[4],false,lmp); @@ -87,6 +86,7 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : // read reference orientations from file // work on rank 0 only + int n = strlen(arg[6]) + 1; dir_filename = new char[n]; strcpy(dir_filename, arg[6]); @@ -151,7 +151,6 @@ FixOrientECO::~FixOrientECO() { int FixOrientECO::setmask() { int mask = 0; mask |= POST_FORCE; - mask |= THERMO_ENERGY; mask |= POST_FORCE_RESPA; return mask; }