change virial_atom to virial_peratom

This commit is contained in:
Plimpton
2021-01-21 12:00:16 -07:00
parent 6e3b9307a4
commit 2c1b6adce3
8 changed files with 12 additions and 31 deletions

View File

@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom()
Fix **fix = modify->fix; Fix **fix = modify->fix;
int nfix = modify->nfix; int nfix = modify->nfix;
for (int ifix = 0; ifix < nfix; ifix++) 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; double **vatom = modify->fix[ifix]->vatom;
if (vatom) if (vatom)
for (i = 0; i < nlocal; i++) for (i = 0; i < nlocal; i++)

View File

@ -63,8 +63,8 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) :
box_change = NO_BOX_CHANGE; box_change = NO_BOX_CHANGE;
thermo_energy = 0; thermo_energy = 0;
thermo_virial = 0; thermo_virial = 0;
energy_global_flag = energy_atom_flag = 0; energy_global_flag = energy_peratom_flag = 0;
virial_global_flag = virial_atom_flag = 0; virial_global_flag = virial_peratom_flag = 0;
ecouple_flag = 0; ecouple_flag = 0;
rigid_flag = 0; rigid_flag = 0;
peatom_flag = 0; peatom_flag = 0;

View File

@ -44,7 +44,7 @@ class Fix : protected Pointers {
int thermo_energy; // 1 if fix_modify energy enabled, 0 if not 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 thermo_virial; // 1 if fix_modify virial enabled, 0 if not
int energy_global_flag; // 1 if contributes to global eng 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_global_flag; // 1 if contributes to global virial
int virial_peratom_flag; // 1 if contributes to peratom virial int virial_peratom_flag; // 1 if contributes to peratom virial
int ecouple_flag; // 1 if thermostat fix outputs cumulative int ecouple_flag; // 1 if thermostat fix outputs cumulative

View File

@ -49,7 +49,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
extscalar = 1; extscalar = 1;
extvector = 1; extvector = 1;
energy_global_flag = 1; energy_global_flag = 1;
virial_global_flag = virial_atom_flag = 1; virial_global_flag = virial_peratom_flag = 1;
respa_level_support = 1; respa_level_support = 1;
ilevel_respa = 0; ilevel_respa = 0;

View File

@ -36,8 +36,8 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
scalar_flag = 1; scalar_flag = 1;
global_freq = 1; global_freq = 1;
extscalar = 1; extscalar = 1;
energy_global_flag = energy_atom_flag = 1; energy_global_flag = energy_peratom_flag = 1;
virial_global_flag = virial_atom_flag = 1; virial_global_flag = virial_peratom_flag = 1;
thermo_energy = thermo_virial = 1; thermo_energy = thermo_virial = 1;
if (strcmp(arg[3],"pf/callback") == 0) { if (strcmp(arg[3],"pf/callback") == 0) {

View File

@ -42,7 +42,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
extscalar = 1; extscalar = 1;
extvector = 1; extvector = 1;
energy_global_flag = 1; energy_global_flag = 1;
virial_global_flag = virial_atom_flag = 1; virial_global_flag = virial_peratom_flag = 1;
respa_level_support = 1; respa_level_support = 1;
ilevel_respa = 0; ilevel_respa = 0;

View File

@ -45,7 +45,7 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
extscalar = 1; extscalar = 1;
extvector = 1; extvector = 1;
energy_global_flag = 1; energy_global_flag = 1;
virial_global_flag = virial_atom_flag = 1; virial_global_flag = virial_peratom_flag = 1;
respa_level_support = 1; respa_level_support = 1;
ilevel_respa = 0; ilevel_respa = 0;

View File

@ -1666,25 +1666,6 @@ void Modify::list_init_energy_couple(int &n, int *&list)
if (fix[i]->ecouple_flag) list[n++] = i; 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 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 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 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) 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; n = 0;
for (int i = 0; i < nfix; i++) 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]; list = new int[n];
n = 0; n = 0;
for (int i = 0; i < nfix; i++) 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;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------