From 37b51e682fa0cf3a4d7d87ac0d994fd9c503b21d Mon Sep 17 00:00:00 2001
From: sjplimp
(6) If you want text with spaces to be treated as a single argument, -it can be enclosed in double quotes. The quotes are removed when the -single argument is stored in its final form. See the dump modify -format or if commands for examples. A "#" -or "$" character that is between double quotes will not be treated as -a comment indicator in (2) or substituted for as a variable in (3). +it can be enclosed in either double or single quotes. E.g. +
+print "Volume = $v" +print 'Volume = $v' ++
The quotes are removed when the single argument is stored internally. +See the dump modify format or if commands +for examples. A "#" or "$" character that is between quotes will not +be treated as a comment indicator in (2) or substituted for as a +variable in (3). +
+IMPORTANT NOTE: If the argument is itself a command that requires a +quoted argument (e.g. using a print command as part of an +if or run every command), then the double and +single quotes can be nested in the usual manner. See the doc pages +for those commands for examples. Only one of level of nesting is +allowed, but that should be sufficient for most use cases.
angle_style class2 angle_coeff * 75.0 -angle_coeff 1 bb 10.5872 1.0119 1.5228 +angle_coeff 1 bb 10.5872 1.0119 1.5228 +angle_coeff * ba 3.6551 24.895 1.0119 1.5228
Description:
diff --git a/doc/angle_class2.txt b/doc/angle_class2.txt index c94e10d982..25719ceff4 100644 --- a/doc/angle_class2.txt +++ b/doc/angle_class2.txt @@ -16,7 +16,8 @@ angle_style class2 :pre angle_style class2 angle_coeff * 75.0 -angle_coeff 1 bb 10.5872 1.0119 1.5228 :pre +angle_coeff 1 bb 10.5872 1.0119 1.5228 +angle_coeff * ba 3.6551 24.895 1.0119 1.5228 :pre [Description:] diff --git a/doc/dihedral_class2.html b/doc/dihedral_class2.html index 92418d6f2b..6da37c9a2a 100644 --- a/doc/dihedral_class2.html +++ b/doc/dihedral_class2.html @@ -18,7 +18,12 @@Examples:
dihedral_style class2 -dihedral_coeff 1 100 75 100 70 80 60 +dihedral_coeff 1 100 75 100 70 80 60 +dihedral_coeff * mbt 3.5945 0.1704 -0.5490 1.5228 +dihedral_coeff * ebt 0.3417 0.3264 -0.9036 0.1368 0.0 -0.8080 1.0119 1.1010 +dihedral_coeff 2 at 0.0 -0.1850 -0.7963 -2.0220 0.0 -0.3991 110.2453 105.1270 +dihedral_coeff * aat -13.5271 110.2453 105.1270 +dihedral_coeff * bb13 0.0 1.0119 1.1010
Description:
diff --git a/doc/dihedral_class2.txt b/doc/dihedral_class2.txt index 4f83ce6c58..141112823a 100644 --- a/doc/dihedral_class2.txt +++ b/doc/dihedral_class2.txt @@ -15,7 +15,12 @@ dihedral_style class2 :pre [Examples:] dihedral_style class2 -dihedral_coeff 1 100 75 100 70 80 60 :pre +dihedral_coeff 1 100 75 100 70 80 60 +dihedral_coeff * mbt 3.5945 0.1704 -0.5490 1.5228 +dihedral_coeff * ebt 0.3417 0.3264 -0.9036 0.1368 0.0 -0.8080 1.0119 1.1010 +dihedral_coeff 2 at 0.0 -0.1850 -0.7963 -2.0220 0.0 -0.3991 110.2453 105.1270 +dihedral_coeff * aat -13.5271 110.2453 105.1270 +dihedral_coeff * bb13 0.0 1.0119 1.1010 :pre [Description:] diff --git a/doc/if.html b/doc/if.html index f0c7af78df..2d6bf982bb 100644 --- a/doc/if.html +++ b/doc/if.html @@ -13,64 +13,81 @@Syntax:
-if value1 operator value2 then t1 t2 ... else e1 e2 ... +if boolean then t1 t2 ... elif boolean f1 f2 ... elif boolean f1 f2 ... else e1 e2 ...-
Examples:
-if ${steps} > 1000 then exit
-if $x <= $y then "print X is smaller = $x" else "print Y is smaller = $y"
-if ${eng} > 0.0 then "timestep 0.005"
-if ${eng} > ${eng_previous} then "jump file1" else "jump file2"
+if "${steps} > 1000" then exit
+if "$x <= $y" then "print X is smaller = $x" else "print Y is smaller = $y"
+if "(${eng} > 0.0) || ($n < 1000)" then &
+ "timestep 0.005" &
+elif $n<10000 &
+ "timestep 0.01" &
+else &
+ "timestep 0.02" &
+ "print 'Max step reached'"
+if "${eng} > ${eng_previous}" then "jump file1" else "jump file2"
Description:
This command provides an in-then-else capability within an input
-script. Two values are numerically compared to each other and the
-result is TRUE or FALSE. Note that as in the examples above, either
-of the two values can be variables, as defined by the
-variable command, so that when the if command is
-executed, the variable(s) will be evaluated, which could calculate a
-user-defined formula that reflects the current state of the
-simulation.
+script. A Boolean expression is evaluted and the result is TRUE or
+FALSE. Note that as in the examples above, the expression can contain
+variables, as defined by the variable command, which
+will be evaluated as part of the expression. Thus a user-defined
+formula that reflects the current state of the simulation can be used
+to issue one or more new commands.
-If the result of the if test is TRUE, then one or more commands (t1,
-t2, ..., tN) are executed. If the result of the if test is FALSE and
-no optional "else" argument is included, then the if command does
-nothing. If the result of the if test is FALSE and the optional
-"else" argument is included, then one or more commands (e1,
-e2, ..., eN) are executed.
+
If the result of the Boolean expression is TRUE, then one or more
+commands (t1, t2, ..., tN) are executed. If it is FALSE, then Boolean
+expressions associated with successive elif keywords are evaluated
+until one is found to be true, in which case its commands (f1, f2,
+..., fN) are executed. If no Boolean expression is TRUE, then the
+commands associated witht the else keyword, namely (e1, e2, ..., eN),
+are executed. The elif and else keywords and their associated
+commands are optional. If they aren't specified and the initial
+Boolean expression is FALSE, then no commands are executed.
-Each then or else command (t1, e1, etc) can be any valid LAMMPS input
-script command. Each command should be enclosed in quotes, so it will
-be treated as a single argument, as in the examples above.
+
The allowed syntax for each Boolean expression is described below.
+
+Each command (t1, f1, e1, etc) can be any valid LAMMPS input script
+command. If the command is more than one word, it must enclosed in
+quotes, so it will be treated as a single argument, as in the examples
+above.
+
+IMPORTANT NOTE: If a command itself requires a quoted argument (e.g. a
+print command), then double and single quotes can be used
+and nested in the usual manner, as in the examples above and below.
+See this section of the manual for more
+details on using quotes in arguments. Only one of level of nesting is
+allowed, but that should be sufficient for most use cases.
Note that by using the line continuation character "&", the if command
-can be spread across many lines, though it is still a single
-command:
+can be spread across many lines, though it is still a single command:
-if $a < $b then &
- "print Minimum value = $a" &
+if "$a < $b" then &
+ "print 'Minimum value = $a'" &
"run 1000" &
else &
- "print Minimum value = $b" &
+ 'print "Minimum value = $b"' &
"minimize 0.001 0.001 1000 10000"
-Note that if any executed comand is a bogus LAMMPS command, such as
-"exit" in the first example above, then executing the command will
-cause LAMMPS to halt.
+
Note that if one of the commands to execute is an invalid LAMMPS
+command, such as "exit" in the first example above, then executing the
+command will cause LAMMPS to halt.
Note that by jumping to a label in the same input script, the if
command can be used to break out of a loop. See the variable
-delete for info on how to delete the associated loop
-variable, so that it can be re-used later in the input script.
+delete command for info on how to delete the associated
+loop variable, so that it can be re-used later in the input script.
Here is an example of a double loop which uses the if and
jump commands to break out of the inner loop when a
@@ -82,7 +99,7 @@ variable a loop 5
variable b loop 5
print "A,B = $a,$b"
run 10000
- if $b > 2 then "jump in.script break"
+ if '$b > 2' then "print 'Jumping to another script'" "jump in.script break"
next b
jump in.script loopb
label break
@@ -91,6 +108,52 @@ variable b delete
next a
jump in.script loopa
+
+
+The Boolean expressions for the if and elif keywords have a C-like
+syntax. Note that each expression is a single argument within the if
+command. Thus if you want to include spaces in the expression for
+clarity, you must enclose the entire expression in quotes.
+
+An expression is built out of numbers
+
+0.2, 100, 1.0e20, -15.4, etc
+
+and Boolean operators:
+
+A == B
+A != B
+A < B
+A <= B
+A > B
+A >= B
+A && B
+A || B
+
+Each A and B is a number or a variable reference like $a or ${abc},
+or another Boolean expression.
+
+If a variable is used it must produce a number when evaluated and
+substituted for in the expression.
+
+Expressions are evaluated left to right and have the usual C-style
+precedence: the 4 relational operators "<", "<=", ">", and ">=" have
+the highest precedence; those 4 relational operators before the
+remaining two relational operators "==" and "!="; those two relational
+operators before the logical AND operator "&&"; and the AND operator
+"&&" before the logical OR operator "||". Parenthesis can be used to
+group one or more portions of an expression and/or enforce a different
+order of evaluation than what would occur with the default precedence.
+
+The 6 relational operators return either a 1.0 or 0.0 depending on
+whether the relationship between x and y is true or false. The
+logical AND operator will return 1.0 of both its arguments are
+non-zero, else return a 0.0. The logical OR operator will return 1.0
+of either of its arguments is non-zero, else return a 0.0.
+
+The overall Boolean expression produces a TRUE result if the result is
+non-zero. If the result is zero, the expression result is FALSE.
+
Restrictions: none
Related commands:
diff --git a/doc/if.txt b/doc/if.txt
index ca823f030c..523e7490d1 100644
--- a/doc/if.txt
+++ b/doc/if.txt
@@ -10,64 +10,81 @@ if command :h3
[Syntax:]
-if value1 operator value2 then t1 t2 ... else e1 e2 ... :pre
+if boolean then t1 t2 ... elif boolean f1 f2 ... elif boolean f1 f2 ... else e1 e2 ... :pre
-value1 = 1st value
-operator = "<" or "<=" or ">" or ">=" or "==" or "!="
-value2 = 2nd value
+boolean = a Boolean expression evaluated as TRUE or FALSE (see below)
then = required word
t1,t2,...,tN = one or more LAMMPS commands to execute if condition is met, each enclosed in quotes
+elif = optional word, can appear multiple times
+f1,f2,...,fN = one or more LAMMPS commands to execute if elif condition is met, each enclosed in quotes (optional arguments)
else = optional argument
-e1,e2,...,eN = one or more LAMMPS commands to execute if condition is not met, each enclosed in quotes (optional arguments) :ul
+e1,e2,...,eN = one or more LAMMPS commands to execute if no condition is met, each enclosed in quotes (optional arguments) :ul
[Examples:]
-if $\{steps\} > 1000 then exit
-if $x <= $y then "print X is smaller = $x" else "print Y is smaller = $y"
-if $\{eng\} > 0.0 then "timestep 0.005"
-if $\{eng\} > $\{eng_previous\} then "jump file1" else "jump file2" :pre
+if "$\{steps\} > 1000" then exit
+if "$x <= $y" then "print X is smaller = $x" else "print Y is smaller = $y"
+if "($\{eng\} > 0.0) || ($n < 1000)" then &
+ "timestep 0.005" &
+elif $n<10000 &
+ "timestep 0.01" &
+else &
+ "timestep 0.02" &
+ "print 'Max step reached'"
+if "$\{eng\} > $\{eng_previous\}" then "jump file1" else "jump file2" :pre
[Description:]
This command provides an in-then-else capability within an input
-script. Two values are numerically compared to each other and the
-result is TRUE or FALSE. Note that as in the examples above, either
-of the two values can be variables, as defined by the
-"variable"_variable.html command, so that when the if command is
-executed, the variable(s) will be evaluated, which could calculate a
-user-defined formula that reflects the current state of the
-simulation.
+script. A Boolean expression is evaluted and the result is TRUE or
+FALSE. Note that as in the examples above, the expression can contain
+variables, as defined by the "variable"_variable.html command, which
+will be evaluated as part of the expression. Thus a user-defined
+formula that reflects the current state of the simulation can be used
+to issue one or more new commands.
-If the result of the if test is TRUE, then one or more commands (t1,
-t2, ..., tN) are executed. If the result of the if test is FALSE and
-no optional "else" argument is included, then the if command does
-nothing. If the result of the if test is FALSE and the optional
-"else" argument is included, then one or more commands (e1,
-e2, ..., eN) are executed.
+If the result of the Boolean expression is TRUE, then one or more
+commands (t1, t2, ..., tN) are executed. If it is FALSE, then Boolean
+expressions associated with successive elif keywords are evaluated
+until one is found to be true, in which case its commands (f1, f2,
+..., fN) are executed. If no Boolean expression is TRUE, then the
+commands associated witht the else keyword, namely (e1, e2, ..., eN),
+are executed. The elif and else keywords and their associated
+commands are optional. If they aren't specified and the initial
+Boolean expression is FALSE, then no commands are executed.
-Each then or else command (t1, e1, etc) can be any valid LAMMPS input
-script command. Each command should be enclosed in quotes, so it will
-be treated as a single argument, as in the examples above.
+The syntax for Boolean expressions is described below.
+
+Each command (t1, f1, e1, etc) can be any valid LAMMPS input script
+command. If the command is more than one word, it must enclosed in
+quotes, so it will be treated as a single argument, as in the examples
+above.
+
+IMPORTANT NOTE: If a command itself requires a quoted argument (e.g. a
+"print"_print.html command), then double and single quotes can be used
+and nested in the usual manner, as in the examples above and below.
+See "this section"_Section_commands.html#3_2 of the manual for more
+details on using quotes in arguments. Only one of level of nesting is
+allowed, but that should be sufficient for most use cases.
Note that by using the line continuation character "&", the if command
-can be spread across many lines, though it is still a single
-command:
+can be spread across many lines, though it is still a single command:
-if $a < $b then &
- "print Minimum value = $a" &
+if "$a < $b" then &
+ "print 'Minimum value = $a'" &
"run 1000" &
else &
- "print Minimum value = $b" &
+ 'print "Minimum value = $b"' &
"minimize 0.001 0.001 1000 10000" :pre
-Note that if any executed comand is a bogus LAMMPS command, such as
-"exit" in the first example above, then executing the command will
-cause LAMMPS to halt.
+Note that if one of the commands to execute is an invalid LAMMPS
+command, such as "exit" in the first example above, then executing the
+command will cause LAMMPS to halt.
Note that by jumping to a label in the same input script, the if
command can be used to break out of a loop. See the "variable
-delete"_variable.html for info on how to delete the associated loop
-variable, so that it can be re-used later in the input script.
+delete"_variable.html command for info on how to delete the associated
+loop variable, so that it can be re-used later in the input script.
Here is an example of a double loop which uses the if and
"jump"_jump.html commands to break out of the inner loop when a
@@ -79,7 +96,7 @@ variable a loop 5
variable b loop 5
print "A,B = $a,$b"
run 10000
- if $b > 2 then "jump in.script break"
+ if '$b > 2' then "print 'Jumping to another script'" "jump in.script break"
next b
jump in.script loopb
label break
@@ -87,6 +104,52 @@ variable b delete :pre
next a
jump in.script loopa :pre
+:line
+
+The Boolean expressions for the if and elif keywords have a C-like
+syntax. Note that each expression is a single argument within the if
+command. Thus if you want to include spaces in the expression for
+clarity, you must enclose the entire expression in quotes.
+
+An expression is built out of numbers
+
+0.2, 100, 1.0e20, -15.4, etc :pre
+
+and Boolean operators:
+
+A == B
+A != B
+A < B
+A <= B
+A > B
+A >= B
+A && B
+A || B :pre
+
+Each A and B is a number or a variable reference like $a or $\{abc\},
+or another Boolean expression.
+
+If a variable is used it must produce a number when evaluated and
+substituted for in the expression.
+
+Expressions are evaluated left to right and have the usual C-style
+precedence: the 4 relational operators "<", "<=", ">", and ">=" have
+the highest precedence; those 4 relational operators before the
+remaining two relational operators "==" and "!="; those two relational
+operators before the logical AND operator "&&"; and the AND operator
+"&&" before the logical OR operator "||". Parenthesis can be used to
+group one or more portions of an expression and/or enforce a different
+order of evaluation than what would occur with the default precedence.
+
+The 6 relational operators return either a 1.0 or 0.0 depending on
+whether the relationship between x and y is true or false. The
+logical AND operator will return 1.0 if both its arguments are
+non-zero, else return a 0.0. The logical OR operator will return 1.0
+if either of its arguments is non-zero, else return a 0.0.
+
+The overall Boolean expression produces a TRUE result if the result is
+non-zero. If the result is zero, the expression result is FALSE.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/improper_class2.html b/doc/improper_class2.html
index dd3e2cdb11..6fa33fdb2b 100644
--- a/doc/improper_class2.html
+++ b/doc/improper_class2.html
@@ -18,7 +18,8 @@
Examples:
improper_style class2
-improper_coeff 1 100.0 0
+improper_coeff 1 100.0 0
+improper_coeff * aa 0.0 0.0 0.0 115.06 130.01 115.06
Description:
diff --git a/doc/improper_class2.txt b/doc/improper_class2.txt
index c38cf6750f..c2c2419a6e 100644
--- a/doc/improper_class2.txt
+++ b/doc/improper_class2.txt
@@ -15,7 +15,8 @@ improper_style class2 :pre
[Examples:]
improper_style class2
-improper_coeff 1 100.0 0 :pre
+improper_coeff 1 100.0 0
+improper_coeff * aa 0.0 0.0 0.0 115.06 130.01 115.06 :pre
[Description:]
diff --git a/doc/print.html b/doc/print.html
index fe33dc45f5..af57d5e680 100644
--- a/doc/print.html
+++ b/doc/print.html
@@ -13,23 +13,23 @@
Syntax:
-print str1 str2 ...
+print str
-
Examples:
-print Done with equilibration -print The system volume is now $v +print "Done with equilibration" +print Vol=$v print "The system volume is now $v"Description:
-Print one or more text strings to the screen and logfile. The -individual text strings are effectively concatenated into a single -string, and one line of output is generated. Thus the 2nd and 3rd -examples above are equivalent. If variables are included in any of -the strings, they will be evaluated and their current values printed. +
Print a text string to the screen and logfile. One line of output is +generated. If the string has white space in it (spaces, tabs, etc), +then you must enclose it in single or double quotes so that it is +treated as a single argument. If variables are included in the +string, they will be evaluated and their current values printed.
If you want the print command to be executed multiple times (with changing variable values), there are 3 options. First, consider using diff --git a/doc/print.txt b/doc/print.txt index 42ff98843a..4e6001c7db 100644 --- a/doc/print.txt +++ b/doc/print.txt @@ -10,23 +10,23 @@ print command :h3 [Syntax:] -print str1 str2 ... :pre +print str :pre -str1,str2,...,strN = one or more text strings to print, which may contain variables :ul +str1 = text string to print, which may contain variables :ul [Examples:] -print Done with equilibration -print The system volume is now $v +print "Done with equilibration" +print Vol=$v print "The system volume is now $v" :pre [Description:] -Print one or more text strings to the screen and logfile. The -individual text strings are effectively concatenated into a single -string, and one line of output is generated. Thus the 2nd and 3rd -examples above are equivalent. If variables are included in any of -the strings, they will be evaluated and their current values printed. +Print a text string to the screen and logfile. One line of output is +generated. If the string has white space in it (spaces, tabs, etc), +then you must enclose it in single or double quotes so that it is +treated as a single argument. If variables are included in the +string, they will be evaluated and their current values printed. If you want the print command to be executed multiple times (with changing variable values), there are 3 options. First, consider using diff --git a/doc/run.html b/doc/run.html index eae351b275..f1d9a24cfb 100644 --- a/doc/run.html +++ b/doc/run.html @@ -41,7 +41,7 @@ run 1000000 upto run 100 start 0 stop 1000 run 1000 pre no post yes -run 100000 start 0 stop 1000000 every 1000 "print Protein Rg = $r" +run 100000 start 0 stop 1000000 every 1000 "print 'Protein Rg = $r'" run 100000 every 1000 NULL
Description: @@ -120,7 +120,10 @@ number of arguments. Each of the trailing arguments is a single LAMMPS command, and each command should be enclosed in quotes, so that the entire command will be treated as a single argument. This will also prevent any variables in the command from being evaluated until -it is executed multiple times during the run. +it is executed multiple times during the run. Note that if a command +itself needs one of its arguments quoted (e.g. the print +command), then you can use a combination of single and double quotes, +as in the example above.
The every keyword is a means to avoid listing a long series of runs and interleaving commands in your input script. For example, a @@ -161,10 +164,10 @@ command can be spread across many lines, though it is still a single command:
run 100000 every 1000 & - "print Minimum value = $a" & - "print Maximum value = $b" & - "print Temp = $c" & - "print Press = $d" + "print 'Minimum value = $a'" & + "print 'Maximum value = $b'" & + "print 'Temp = $c'" & + "print 'Press = $d'"
If the pre and post options are set to "no" when used with the every keyword, then the 1st run will do the full setup and the last diff --git a/doc/run.txt b/doc/run.txt index 4e295a3e91..6b28a719af 100644 --- a/doc/run.txt +++ b/doc/run.txt @@ -34,7 +34,7 @@ run 10000 run 1000000 upto run 100 start 0 stop 1000 run 1000 pre no post yes -run 100000 start 0 stop 1000000 every 1000 "print Protein Rg = $r" +run 100000 start 0 stop 1000000 every 1000 "print 'Protein Rg = $r'" run 100000 every 1000 NULL :pre [Description:] @@ -113,7 +113,10 @@ number of arguments. Each of the trailing arguments is a single LAMMPS command, and each command should be enclosed in quotes, so that the entire command will be treated as a single argument. This will also prevent any variables in the command from being evaluated until -it is executed multiple times during the run. +it is executed multiple times during the run. Note that if a command +itself needs one of its arguments quoted (e.g. the "print"_print.html +command), then you can use a combination of single and double quotes, +as in the example above. The {every} keyword is a means to avoid listing a long series of runs and interleaving commands in your input script. For example, a @@ -154,10 +157,10 @@ command can be spread across many lines, though it is still a single command: run 100000 every 1000 & - "print Minimum value = $a" & - "print Maximum value = $b" & - "print Temp = $c" & - "print Press = $d" :pre + "print 'Minimum value = $a'" & + "print 'Maximum value = $b'" & + "print 'Temp = $c'" & + "print 'Press = $d'" :pre If the {pre} and {post} options are set to "no" when used with the {every} keyword, then the 1st run will do the full setup and the last diff --git a/doc/variable.html b/doc/variable.html index d9bcc47cd2..66e4d88293 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -332,9 +332,9 @@ relational operators "<", "<=", ">", and ">="; those 4 relational operators before the remaining two relational operators "==" and "!="; those two relational operators before the logical AND operator "&&"; and the AND operator "&&" before the logical OR operator "||". -Parenthesis can be used to group one or more portions of a formula and -enforce a different order of evaluation than what would occur with the -default precedence. +Parenthesis can be used to group one or more portions of a formula +and/or enforce a different order of evaluation than what would occur +with the default precedence.
The 6 relational operators return either a 1.0 or 0.0 depending on whether the relationship between x and y is true or false. For diff --git a/doc/variable.txt b/doc/variable.txt index 13edc7bce8..d12497b239 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -331,17 +331,17 @@ relational operators "<", "<=", ">", and ">="; those 4 relational operators before the remaining two relational operators "==" and "!="; those two relational operators before the logical AND operator "&&"; and the AND operator "&&" before the logical OR operator "||". -Parenthesis can be used to group one or more portions of a formula and -enforce a different order of evaluation than what would occur with the -default precedence. +Parenthesis can be used to group one or more portions of a formula +and/or enforce a different order of evaluation than what would occur +with the default precedence. The 6 relational operators return either a 1.0 or 0.0 depending on whether the relationship between x and y is true or false. For example the expression x<10.0 in an atom-style variable formula will return 1.0 for all atoms whose x-coordinate is less than 10.0, and 0.0 -for the others. The logical AND operator will return 1.0 of both its +for the others. The logical AND operator will return 1.0 if both its arguments are non-zero, else return a 0.0. The logical OR operator -will return 1.0 of either of its arguments is non-zero, else return a +will return 1.0 if either of its arguments is non-zero, else return a 0.0. These relational and logical operators can be used as a masking or selection operation in a formula. For example, the number of atoms whose properties satifsy one or more criteria could be calculated by