correctly initialize thermo_virial in fix poems and protect access to vflag_XXX by checking for evflag !=0
This commit is contained in:
@ -76,6 +76,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
time_integrate = 1;
|
time_integrate = 1;
|
||||||
rigid_flag = 1;
|
rigid_flag = 1;
|
||||||
virial_flag = 1;
|
virial_flag = 1;
|
||||||
|
thermo_virial = 1;
|
||||||
dof_flag = 1;
|
dof_flag = 1;
|
||||||
|
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
@ -683,6 +684,7 @@ void FixPOEMS::setup(int vflag)
|
|||||||
|
|
||||||
// guestimate virial as 2x the set_v contribution
|
// guestimate virial as 2x the set_v contribution
|
||||||
|
|
||||||
|
if (evflag) {
|
||||||
if (vflag_global)
|
if (vflag_global)
|
||||||
for (n = 0; n < 6; n++) virial[n] *= 2.0;
|
for (n = 0; n < 6; n++) virial[n] *= 2.0;
|
||||||
if (vflag_atom) {
|
if (vflag_atom) {
|
||||||
@ -690,6 +692,7 @@ void FixPOEMS::setup(int vflag)
|
|||||||
for (n = 0; n < 6; n++)
|
for (n = 0; n < 6; n++)
|
||||||
vatom[i][n] *= 2.0;
|
vatom[i][n] *= 2.0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// use post_force() to compute initial fcm & torque
|
// use post_force() to compute initial fcm & torque
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user