This is the first step for moving the documentation format from *.txt to the *.rst format. In the last years we've been automatically converting txt files from Steve's markup into RST to generate the documentation pages via Sphinx. The decision has now been made to fully migrate to RST and avoid the conversion in the future. This will enable us to fully use RST and Sphinx to improve the documentation. For the intermediate period, while there are still pending PRs with documentation changes, we will keep both source files and update the RST files accordingly.
46 lines
1.8 KiB
ReStructuredText
46 lines
1.8 KiB
ReStructuredText
Variable options
|
|
================
|
|
|
|
There is one class that computes and stores :doc:`variable <variable>`
|
|
information in LAMMPS; see the file variable.cpp. The value
|
|
associated with a variable can be periodically printed to the screen
|
|
via the :doc:`print <print>`, :doc:`fix print <fix_print>`, or
|
|
:doc:`thermo\_style custom <thermo_style>` commands. Variables of style
|
|
"equal" can compute complex equations that involve the following types
|
|
of arguments:
|
|
|
|
|
|
.. parsed-literal::
|
|
|
|
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], ...
|
|
|
|
Adding keywords for the :doc:`thermo\_style custom <thermo_style>`
|
|
command (which can then be accessed by variables) is discussed on the
|
|
:doc:`Modify thermo <Modify_thermo>` 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 :doc:`compute styles <compute>` (whose calculated values can
|
|
then be accessed by variables) is discussed on the :doc:`Modify compute <Modify_compute>` doc page.
|
|
|
|
|
|
.. _lws: http://lammps.sandia.gov
|
|
.. _ld: Manual.html
|
|
.. _lc: Commands_all.html
|