关于lammps中的variable的碎碎念
Note:
(1)“immediate”variables
lammps中,将⽤圆括号声明的形如$(formula)的变量,称之为“immediate”变量。
(2)“string”
lammps变量定义命令的语法:
variable  name  style  argas  …
很明显,name说的就是变量的“名字”,style后⾯的⼀串⼦就是指“string”,指的是⼀系列的输⼊参数。variable used in lambda
(3)“value”
The “value” is the numeric quantity resulting from evaluation of the string. Note that the same string can generate different values when it is evaluated at different times during a simulation.
The Commands parse doc page explains how occurrences of a variable name in an input script line are replaced by the variable’s string. The variable name can be referenced as $x if the name “x” is a single character, or as ${LoopVar} if the name “LoopVar” is one or more characters.
Many of the styles store one or more strings. Note that a single string can contain spaces (multiple words), if it is enclosed in quotes in the variable command. When the variable is substituted for in another input script command, its returned string will then be interpreted as multiple arguments in the expanded command.(4)“string”中如果有空格,可以加单引号,双引号,三引号,将该 string看作是⼀个argument,详细介绍:
If you want text with spaces to be treated as a single argument, it can be enclosed in either single or double or triple quotes. A long single argument enclosed in single or double quotes can span multiple lines if the “&” character is used, as described above. When the lines are concatenated together (and the “&” characters and line breaks removed), the text will become a single line. If you want multiple lines of an argument to retain their line breaks, the text can be enclosed in triple quotes, in which case “&” characters are not needed. For example:
print"Volume = $v”
print'Volume = $v’
if"${steps} > 1000"thenquit
variableastring"red green blue &
purpleorangecyan"
print"""
Systemvolume = $v
Systemtemperature = $t
""”
In each case, the single, double, or triple quotes are removed when the single argument they enclose is stored internally.

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。