From 84de575cc7eaabfa924ed2be66ae14948917ee0c Mon Sep 17 00:00:00 2001 From: athomps Date: Thu, 9 Jun 2016 18:31:54 +0000 Subject: [PATCH] fixed case where no axial components are active git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15160 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/fix_nh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 2f1081216b..37a813366c 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -2163,7 +2163,7 @@ void FixNH::compute_press_target() p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]); p_hydro += p_target[i]; } - p_hydro /= pdim; + if (pdim > 0) p_hydro /= pdim; if (pstyle == TRICLINIC) for (int i = 3; i < 6; i++) @@ -2215,7 +2215,7 @@ void FixNH::nh_omega_dot() for (int i = 0; i < 3; i++) if (p_flag[i]) mtk_term2 += omega_dot[i]; - mtk_term2 /= pdim * atom->natoms; + if (pdim > 0) mtk_term2 /= pdim * atom->natoms; } if (pstyle == TRICLINIC) {