diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index aefb58dbb4..5f6b336802 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom() Fix **fix = modify->fix; int nfix = modify->nfix; for (int ifix = 0; ifix < nfix; ifix++) - if (fix[i]->virial_atom_flag && fix[ifix]->virial_flag) { + if (fix[i]->virial_peratom_flag && fix[ifix]->virial_flag) { double **vatom = modify->fix[ifix]->vatom; if (vatom) for (i = 0; i < nlocal; i++) diff --git a/src/fix.cpp b/src/fix.cpp index bd3d91767b..c63893ea13 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -63,8 +63,8 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : box_change = NO_BOX_CHANGE; thermo_energy = 0; thermo_virial = 0; - energy_global_flag = energy_atom_flag = 0; - virial_global_flag = virial_atom_flag = 0; + energy_global_flag = energy_peratom_flag = 0; + virial_global_flag = virial_peratom_flag = 0; ecouple_flag = 0; rigid_flag = 0; peatom_flag = 0; diff --git a/src/fix.h b/src/fix.h index af8e4dc554..c4c9267e54 100644 --- a/src/fix.h +++ b/src/fix.h @@ -44,7 +44,7 @@ class Fix : protected Pointers { int thermo_energy; // 1 if fix_modify energy enabled, 0 if not int thermo_virial; // 1 if fix_modify virial enabled, 0 if not int energy_global_flag; // 1 if contributes to global eng - int energy_atom_flag; // 1 if contributes to peratom eng + int energy_peratom_flag; // 1 if contributes to peratom eng int virial_global_flag; // 1 if contributes to global virial int virial_peratom_flag; // 1 if contributes to peratom virial int ecouple_flag; // 1 if thermostat fix outputs cumulative diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 22c7408996..bd5dc767fd 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -49,7 +49,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/fix_external.cpp b/src/fix_external.cpp index f3ad25d3b3..c2bd447a47 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -36,8 +36,8 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; global_freq = 1; extscalar = 1; - energy_global_flag = energy_atom_flag = 1; - virial_global_flag = virial_atom_flag = 1; + energy_global_flag = energy_peratom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; thermo_energy = thermo_virial = 1; if (strcmp(arg[3],"pf/callback") == 0) { diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 5740045a63..942dd1f81a 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -42,7 +42,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 2399dbfe94..4d976373a5 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -45,7 +45,7 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; extvector = 1; energy_global_flag = 1; - virial_global_flag = virial_atom_flag = 1; + virial_global_flag = virial_peratom_flag = 1; respa_level_support = 1; ilevel_respa = 0; diff --git a/src/modify.cpp b/src/modify.cpp index f8718ca5df..1dcd439c8e 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1666,25 +1666,6 @@ void Modify::list_init_energy_couple(int &n, int *&list) if (fix[i]->ecouple_flag) list[n++] = i; } -/* ---------------------------------------------------------------------- - create list of fix indices for fixes that compute peratom energy - only added to list if fix has energy_atom_flag and thermo_energy set -------------------------------------------------------------------------- */ - -void Modify::list_init_energy_atom(int &n, int *&list) -{ - delete [] list; - - n = 0; - for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; - list = new int[n]; - - n = 0; - for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; -} - /* ---------------------------------------------------------------------- create list of fix indices for fixes that compute global energy only added to list if fix has energy_global_flag and thermo_energy set @@ -1706,7 +1687,7 @@ void Modify::list_init_energy_global(int &n, int *&list) /* ---------------------------------------------------------------------- create list of fix indices for fixes that compute peratom energy - only added to list if fix has energy_atom_flag and thermo_energy set + only added to list if fix has energy_peratom_flag and thermo_energy set ------------------------------------------------------------------------- */ void Modify::list_init_energy_atom(int &n, int *&list) @@ -1715,12 +1696,12 @@ void Modify::list_init_energy_atom(int &n, int *&list) n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) n++; + if (fix[i]->energy_peratom_flag && fix[i]->thermo_energy) n++; list = new int[n]; n = 0; for (int i = 0; i < nfix; i++) - if (fix[i]->energy_atom_flag && fix[i]->thermo_energy) list[n++] = i; + if (fix[i]->energy_peratom_flag && fix[i]->thermo_energy) list[n++] = i; } /* ----------------------------------------------------------------------