0% found this document useful (0 votes)
62 views2 pages

Lammps

The document describes different styles of variables in Atomsk including: 1) File style variables where a filename is provided containing values, one per line, that are assigned to the variable. 2) Index style variables where one or more strings are specified and initially the first string is assigned, and next() advances to the next string. 3) Atomfile style is similar to file style but values are assigned on a per-atom basis from sets in the file.

Uploaded by

Bruce Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views2 pages

Lammps

The document describes different styles of variables in Atomsk including: 1) File style variables where a filename is provided containing values, one per line, that are assigned to the variable. 2) Index style variables where one or more strings are specified and initially the first string is assigned, and next() advances to the next string. 3) Atomfile style is similar to file style but values are assigned on a per-atom basis from sets in the file.

Uploaded by

Bruce Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

atomsk:

"C:\Program Files\Atomsk\atomsk.exe"

variable f file values.txt

For the atomfile style, a filename is provided which contains one or more sets of
values, to assign on a per-atom basis
to the variable. The format of the file is described below.

For the file style, a filename is provided which contains a list of strings to
assign to the variable,
one per line. The strings can be numeric values if desired.
See the discussion of the next() function below for equal-style variables,
which will convert the string of a file-style variable into a numeric value in a
formula.

When a file-style variable is defined, the file is opened and the string on the
first line is
read and stored with the variable. This means the variable can then be evaluated as
many times
as desired and will return that string. There are two ways to cause the next string
from the file
to be read: use the next command or the next() function in an equal- or atom-style
variable,
as discussed below.

If a variable name is a single lower-case character from “a” to “z”,


it can be used in an input script command as $a or $z.
If it is multiple letters, it can be used as ${myTemp}.

The rules for formatting the file are as follows.


A comment character “#” can be used anywhere on a line; text starting with the
comment character is stripped.
Blank lines are skipped. The first “word” of a non-blank line, delimited by white-
space, is the “string”
assigned to the variable.As described below, for variable styles index, loop, file,
universe, and uloop,
which string is assigned to a variable can be incremented via the next command.
When there are no more strings to assign, the variable is exhausted and a flag is
set that
causes the next jump command encountered in the input script to be skipped.

This enables the construction of simple loops in the input script that are iterated
over and then exited from.

For the index style, one or more strings are specified. Initially, the first string
is assigned to the
variable. Each time a next command is used with the variable name, the next string
is assigned.
All processors assign the same string to the variable.

label loop
variable file.lst loop 100
read_data variable
next

label loopa
variable a loop 5
label loopb
variable b loop 5
print "A,B = $a,$b"
run 10000
if $b > 2 then "jump in.script break"
next b
jump in.script loopb
label break
variable b delete

next a
jump in.script loopa

As explained above, an exhausted variable can be re-used in an input script. The


delete style also removes the variable, the same as if it were exhausted, allowing
it to be redefined later in the input script or when the input script is looped
over. This can be useful when breaking out of a loop via the if and jump commands
before the variable would become exhausted. For example,

When an atomfile-style variable is defined, the file is opened and the first set of
per-atom values are read and
stored with the variable. This means the variable can then be evaluated as many
times as desired and will return
those values. There are two ways to cause the next set of per-atom values from the
file to be read:
use the next command or the next() function in an atom-style variable, as discussed
below

You might also like