From ac2ab62f03f988f96ef2448cc416e08d54ded99a Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 24 Sep 2015 20:29:32 +0000 Subject: [PATCH] '' git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14062 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/doc2/dump_modify.html | 2 +- doc/doc2/variable.html | 78 +++++++++++++++++++++++++++++++++++---- 2 files changed, 71 insertions(+), 9 deletions(-) diff --git a/doc/doc2/dump_modify.html b/doc/doc2/dump_modify.html index 90cec61922..10d5592c30 100644 --- a/doc/doc2/dump_modify.html +++ b/doc/doc2/dump_modify.html @@ -269,7 +269,7 @@ performed with dump style xtc.

The text-based dump styles have a default C-style format string which simply specifies %d for integers and %g for floating-point values. The format keyword can be used to override the default with a new -C-style format string. Do not include a trailing "\n" newline +C-style format string. Do not include a trailing "\\n" newline character in the format string. This option has no effect on the dcd and xtc dump styles since they write binary files. Note that for the cfg style, the first two fields (atom id and type) are not diff --git a/doc/doc2/variable.html b/doc/doc2/variable.html index aa4380cca0..104d57dee4 100644 --- a/doc/doc2/variable.html +++ b/doc/doc2/variable.html @@ -49,7 +49,7 @@ python arg = function equal or atom args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references numbers = 0.0, 100, -5.4, 2.8e-4, etc - constants = PI, version + constants = PI, version, on, off, true, false, yes, no thermo keywords = vol, ke, press, etc from thermo_style math operators = (), -x, x+y, x-y, x*y, x/y, x^y, x%y, x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, !x @@ -70,6 +70,7 @@ angmom(group,dim,region), torque(group,dim,region), inertia(group,dimdim,region), omega(group,dim,region) special functions = sum(x), min(x), max(x), ave(x), trap(x), slope(x), gmask(x), rmask(x), grmask(x,y), next(x) + feature functions = is_active(category,feature,exact), is_defined(category,id,exact) atom value = id[i], mass[i], type[i], mol[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i], q[i] atom vector = id, mass, type, mol, x, y, z, vx, vy, vz, fx, fy, fz, q compute references = c_ID, c_ID[i], c_ID[i][j] @@ -422,7 +423,7 @@ references to other variables.

- + @@ -458,12 +459,15 @@ inlcuded in the formula evaluation. The variable evaluates to 0.0 for atoms not in the group.

Constants are set at compile time and cannot be changed. PI will -return the number 3.14159265358979323846, version will return a -numeric version code of the current LAMMPS version (e.g. version -2 Sep 2015 will return the number 20150902). The corresponding value -for newer versions of LAMMPS will be larger, for older versions of -LAMMPS will be smaller. This can be used to make input scripts adapt -automatically to LAMMPS versions, for example: +return the number 3.14159265358979323846; on, true or yes will +return 1.0; off, false or no will return 0.0; version will +return a numeric version code of the current LAMMPS version (e.g. +version 2 Sep 2015 will return the number 20150902). The corresponding +value for newer versions of LAMMPS will be larger, for older versions +of LAMMPS will be smaller. This can be used to have input scripts +adapt automatically to LAMMPS versions, when non-backwards compatible +syntax changes are introduced. Here is an illustrative example (which +will not work, since the version has been introduced more recently):

if $(version<20140513) then "communicate vel yes" else "comm_modify vel yes" 
 
@@ -789,6 +793,64 @@ operates.


+

Feature Functions +

+

Feature functions allow to probe the running LAMMPS executable for +whether specific features are either active, defined, or available. +The functions take two arguments, a category and a corresponding +argument. The arguments are strings thus cannot be formulas +themselves (only $-style immediate variable expansion is possible). +Return value is either 1.0 or 0.0 depending on whether the function +evaluates to true or false, respectively. +

+

The is_active() function allows to query for active settings which +are grouped by categories. Currently supported categories and +arguments are: +

+ +

Most of the settings are self-explanatory, the single argument in the +pair category allows to check whether a pair style supports a +Pair::single() function as needed by compute group/group and others +features or LAMMPS, respa allows to check whether the inner/middle/outer +mode of r-RESPA is supported. In the various style categories, +the checking is also done using suffix flags, if available and enabled. +

+

Example 1: disable use of suffix for pppm when using GPU package (i.e. run it on the CPU concurrently to running the pair style on the GPU), but do use the suffix otherwise (e.g. with USER-OMP). +

+
pair_style lj/cut/coul/long 14.0
+if $(is_active(package,gpu)) then "suffix off"
+kspace_style pppm 
+
+

Example 2: use r-RESPA with inner/outer cutoff, if supported by pair style, otherwise fall back to using pair and reducing the outer time step +

+
timestep $(2.0*(1.0+*is_active(pair,respa))
+if $(is_active(pair,respa)) then "run_style respa 4 3 2 2  improper 1 inner 2 5.5 7.0 outer 3 kspace 4" else "run_style respa 3 3 2  improper 1 pair 2 kspace 3" 
+
+

The is_defined() function allows to query categories like compute, +dump, fix, group, region, and variable whether an entry +with the provided name or id is defined. +

+

The is_available() function allows to query whether a specific +optional feature is available, i.e. compiled in. This currently +works for the following categories: command, compute, fix, +and pair_style. For all categories except command also appending +active suffixes is tried before reporting failure. +

+
+

Atom Values and Vectors

Atom values take an integer argument I from 1 to N, where I is the

Number 0.2, 100, 1.0e20, -15.4, etc
Constant PI, version
Constant PI, version, on, off, true, false, yes, no
Thermo keywords vol, pe, ebond, etc
Math operators (), -x, x+y, x-y, x*y, x/y, x^y, x%y,
Math operators (), -x, x+y, x-y, x*y, x/y, x^y, x%y, x == y, x != y, x < y, x <= y, x > y, x >= y, x && y, x || y, !x