change to 9 element stress tensor

This commit is contained in:
Steve Plimpton
2022-06-16 17:38:57 -06:00
parent 4dbecbba51
commit 1f35065afc
4 changed files with 24 additions and 15 deletions

View File

@ -155,7 +155,7 @@ def perform_tasks(world,mdicomm,dummy):
# request virial tensor
mdi.MDI_Send_command("<STRESS",mdicomm)
virial = mdi.MDI_Recv(6,mdi.MDI_DOUBLE,mdicomm)
virial = mdi.MDI_Recv(9,mdi.MDI_DOUBLE,mdicomm)
virial = world.bcast(virial,root=0)
# request forces
@ -165,10 +165,10 @@ def perform_tasks(world,mdicomm,dummy):
world.Bcast(forces,root=0)
# final output from each calculation
# pressure = just virial component, no kinetic component
# pressure = trace of virial tensor, no kinetic component
aveeng = pe/natoms
pressure = (virial[0] + virial[1] + virial[2]) / 3.0
pressure = (virial[0] + virial[4] + virial[8]) / 3.0
m = 0
fx = fy = fz = 0.0