From e152796332f11c849f2736b90953b3a6262109de Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 2 Apr 2010 17:26:17 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3955 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/nemd/in.nemd | 2 +- src/fix_nh.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/nemd/in.nemd b/examples/nemd/in.nemd index 07cf0f0ab3..4d7291e770 100644 --- a/examples/nemd/in.nemd +++ b/examples/nemd/in.nemd @@ -21,7 +21,7 @@ pair_coeff * * 1.0 1.0 1.0 neighbor 0.3 bin neigh_modify delay 0 every 1 -fix 1 all nvt/sllod temp 1.0 1.0 1.0 +fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 fix 2 all deform 1 xy erate 0.01 remap v dump 1 all custom 500 dump.nemd id type x y z diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index cda4187b08..f1bd93a3a8 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -259,7 +259,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (dimension == 2 && (pcouple == YZ || pcouple == XZ)) error->all("Invalid fix nvt/npt/nph command for a 2d simulation"); - if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0 || p_flag[2] == 0)) + if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0)) + error->all("Invalid fix nvt/npt/nph command pressure settings"); + if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0) error->all("Invalid fix nvt/npt/nph command pressure settings"); if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0)) error->all("Invalid fix nvt/npt/nph command pressure settings"); @@ -285,11 +287,15 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) error->all("Can not specify Pxy/Pxz/Pyz in " "fix nvt/npt/nph with non-triclinic box"); - if (pcouple == XYZ && + if (pcouple == XYZ && dimension == 3 && (p_start[0] != p_start[1] || p_start[0] != p_start[2] || p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || p_period[0] != p_period[1] || p_period[0] != p_period[2])) error->all("Invalid fix nvt/npt/nph pressure settings"); + if (pcouple == XYZ && dimension == 2 && + (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || + p_period[0] != p_period[1])) + error->all("Invalid fix nvt/npt/nph pressure settings"); if (pcouple == XY && (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || p_period[0] != p_period[1]))