diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 209a8fa6e6..14d71b057e 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -449,10 +449,6 @@ void FixRigidNH::initial_integrate(int vflag) scale_v[2] = dtv * exp(tmp) * maclaurin_series(tmp); } - // remap simulation box and xcm by 1/2 step - - if (pstat_flag) remap(); - // update xcm, vcm, quat, conjqm and angmom for (int ibody = 0; ibody < nbody; ibody++) { @@ -555,22 +551,26 @@ void FixRigidNH::initial_integrate(int vflag) nhc_press_integrate(); } - // remap simulation box and xcm by 1/2 step - // redo KSpace coeffs since volume has changed - - if (pstat_flag) { - remap(); - if (kspace_flag) force->kspace->setup(); - } - // virial setup before call to set_xv v_init(vflag); + // remap simulation box by 1/2 step + + if (pstat_flag) remap(); + // set coords/orient and velocity/rotation of atoms in rigid bodies - // from xcm, quarternion and omega + // from quarternion and omega set_xv(); + + // remap simulation box by full step + // redo KSpace coeffs since volume has changed + + if (pstat_flag) { + remap(); + if (kspace_flag) force->kspace->setup(); + } } /* ---------------------------------------------------------------------- */ @@ -977,7 +977,8 @@ void FixRigidNH::remap() // convert pertinent atoms and rigid bodies to lamda coords - if (!allremap) { + if (allremap) domain->x2lamda(nlocal); + else { for (i = 0; i < nlocal; i++) if (mask[i] & dilate_group_bit) domain->x2lamda(x[i],x[i]); @@ -1003,7 +1004,8 @@ void FixRigidNH::remap() // convert pertinent atoms and rigid bodies back to box coords - if (!allremap) { + if (allremap) domain->lamda2x(nlocal); + else { for (i = 0; i < nlocal; i++) if (mask[i] & dilate_group_bit) domain->lamda2x(x[i],x[i]); diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 6147a3a565..fc599c931b 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -439,10 +439,6 @@ void FixRigidNHSmall::initial_integrate(int vflag) scale_v[2] = dtv * exp(tmp) * maclaurin_series(tmp); } - // remap simulation box and xcm by 1/2 step - - if (pstat_flag) remap(); - // update xcm, vcm, quat, conjqm and angmom for (int ibody = 0; ibody < nlocal_body; ibody++) { @@ -560,22 +556,26 @@ void FixRigidNHSmall::initial_integrate(int vflag) nhc_press_integrate(); } - // remap simulation box by full step - // redo KSpace coeffs since volume has changed - - if (pstat_flag) { - remap(); - if (kspace_flag) force->kspace->setup(); - } - // virial setup before call to set_xv v_init(vflag); + // remap simulation box by 1/2 step + + if (pstat_flag) remap(); + // set coords/orient and velocity/rotation of atoms in rigid bodies - // from xcm, quarternion and omega + // from quarternion and omega set_xv(); + + // remap simulation box by full step + // redo KSpace coeffs since volume has changed + + if (pstat_flag) { + remap(); + if (kspace_flag) force->kspace->setup(); + } } /* ---------------------------------------------------------------------- */ @@ -1039,7 +1039,8 @@ void FixRigidNHSmall::remap() // convert pertinent atoms and rigid bodies to lamda coords - if (!allremap) { + if (allremap) domain->x2lamda(nlocal); + else { for (i = 0; i < nlocal; i++) if (mask[i] & dilate_group_bit) domain->x2lamda(x[i],x[i]); @@ -1065,7 +1066,8 @@ void FixRigidNHSmall::remap() // convert pertinent atoms and rigid bodies back to box coords - if (!allremap) { + if (allremap) domain->lamda2x(nlocal); + else { for (i = 0; i < nlocal; i++) if (mask[i] & dilate_group_bit) domain->lamda2x(x[i],x[i]);