From 4fb963f0b861f9d8f1ab1a6c302013d14da2e1b7 Mon Sep 17 00:00:00 2001 From: pscrozi Date: Tue, 24 Oct 2006 13:59:54 +0000 Subject: [PATCH] Fixed variable bound bugs that Arun Karthi pointed out. git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@93 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/variable.html | 2 +- doc/variable.txt | 2 +- src/variable.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/variable.html b/doc/variable.html index b2e760e21e..4e8eac6948 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -25,7 +25,7 @@ math functions = add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(x) group functions = mass(group), charge(group), xcm(group,dim), - vcm(group,dim), bounds(group,xmin), gyration(group) + vcm(group,dim), bound(group,xmin), gyration(group) vectors = x[5], y[12], z[17], vx[88], vy[19], vz[2], fx[1], fy[2005], fz[1] keywords = same keywords (mostly) as in thermo_style custom command diff --git a/doc/variable.txt b/doc/variable.txt index 6d84f01b78..ddd430d49a 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -20,7 +20,7 @@ style = {index} or {loop} or {equal} or {world} or {universe} :l math functions = add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(x) group functions = mass(group), charge(group), xcm(group,dim), - vcm(group,dim), bounds(group,xmin), gyration(group) + vcm(group,dim), bound(group,xmin), gyration(group) vectors = x\[5\], y\[12\], z\[17\], vx\[88\], vy\[19\], vz\[2\], fx\[1\], fy\[2005\], fz\[1\] keywords = same keywords (mostly) as in "thermo_style custom"_thermo_style.html command diff --git a/src/variable.cpp b/src/variable.cpp index 8405739d09..6a0c0e9c8c 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -569,9 +569,9 @@ char *Variable::evaluate(char *str) group->bounds(igroup,minmax); if (strcmp(arg2,"xmin") == 0) answer = minmax[0]; else if (strcmp(arg2,"xmax") == 0) answer = minmax[1]; - if (strcmp(arg2,"ymin") == 0) answer = minmax[2]; + else if (strcmp(arg2,"ymin") == 0) answer = minmax[2]; else if (strcmp(arg2,"ymax") == 0) answer = minmax[3]; - if (strcmp(arg2,"zmin") == 0) answer = minmax[4]; + else if (strcmp(arg2,"zmin") == 0) answer = minmax[4]; else if (strcmp(arg2,"zmax") == 0) answer = minmax[5]; else error->all("Cannot evaluate variable equal command");