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.
26 lines
954 B
ReStructuredText
26 lines
954 B
ReStructuredText
Input script command style
|
|
==========================
|
|
|
|
New commands can be added to LAMMPS input scripts by adding new
|
|
classes that have a "command" method. For example, the create\_atoms,
|
|
read\_data, velocity, and run commands are all implemented in this
|
|
fashion. When such a command is encountered in the LAMMPS input
|
|
script, LAMMPS simply creates a class with the corresponding name,
|
|
invokes the "command" method of the class, and passes it the arguments
|
|
from the input script. The command method can perform whatever
|
|
operations it wishes on LAMMPS data structures.
|
|
|
|
The single method your new class must define is as follows:
|
|
|
|
+---------+-----------------------------------------+
|
|
| command | operations performed by the new command |
|
|
+---------+-----------------------------------------+
|
|
|
|
Of course, the new class can define other methods and variables as
|
|
needed.
|
|
|
|
|
|
.. _lws: http://lammps.sandia.gov
|
|
.. _ld: Manual.html
|
|
.. _lc: Commands_all.html
|