diff --git a/doc/fix_ave_spatial.html b/doc/fix_ave_spatial.html index a030df52a5..d1046fb7fe 100644 --- a/doc/fix_ave_spatial.html +++ b/doc/fix_ave_spatial.html @@ -33,9 +33,9 @@
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) +vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) density/number, density/mass = number or mass density c_ID = per-atom vector calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID @@ -176,9 +176,9 @@ to reduced when using a triclinic simulation box, as noted below.
-The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are -self-explanatory. Note that other atom attributes can be used as -inputs to this fix by using the compute +
The atom attribute values (vx,vy,vz,fx,fy,fz) are self-explanatory. +Note that other atom attributes (including atom postitions x,y,z) can +be used as inputs to this fix by using the compute property/atom command and then specifying an input value from that compute.
diff --git a/doc/fix_ave_spatial.txt b/doc/fix_ave_spatial.txt index d268f81381..ed3b95f328 100644 --- a/doc/fix_ave_spatial.txt +++ b/doc/fix_ave_spatial.txt @@ -22,8 +22,8 @@ dim, origin, delta can be repeated 1, 2, or 3 times for 1d, 2d, or 3d bins :l origin = {lower} or {center} or {upper} or coordinate value (distance units) delta = thickness of spatial bins in dim (distance units) :pre one or more input values can be listed :l -value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name :l - x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) +value = vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name :l + vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) density/number, density/mass = number or mass density c_ID = per-atom vector calculated by a compute with ID c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID @@ -161,9 +161,9 @@ to {reduced} when using a triclinic simulation box, as noted below. :line -The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are -self-explanatory. Note that other atom attributes can be used as -inputs to this fix by using the "compute +The atom attribute values (vx,vy,vz,fx,fy,fz) are self-explanatory. +Note that other atom attributes (including atom postitions x,y,z) can +be used as inputs to this fix by using the "compute property/atom"_compute_property_atom.html command and then specifying an input value from that compute. diff --git a/python/examples/pizza/vmd.py b/python/examples/pizza/vmd.py index 8b61ee2d81..7a49617b4c 100644 --- a/python/examples/pizza/vmd.py +++ b/python/examples/pizza/vmd.py @@ -54,6 +54,12 @@ except: PIZZA_VMDDEV = "win" try: from DEFAULTS import PIZZA_VMDARCH except: PIZZA_VMDARCH = "LINUX" +# try these settings for a Mac +#PIZZA_VMDNAME = "vmd" +#PIZZA_VMDDIR = "/Applications/VMD\ 1.8.7.app/Contents/vmd" +#PIZZA_VMDDEV = "win" +#PIZZA_VMDARCH = "MACOSXX86" + try: import pexpect except: print "pexpect from http://pypi.python.org/pypi/pexpect", \ diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index 5d9a2d652d..31604bbc01 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -47,8 +47,7 @@ PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp) nelements = 0; elements = NULL; - nparams = 0; - maxparam = 0; + nparams = maxparam = 0; params = NULL; elem2param = NULL; } @@ -369,9 +368,9 @@ void PairTersoff::read_file(char *file) int params_per_line = 17; char **words = new char*[params_per_line+1]; - if (params) delete [] params; + if (params) memory->sfree(params); params = NULL; - nparams = 0; + nparams = maxparam = 0; // open file on proc 0 diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index a7b880f706..4510558d91 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -34,7 +34,7 @@ using namespace LAMMPS_NS; enum{LOWER,CENTER,UPPER,COORD}; -enum{X,V,F,DENSITY_NUMBER,DENSITY_MASS,COMPUTE,FIX,VARIABLE}; +enum{V,F,DENSITY_NUMBER,DENSITY_MASS,COMPUTE,FIX,VARIABLE}; enum{SAMPLE,ALL}; enum{BOX,LATTICE,REDUCED}; enum{ONE,RUNNING,WINDOW}; @@ -102,17 +102,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { ids[nvalues] = NULL; - if (strcmp(arg[iarg],"x") == 0) { - which[nvalues] = X; - argindex[nvalues++] = 0; - } else if (strcmp(arg[iarg],"y") == 0) { - which[nvalues] = X; - argindex[nvalues++] = 1; - } else if (strcmp(arg[iarg],"z") == 0) { - which[nvalues] = X; - argindex[nvalues++] = 2; - - } else if (strcmp(arg[iarg],"vx") == 0) { + if (strcmp(arg[iarg],"vx") == 0) { which[nvalues] = V; argindex[nvalues++] = 0; } else if (strcmp(arg[iarg],"vy") == 0) { @@ -554,12 +544,11 @@ void FixAveSpatial::end_of_step() n = value2index[m]; j = argindex[m]; - // X,V,F adds coords,velocities,forces to values + // V,F adds velocities,forces to values - if (which[m] == X || which[m] == V || which[m] == F) { + if (which[m] == V || which[m] == F) { double **attribute; - if (which[m] == X) attribute = x; - else if (which[m] == V) attribute = atom->v; + if (which[m] == V) attribute = atom->v; else attribute = atom->f; if (regionflag == 0) { diff --git a/src/input.cpp b/src/input.cpp index 45181d41fb..d242f76ea7 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -529,7 +529,7 @@ void Input::echo() void Input::ifthenelse() { - if (narg < 4) error->all("Illegal if command"); + if (narg < 3) error->all("Illegal if command"); // substitute for variables in Boolean expression for "if" // in case expression was enclosed in quotes diff --git a/src/variable.cpp b/src/variable.cpp index 1136593216..fd236b7102 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -3163,13 +3163,13 @@ double Variable::evaluate_boolean(char *str) // number: push value onto stack // ---------------- - } else if (isdigit(onechar) || onechar == '.') { + } else if (isdigit(onechar) || onechar == '.' || onechar == '-') { if (expect == OP) error->all("Invalid Boolean syntax in if command"); expect = OP; // istop = end of number, including scientific notation - int istart = i; + int istart = i++; while (isdigit(str[i]) || str[i] == '.') i++; if (str[i] == 'e' || str[i] == 'E') { i++; @@ -3282,7 +3282,7 @@ double Variable::evaluate_boolean(char *str) // push current operation onto stack opstack[nopstack++] = op; - + } else error->all("Invalid Boolean syntax in if command"); } diff --git a/src/version.h b/src/version.h index 06073b234b..096a704d3b 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "1 Dec 2010" +#define LAMMPS_VERSION "3 Dec 2010"