From a9ccfa94bf20fbf70b27f5861e739284f84c7202 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 29 Apr 2014 23:25:54 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11843 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/RIGID/fix_rigid_small.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 285cd6e710..b2974de386 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -313,6 +313,15 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : onemol->compute_inertia(); } + // set pstat_flag + + pstat_flag = 0; + for (int i = 0; i < 3; i++) + if (p_flag[i]) pstat_flag = 1; + + if (pcouple == XYZ || (domain->dimension == 2 && pcouple == XY)) pstyle = ISO; + else pstyle = ANISO; + // create rigid bodies based on molecule ID // sets bodytag for owned atoms // body attributes are computed later by setup_bodies() @@ -2742,7 +2751,7 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) { int i,j; - double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space; + double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm; int m = 0; @@ -2779,6 +2788,11 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf, buf[m++] = ez_space[0]; buf[m++] = ez_space[1]; buf[m++] = ez_space[2]; + conjqm = body[bodyown[j]].conjqm; + buf[m++] = conjqm[0]; + buf[m++] = conjqm[1]; + buf[m++] = conjqm[2]; + buf[m++] = conjqm[3]; } } else if (commflag == FINAL) { @@ -2793,6 +2807,11 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf, buf[m++] = omega[0]; buf[m++] = omega[1]; buf[m++] = omega[2]; + conjqm = body[bodyown[j]].conjqm; + buf[m++] = conjqm[0]; + buf[m++] = conjqm[1]; + buf[m++] = conjqm[2]; + buf[m++] = conjqm[3]; } } else if (commflag == FULL_BODY) { @@ -2819,7 +2838,7 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf, void FixRigidSmall::unpack_comm(int n, int first, double *buf) { int i,j,last; - double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space; + double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm; int m = 0; last = first + n; @@ -2856,6 +2875,11 @@ void FixRigidSmall::unpack_comm(int n, int first, double *buf) ez_space[0] = buf[m++]; ez_space[1] = buf[m++]; ez_space[2] = buf[m++]; + conjqm = body[bodyown[i]].conjqm; + conjqm[0] = buf[m++]; + conjqm[1] = buf[m++]; + conjqm[2] = buf[m++]; + conjqm[3] = buf[m++]; } } else if (commflag == FINAL) { @@ -2869,6 +2893,11 @@ void FixRigidSmall::unpack_comm(int n, int first, double *buf) omega[0] = buf[m++]; omega[1] = buf[m++]; omega[2] = buf[m++]; + conjqm = body[bodyown[i]].conjqm; + conjqm[0] = buf[m++]; + conjqm[1] = buf[m++]; + conjqm[2] = buf[m++]; + conjqm[3] = buf[m++]; } } else if (commflag == FULL_BODY) {