lammps/doc/txt/Modify_variable.txt

47 lines
1.8 KiB
Plaintext

"Higher level section"_Modify.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)
:line
Variable options :h3
There is one class that computes and stores "variable"_variable.html
information in LAMMPS; see the file variable.cpp. The value
associated with a variable can be periodically printed to the screen
via the "print"_print.html, "fix print"_fix_print.html, or
"thermo_style custom"_thermo_style.html commands. Variables of style
"equal" can compute complex equations that involve the following types
of arguments:
thermo keywords = ke, vol, atoms, ...
other variables = v_a, v_myvar, ...
math functions = div(x,y), mult(x,y), add(x,y), ...
group functions = mass(group), xcm(group,x), ...
atom values = x\[123\], y\[3\], vx\[34\], ...
compute values = c_mytemp\[0\], c_thermo_press\[3\], ... :pre
Adding keywords for the "thermo_style custom"_thermo_style.html
command (which can then be accessed by variables) is discussed on the
"Modify thermo"_Modify_thermo.html doc page.
Adding a new math function of one or two arguments can be done by
editing one section of the Variable::evaluate() method. Search for
the word "customize" to find the appropriate location.
Adding a new group function can be done by editing one section of the
Variable::evaluate() method. Search for the word "customize" to find
the appropriate location. You may need to add a new method to the
Group class as well (see the group.cpp file).
Accessing a new atom-based vector can be done by editing one section
of the Variable::evaluate() method. Search for the word "customize"
to find the appropriate location.
Adding new "compute styles"_compute.html (whose calculated values can
then be accessed by variables) is discussed on the "Modify
compute"_Modify_compute.html doc page.