diff --git a/doc/graphviz/lammps-classes.dot b/doc/graphviz/lammps-classes.dot index 3c2d2f418d..390dd2cc4b 100644 --- a/doc/graphviz/lammps-classes.dot +++ b/doc/graphviz/lammps-classes.dot @@ -18,8 +18,8 @@ digraph lammps { Up [shape=box label="Update" color=blue] Un [shape=box label="Universe" color=blue] Ti [shape=box label="Timer" color=blue] - Lt [label="Lattice"] Rg [label="Region" color=red] + Lt [label="Lattice"] Rb [shape=box label="RegionBlock"] Rs [shape=box label="RegionSphere"] Av [label="AtomVec" color=red] @@ -34,6 +34,7 @@ digraph lammps { Du [label="Dump" color=red] Fi [label="Fix" color=red] Cp [label="Compute" color=red] + Cm [label="Command" color=red] Th [label="Thermo"] Va [label="Variable"] Ew [shape=box label="Ewald"] @@ -71,16 +72,19 @@ digraph lammps { Dg [shape=box label="DumpCFG"] Ve [shape=box label="Verlet"] Rr [shape=box label="Respa"] + Ru [shape=box label="Run"] + Se [shape=box label="Set"] Pt [shape=box label="PPPMTIP4P"] Vs [shape=box label="VerletSplit"] Ro [shape=box label="RespaOMP"] Mc [shape=box label="MinCG"] Mf [shape=box label="MinFire"] La -> {At Ci Co Do Er Fo Gr In Me Mo Ne Ou Ti Up Un} [penwidth=2] - Do -> {Lt Rg} [penwidth=2] + Do -> {Rg Lt} [penwidth=2] Rg -> {Rb Rs} [style=dashed penwidth=2] Co -> {Cb Ct} [style=dashed penwidth=2] - In -> Va [penwidth=2] + In -> {Va Cm} [penwidth=2] + Cm -> {Ru Se} [style=dashed penwidth=2] Mo -> {Fi Cp} [penwidth=2] Fo -> {Pa Bo An Di Im Ks} [penwidth=2] Ks -> {Ew Pp} [style=dashed penwidth=2] diff --git a/doc/src/Developer_org.rst b/doc/src/Developer_org.rst index 6ecccf084d..133d567cb3 100644 --- a/doc/src/Developer_org.rst +++ b/doc/src/Developer_org.rst @@ -49,8 +49,8 @@ underscore character '_' to separate words. Outside of bundled libraries which may have different conventions, all C and C++ header files have a ``.h`` extension, all C++ files have a ``.cpp`` extension, and C files a ``.c`` extension. A small number of C++ classes and utility functions -are implemented with only a ``.h`` file. Examples are the Pointer class -or the MathVec functions. +are implemented with only a ``.h`` file. Examples are the Pointers and +Commands classes or the MathVec functions. Class topology -------------- @@ -144,7 +144,7 @@ implement specific commands that can be invoked before, after, or in between runs. For these an instance of the class is created, its command() method called and then, after completion, the class instance deleted. Examples for this are the create_box, create_atoms, minimize, -run, or velocity command styles. +run, set, or velocity command styles. For all those ``styles`` certain naming conventions are employed: for the fix nve command the class is called FixNVE and the source files are @@ -175,11 +175,11 @@ follows: - The Input class reads and processes input input strings and files, stores variables, and invokes :doc:`commands `. -- As discussed above, command style classes are directly derived from - the Pointers class. They provide input script commands that perform - one-time operations before/after/between simulations or which invoke a - simulation. They are instantiated from within the Input class, - invoked, then immediately destructed. +- Command style classes are derived from the Command class. They provide + input script commands that perform one-time operations + before/after/between simulations or which invoke a simulation. They + are usually instantiated from within the Input class, its ``command`` + method invoked, and then immediately destructed. - The Finish class is instantiated to print statistics to the screen after a simulation is performed, by commands like run and minimize. diff --git a/doc/src/JPG/lammps-classes.png b/doc/src/JPG/lammps-classes.png index e401328783..71b5af9ccc 100644 Binary files a/doc/src/JPG/lammps-classes.png and b/doc/src/JPG/lammps-classes.png differ diff --git a/doc/src/Modify_command.rst b/doc/src/Modify_command.rst index 2d0a1d99d9..e0e3ecbb8d 100644 --- a/doc/src/Modify_command.rst +++ b/doc/src/Modify_command.rst @@ -1,14 +1,15 @@ 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. +New commands can be added to LAMMPS input scripts by adding new classes +that are derived from the Command class and thus must 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 +instance 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: