change virial_atom to virial_peratom
This commit is contained in:
@ -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++)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user