Merge pull request #2707 from akohlmey/commands-base-class
Add Command base class for command styles
This commit is contained in:
@ -18,8 +18,8 @@ digraph lammps {
|
|||||||
Up [shape=box label="Update" color=blue]
|
Up [shape=box label="Update" color=blue]
|
||||||
Un [shape=box label="Universe" color=blue]
|
Un [shape=box label="Universe" color=blue]
|
||||||
Ti [shape=box label="Timer" color=blue]
|
Ti [shape=box label="Timer" color=blue]
|
||||||
Lt [label="Lattice"]
|
|
||||||
Rg [label="Region" color=red]
|
Rg [label="Region" color=red]
|
||||||
|
Lt [label="Lattice"]
|
||||||
Rb [shape=box label="RegionBlock"]
|
Rb [shape=box label="RegionBlock"]
|
||||||
Rs [shape=box label="RegionSphere"]
|
Rs [shape=box label="RegionSphere"]
|
||||||
Av [label="AtomVec" color=red]
|
Av [label="AtomVec" color=red]
|
||||||
@ -34,6 +34,7 @@ digraph lammps {
|
|||||||
Du [label="Dump" color=red]
|
Du [label="Dump" color=red]
|
||||||
Fi [label="Fix" color=red]
|
Fi [label="Fix" color=red]
|
||||||
Cp [label="Compute" color=red]
|
Cp [label="Compute" color=red]
|
||||||
|
Cm [label="Command" color=red]
|
||||||
Th [label="Thermo"]
|
Th [label="Thermo"]
|
||||||
Va [label="Variable"]
|
Va [label="Variable"]
|
||||||
Ew [shape=box label="Ewald"]
|
Ew [shape=box label="Ewald"]
|
||||||
@ -71,16 +72,19 @@ digraph lammps {
|
|||||||
Dg [shape=box label="DumpCFG"]
|
Dg [shape=box label="DumpCFG"]
|
||||||
Ve [shape=box label="Verlet"]
|
Ve [shape=box label="Verlet"]
|
||||||
Rr [shape=box label="Respa"]
|
Rr [shape=box label="Respa"]
|
||||||
|
Ru [shape=box label="Run"]
|
||||||
|
Se [shape=box label="Set"]
|
||||||
Pt [shape=box label="PPPMTIP4P"]
|
Pt [shape=box label="PPPMTIP4P"]
|
||||||
Vs [shape=box label="VerletSplit"]
|
Vs [shape=box label="VerletSplit"]
|
||||||
Ro [shape=box label="RespaOMP"]
|
Ro [shape=box label="RespaOMP"]
|
||||||
Mc [shape=box label="MinCG"]
|
Mc [shape=box label="MinCG"]
|
||||||
Mf [shape=box label="MinFire"]
|
Mf [shape=box label="MinFire"]
|
||||||
La -> {At Ci Co Do Er Fo Gr In Me Mo Ne Ou Ti Up Un} [penwidth=2]
|
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]
|
Rg -> {Rb Rs} [style=dashed penwidth=2]
|
||||||
Co -> {Cb Ct} [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]
|
Mo -> {Fi Cp} [penwidth=2]
|
||||||
Fo -> {Pa Bo An Di Im Ks} [penwidth=2]
|
Fo -> {Pa Bo An Di Im Ks} [penwidth=2]
|
||||||
Ks -> {Ew Pp} [style=dashed penwidth=2]
|
Ks -> {Ew Pp} [style=dashed penwidth=2]
|
||||||
|
|||||||
@ -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
|
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
|
``.h`` extension, all C++ files have a ``.cpp`` extension, and C files a
|
||||||
``.c`` extension. A small number of C++ classes and utility functions
|
``.c`` extension. A small number of C++ classes and utility functions
|
||||||
are implemented with only a ``.h`` file. Examples are the Pointer class
|
are implemented with only a ``.h`` file. Examples are the Pointers and
|
||||||
or the MathVec functions.
|
Commands classes or the MathVec functions.
|
||||||
|
|
||||||
Class topology
|
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
|
between runs. For these an instance of the class is created, its
|
||||||
command() method called and then, after completion, the class instance
|
command() method called and then, after completion, the class instance
|
||||||
deleted. Examples for this are the create_box, create_atoms, minimize,
|
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
|
For all those ``styles`` certain naming conventions are employed: for
|
||||||
the fix nve command the class is called FixNVE and the source files are
|
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,
|
- The Input class reads and processes input input strings and files,
|
||||||
stores variables, and invokes :doc:`commands <Commands_all>`.
|
stores variables, and invokes :doc:`commands <Commands_all>`.
|
||||||
|
|
||||||
- As discussed above, command style classes are directly derived from
|
- Command style classes are derived from the Command class. They provide
|
||||||
the Pointers class. They provide input script commands that perform
|
input script commands that perform one-time operations
|
||||||
one-time operations before/after/between simulations or which invoke a
|
before/after/between simulations or which invoke a simulation. They
|
||||||
simulation. They are instantiated from within the Input class,
|
are usually instantiated from within the Input class, its ``command``
|
||||||
invoked, then immediately destructed.
|
method invoked, and then immediately destructed.
|
||||||
|
|
||||||
- The Finish class is instantiated to print statistics to the screen
|
- The Finish class is instantiated to print statistics to the screen
|
||||||
after a simulation is performed, by commands like run and minimize.
|
after a simulation is performed, by commands like run and minimize.
|
||||||
|
|||||||
@ -59,31 +59,25 @@ Members of ``lammpsplugin_t``
|
|||||||
* - author
|
* - author
|
||||||
- String with the name and email of the author
|
- String with the name and email of the author
|
||||||
* - creator.v1
|
* - creator.v1
|
||||||
- Pointer to factory function for pair, bond, angle, dihedral, or improper styles
|
- Pointer to factory function for pair, bond, angle, dihedral, improper or command styles
|
||||||
* - creator.v2
|
* - creator.v2
|
||||||
- Pointer to factory function for compute, fix, or region styles
|
- Pointer to factory function for compute, fix, or region styles
|
||||||
* - creator.v3
|
|
||||||
- Pointer to factory function for command styles
|
|
||||||
* - handle
|
* - handle
|
||||||
- Pointer to the open DSO file handle
|
- Pointer to the open DSO file handle
|
||||||
|
|
||||||
Only one of the three alternate creator entries can be used at a time
|
Only one of the three alternate creator entries can be used at a time
|
||||||
and which of those is determined by the style of plugin. The "creator.v1"
|
and which of those is determined by the style of plugin. The
|
||||||
element is for factory functions of supported styles computing forces (i.e.
|
"creator.v1" element is for factory functions of supported styles
|
||||||
pair, bond, angle, dihedral, or improper styles) and the function takes
|
computing forces (i.e. command, pair, bond, angle, dihedral, or
|
||||||
as single argument the pointer to the LAMMPS instance. The factory function
|
improper styles) and the function takes as single argument the pointer
|
||||||
is cast to the ``lammpsplugin_factory1`` type before assignment. The
|
to the LAMMPS instance. The factory function is cast to the
|
||||||
"creator.v2" element is for factory functions creating an instance of
|
``lammpsplugin_factory1`` type before assignment. The "creator.v2"
|
||||||
a fix, compute, or region style and takes three arguments: a pointer to
|
element is for factory functions creating an instance of a fix, compute,
|
||||||
the LAMMPS instance, an integer with the length of the argument list and
|
or region style and takes three arguments: a pointer to the LAMMPS
|
||||||
a ``char **`` pointer to the list of arguments. The factory function pointer
|
instance, an integer with the length of the argument list and a ``char
|
||||||
needs to be cast to the ``lammpsplugin_factory2`` type before assignment.
|
**`` pointer to the list of arguments. The factory function pointer
|
||||||
The "creator.v3" element takes the same arguments as "creator.v3" but is
|
needs to be cast to the ``lammpsplugin_factory2`` type before
|
||||||
specific to creating command styles: the factory function has to instantiate
|
assignment.
|
||||||
the command style locally passing the LAMMPS pointer as argument and then
|
|
||||||
call its "command" member function with the number and list of arguments.
|
|
||||||
The factory function pointer needs to be cast to the
|
|
||||||
``lammpsplugin_factory3`` type before assignment.
|
|
||||||
|
|
||||||
Pair style example
|
Pair style example
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
@ -123,12 +117,12 @@ function would look like this:
|
|||||||
|
|
||||||
The factory function in this example is called ``morse2creator()``. It
|
The factory function in this example is called ``morse2creator()``. It
|
||||||
receives a pointer to the LAMMPS class as only argument and thus has to
|
receives a pointer to the LAMMPS class as only argument and thus has to
|
||||||
be assigned to the *creator.v1* member of the plugin struct and cast to the
|
be assigned to the *creator.v1* member of the plugin struct and cast to
|
||||||
``lammpsplugin_factory1`` pointer type. It returns a
|
the ``lammpsplugin_factory1`` function pointer type. It returns a
|
||||||
pointer to the allocated class instance derived from the ``Pair`` class.
|
pointer to the allocated class instance derived from the ``Pair`` class.
|
||||||
This function may be declared static to avoid clashes with other plugins.
|
This function may be declared static to avoid clashes with other
|
||||||
The name of the derived class, ``PairMorse2``, must be unique inside
|
plugins. The name of the derived class, ``PairMorse2``, however must be
|
||||||
the entire LAMMPS executable.
|
unique inside the entire LAMMPS executable.
|
||||||
|
|
||||||
Fix style example
|
Fix style example
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
@ -169,9 +163,9 @@ Below is an example for that:
|
|||||||
|
|
||||||
Command style example
|
Command style example
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
For command styles there is a third variant of factory function as
|
Command styles also use the first variant of factory function as
|
||||||
demonstrated in the following example, which also shows that the
|
demonstrated in the following example, which also shows that the
|
||||||
implementation of the plugin class may also be within the same
|
implementation of the plugin class may be within the same source
|
||||||
file as the plugin interface code:
|
file as the plugin interface code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: C++
|
||||||
@ -180,15 +174,15 @@ file as the plugin interface code:
|
|||||||
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
class Hello : protected Pointers {
|
class Hello : public Command {
|
||||||
public:
|
public:
|
||||||
Hello(class LAMMPS *lmp) : Pointers(lmp) {};
|
Hello(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -202,10 +196,9 @@ file as the plugin interface code:
|
|||||||
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hellocreator(LAMMPS *lmp, int argc, char **argv)
|
static void hellocreator(LAMMPS *lmp)
|
||||||
{
|
{
|
||||||
Hello hello(lmp);
|
return new Hello(lmp);
|
||||||
hello.command(argc,argv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
@ -216,9 +209,9 @@ file as the plugin interface code:
|
|||||||
plugin.version = LAMMPS_VERSION;
|
plugin.version = LAMMPS_VERSION;
|
||||||
plugin.style = "command";
|
plugin.style = "command";
|
||||||
plugin.name = "hello";
|
plugin.name = "hello";
|
||||||
plugin.info = "Hello world command v1.0";
|
plugin.info = "Hello world command v1.1";
|
||||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
plugin.creator.v3 = (lammpsplugin_factory3 *) &hellocreator;
|
plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator;
|
||||||
plugin.handle = handle;
|
plugin.handle = handle;
|
||||||
(*register_plugin)(&plugin,lmp);
|
(*register_plugin)(&plugin,lmp);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 286 KiB |
@ -1,14 +1,15 @@
|
|||||||
Input script command style
|
Input script command style
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
New commands can be added to LAMMPS input scripts by adding new
|
New commands can be added to LAMMPS input scripts by adding new classes
|
||||||
classes that have a "command" method. For example, the create_atoms,
|
that are derived from the Command class and thus must have a "command"
|
||||||
read_data, velocity, and run commands are all implemented in this
|
method. For example, the create_atoms, read_data, velocity, and run
|
||||||
fashion. When such a command is encountered in the LAMMPS input
|
commands are all implemented in this fashion. When such a command is
|
||||||
script, LAMMPS simply creates a class with the corresponding name,
|
encountered in the LAMMPS input script, LAMMPS simply creates a class
|
||||||
invokes the "command" method of the class, and passes it the arguments
|
instance with the corresponding name, invokes the "command" method of
|
||||||
from the input script. The command method can perform whatever
|
the class, and passes it the arguments from the input script. The
|
||||||
operations it wishes on LAMMPS data structures.
|
command method can perform whatever operations it wishes on LAMMPS data
|
||||||
|
structures.
|
||||||
|
|
||||||
The single method your new class must define is as follows:
|
The single method your new class must define is as follows:
|
||||||
|
|
||||||
|
|||||||
@ -2,16 +2,16 @@
|
|||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "command.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "pointers.h"
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
class Hello : protected Pointers {
|
class Hello : public Command {
|
||||||
public:
|
public:
|
||||||
Hello(class LAMMPS *lmp) : Pointers(lmp) {};
|
Hello(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -25,10 +25,9 @@ void Hello::command(int argc, char **argv)
|
|||||||
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hellocreator(LAMMPS *lmp, int argc, char **argv)
|
static Command *hellocreator(LAMMPS *lmp)
|
||||||
{
|
{
|
||||||
Hello hello(lmp);
|
return new Hello(lmp);
|
||||||
hello.command(argc,argv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
@ -39,9 +38,9 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
|||||||
plugin.version = LAMMPS_VERSION;
|
plugin.version = LAMMPS_VERSION;
|
||||||
plugin.style = "command";
|
plugin.style = "command";
|
||||||
plugin.name = "hello";
|
plugin.name = "hello";
|
||||||
plugin.info = "Hello world command v1.0";
|
plugin.info = "Hello world command v1.1";
|
||||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
plugin.creator.v3 = (lammpsplugin_factory3 *) &hellocreator;
|
plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator;
|
||||||
plugin.handle = handle;
|
plugin.handle = handle;
|
||||||
(*register_plugin)(&plugin,lmp);
|
(*register_plugin)(&plugin,lmp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,13 +62,13 @@ CommandStyle(kim,KimCommand)
|
|||||||
#ifndef LMP_KIM_COMMAND_H
|
#ifndef LMP_KIM_COMMAND_H
|
||||||
#define LMP_KIM_COMMAND_H
|
#define LMP_KIM_COMMAND_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class KimCommand : protected Pointers {
|
class KimCommand : public Command {
|
||||||
public:
|
public:
|
||||||
KimCommand(class LAMMPS *lmp) : Pointers(lmp) {};
|
KimCommand(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -20,13 +20,13 @@ CommandStyle(message,Message)
|
|||||||
#ifndef LMP_MESSAGE_H
|
#ifndef LMP_MESSAGE_H
|
||||||
#define LMP_MESSAGE_H
|
#define LMP_MESSAGE_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Message : protected Pointers {
|
class Message : public Command {
|
||||||
public:
|
public:
|
||||||
Message(class LAMMPS *lmp) : Pointers(lmp) {};
|
Message(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -20,13 +20,13 @@ CommandStyle(server,Server)
|
|||||||
#ifndef LMP_SERVER_H
|
#ifndef LMP_SERVER_H
|
||||||
#define LMP_SERVER_H
|
#define LMP_SERVER_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Server : protected Pointers {
|
class Server : public Command {
|
||||||
public:
|
public:
|
||||||
Server(class LAMMPS *lmp) : Pointers(lmp) {};
|
Server(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ namespace LAMMPS_NS
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Plugin::Plugin(LAMMPS *lmp) : Pointers(lmp) {}
|
Plugin::Plugin(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ namespace LAMMPS_NS
|
|||||||
"style {} from plugin",
|
"style {} from plugin",
|
||||||
plugin->name));
|
plugin->name));
|
||||||
}
|
}
|
||||||
(*command_map)[plugin->name] = (Input::CommandCreator)plugin->creator.v3;
|
(*command_map)[plugin->name] = (Input::CommandCreator)plugin->creator.v1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
utils::logmesg(lmp,fmt::format("Loading plugin for {} styles not "
|
utils::logmesg(lmp,fmt::format("Loading plugin for {} styles not "
|
||||||
|
|||||||
@ -21,12 +21,12 @@ CommandStyle(plugin,Plugin)
|
|||||||
#define LMP_PLUGIN_H
|
#define LMP_PLUGIN_H
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS
|
namespace LAMMPS_NS
|
||||||
{
|
{
|
||||||
|
|
||||||
class Plugin : protected Pointers {
|
class Plugin : public Command {
|
||||||
public:
|
public:
|
||||||
Plugin(class LAMMPS *);
|
Plugin(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ enum{NOHYPER,GLOBAL,LOCAL};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(nullptr) {}
|
Hyper::Hyper(LAMMPS *lmp) : Command(lmp), dumplist(nullptr) {}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform hyperdynamics simulation
|
perform hyperdynamics simulation
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(hyper,Hyper)
|
|||||||
#ifndef LMP_HYPER_H
|
#ifndef LMP_HYPER_H
|
||||||
#define LMP_HYPER_H
|
#define LMP_HYPER_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Hyper : protected Pointers {
|
class Hyper : public Command {
|
||||||
public:
|
public:
|
||||||
Hyper(class LAMMPS *);
|
Hyper(class LAMMPS *);
|
||||||
~Hyper() {}
|
~Hyper() {}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ using namespace MathConst;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
NEB::NEB(LAMMPS *lmp) : Pointers(lmp), all(nullptr), rdist(nullptr) {}
|
NEB::NEB(LAMMPS *lmp) : Command(lmp), all(nullptr), rdist(nullptr) {}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
internal NEB constructor, called from TAD
|
internal NEB constructor, called from TAD
|
||||||
@ -50,7 +50,7 @@ NEB::NEB(LAMMPS *lmp) : Pointers(lmp), all(nullptr), rdist(nullptr) {}
|
|||||||
|
|
||||||
NEB::NEB(LAMMPS *lmp, double etol_in, double ftol_in, int n1steps_in,
|
NEB::NEB(LAMMPS *lmp, double etol_in, double ftol_in, int n1steps_in,
|
||||||
int n2steps_in, int nevery_in, double *buf_init, double *buf_final)
|
int n2steps_in, int nevery_in, double *buf_init, double *buf_final)
|
||||||
: Pointers(lmp), all(nullptr), rdist(nullptr)
|
: Command(lmp), all(nullptr), rdist(nullptr)
|
||||||
{
|
{
|
||||||
double delx,dely,delz;
|
double delx,dely,delz;
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(neb,NEB)
|
|||||||
#ifndef LMP_NEB_H
|
#ifndef LMP_NEB_H
|
||||||
#define LMP_NEB_H
|
#define LMP_NEB_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class NEB : protected Pointers {
|
class NEB : public Command {
|
||||||
public:
|
public:
|
||||||
NEB(class LAMMPS *);
|
NEB(class LAMMPS *);
|
||||||
NEB(class LAMMPS *, double, double, int, int, int, double *, double *);
|
NEB(class LAMMPS *, double, double, int, int, int, double *, double *);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
PRD::PRD(LAMMPS *lmp) : Pointers(lmp) {}
|
PRD::PRD(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform PRD simulation on one or more replicas
|
perform PRD simulation on one or more replicas
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(prd,PRD)
|
|||||||
#ifndef LMP_PRD_H
|
#ifndef LMP_PRD_H
|
||||||
#define LMP_PRD_H
|
#define LMP_PRD_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class PRD : protected Pointers {
|
class PRD : public Command {
|
||||||
public:
|
public:
|
||||||
PRD(class LAMMPS *);
|
PRD(class LAMMPS *);
|
||||||
~PRD() {}
|
~PRD() {}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {}
|
TAD::TAD(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(tad,TAD)
|
|||||||
#ifndef LMP_TAD_H
|
#ifndef LMP_TAD_H
|
||||||
#define LMP_TAD_H
|
#define LMP_TAD_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class TAD : protected Pointers {
|
class TAD : public Command {
|
||||||
public:
|
public:
|
||||||
TAD(class LAMMPS *);
|
TAD(class LAMMPS *);
|
||||||
~TAD();
|
~TAD();
|
||||||
|
|||||||
@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Temper::Temper(LAMMPS *lmp) : Pointers(lmp) {}
|
Temper::Temper(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(temper,Temper)
|
|||||||
#ifndef LMP_TEMPER_H
|
#ifndef LMP_TEMPER_H
|
||||||
#define LMP_TEMPER_H
|
#define LMP_TEMPER_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Temper : protected Pointers {
|
class Temper : public Command {
|
||||||
public:
|
public:
|
||||||
Temper(class LAMMPS *);
|
Temper(class LAMMPS *);
|
||||||
~Temper();
|
~Temper();
|
||||||
|
|||||||
@ -67,7 +67,7 @@ static const char cite_neb_spin[] =
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
NEBSpin::NEBSpin(LAMMPS *lmp) : Pointers(lmp) {
|
NEBSpin::NEBSpin(LAMMPS *lmp) : Command(lmp) {
|
||||||
if (lmp->citeme) lmp->citeme->add(cite_neb_spin);
|
if (lmp->citeme) lmp->citeme->add(cite_neb_spin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(neb/spin,NEBSpin)
|
|||||||
#ifndef LMP_NEB_SPIN_H
|
#ifndef LMP_NEB_SPIN_H
|
||||||
#define LMP_NEB_SPIN_H
|
#define LMP_NEB_SPIN_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class NEBSpin : protected Pointers {
|
class NEBSpin : public Command {
|
||||||
public:
|
public:
|
||||||
NEBSpin(class LAMMPS *);
|
NEBSpin(class LAMMPS *);
|
||||||
~NEBSpin();
|
~NEBSpin();
|
||||||
|
|||||||
@ -22,13 +22,13 @@ CommandStyle(group2ndx,Group2Ndx)
|
|||||||
#ifndef LMP_GROUP_NDX_H
|
#ifndef LMP_GROUP_NDX_H
|
||||||
#define LMP_GROUP_NDX_H
|
#define LMP_GROUP_NDX_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Group2Ndx : protected Pointers {
|
class Group2Ndx : public Command {
|
||||||
public:
|
public:
|
||||||
Group2Ndx(class LAMMPS *lmp) : Pointers(lmp) {};
|
Group2Ndx(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
private:
|
private:
|
||||||
void write_group(FILE *, int);
|
void write_group(FILE *, int);
|
||||||
|
|||||||
@ -22,14 +22,14 @@ CommandStyle(ndx2group,Ndx2Group)
|
|||||||
#ifndef LMP_NDX_GROUP_H
|
#ifndef LMP_NDX_GROUP_H
|
||||||
#define LMP_NDX_GROUP_H
|
#define LMP_NDX_GROUP_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Ndx2Group : protected Pointers {
|
class Ndx2Group : public Command {
|
||||||
public:
|
public:
|
||||||
Ndx2Group(class LAMMPS *lmp) : Pointers(lmp) {};
|
Ndx2Group(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
void create(const std::string &, const std::vector<tagint> &);
|
void create(const std::string &, const std::vector<tagint> &);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
TemperGrem::TemperGrem(LAMMPS *lmp) : Pointers(lmp) {}
|
TemperGrem::TemperGrem(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(temper/grem,TemperGrem)
|
|||||||
#ifndef LMP_TEMPER_GREM_H
|
#ifndef LMP_TEMPER_GREM_H
|
||||||
#define LMP_TEMPER_GREM_H
|
#define LMP_TEMPER_GREM_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class TemperGrem : protected Pointers {
|
class TemperGrem : public Command {
|
||||||
public:
|
public:
|
||||||
TemperGrem(class LAMMPS *);
|
TemperGrem(class LAMMPS *);
|
||||||
~TemperGrem();
|
~TemperGrem();
|
||||||
|
|||||||
@ -42,7 +42,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
TemperNPT::TemperNPT(LAMMPS *lmp) : Pointers(lmp) {}
|
TemperNPT::TemperNPT(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@ CommandStyle(temper/npt,TemperNPT)
|
|||||||
#ifndef LMP_TEMPERNPT_H
|
#ifndef LMP_TEMPERNPT_H
|
||||||
#define LMP_TEMPERNPT_H
|
#define LMP_TEMPERNPT_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class TemperNPT : protected Pointers {
|
class TemperNPT : public Command {
|
||||||
public:
|
public:
|
||||||
TemperNPT(class LAMMPS *);
|
TemperNPT(class LAMMPS *);
|
||||||
~TemperNPT();
|
~TemperNPT();
|
||||||
|
|||||||
@ -32,7 +32,7 @@ enum{REGULAR,ESKM};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(nullptr)
|
DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr)
|
||||||
{
|
{
|
||||||
external_force_clear = 1;
|
external_force_clear = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,11 +11,11 @@ CommandStyle(dynamical_matrix,DynamicalMatrix)
|
|||||||
#ifndef LMP_DYNAMICAL_MATRIX_H
|
#ifndef LMP_DYNAMICAL_MATRIX_H
|
||||||
#define LMP_DYNAMICAL_MATRIX_H
|
#define LMP_DYNAMICAL_MATRIX_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class DynamicalMatrix : protected Pointers {
|
class DynamicalMatrix : public Command {
|
||||||
public:
|
public:
|
||||||
DynamicalMatrix(class LAMMPS *);
|
DynamicalMatrix(class LAMMPS *);
|
||||||
virtual ~DynamicalMatrix();
|
virtual ~DynamicalMatrix();
|
||||||
@ -66,7 +66,7 @@ namespace LAMMPS_NS {
|
|||||||
int file_flag; // 1 custom file name, 0 dynmat.dat
|
int file_flag; // 1 custom file name, 0 dynmat.dat
|
||||||
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ enum{REGULAR,BALLISTICO};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(nullptr)
|
ThirdOrder::ThirdOrder(LAMMPS *lmp) : Command(lmp), fp(nullptr)
|
||||||
{
|
{
|
||||||
external_force_clear = 1;
|
external_force_clear = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,11 @@ CommandStyle(third_order,ThirdOrder)
|
|||||||
#ifndef LMP_THIRD_ORDER_H
|
#ifndef LMP_THIRD_ORDER_H
|
||||||
#define LMP_THIRD_ORDER_H
|
#define LMP_THIRD_ORDER_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ThirdOrder : protected Pointers {
|
class ThirdOrder : public Command {
|
||||||
public:
|
public:
|
||||||
ThirdOrder(class LAMMPS *);
|
ThirdOrder(class LAMMPS *);
|
||||||
virtual ~ThirdOrder();
|
virtual ~ThirdOrder();
|
||||||
|
|||||||
@ -51,7 +51,7 @@ enum{X,Y,Z};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Balance::Balance(LAMMPS *lmp) : Pointers(lmp)
|
Balance::Balance(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
MPI_Comm_size(world,&nprocs);
|
MPI_Comm_size(world,&nprocs);
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(balance,Balance)
|
|||||||
#ifndef LMP_BALANCE_H
|
#ifndef LMP_BALANCE_H
|
||||||
#define LMP_BALANCE_H
|
#define LMP_BALANCE_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Balance : protected Pointers {
|
class Balance : public Command {
|
||||||
public:
|
public:
|
||||||
class RCB *rcb;
|
class RCB *rcb;
|
||||||
class FixStore *fixstore; // per-atom weights stored in FixStore
|
class FixStore *fixstore; // per-atom weights stored in FixStore
|
||||||
|
|||||||
@ -35,7 +35,7 @@ enum{X=0,Y,Z,YZ,XZ,XY};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ChangeBox::ChangeBox(LAMMPS *lmp) : Pointers(lmp) {}
|
ChangeBox::ChangeBox(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(change_box,ChangeBox)
|
|||||||
#ifndef LMP_CHANGE_BOX_H
|
#ifndef LMP_CHANGE_BOX_H
|
||||||
#define LMP_CHANGE_BOX_H
|
#define LMP_CHANGE_BOX_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ChangeBox : protected Pointers {
|
class ChangeBox : public Command {
|
||||||
public:
|
public:
|
||||||
ChangeBox(class LAMMPS *);
|
ChangeBox(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
29
src/command.h
Normal file
29
src/command.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/* -*- c++ -*- ----------------------------------------------------------
|
||||||
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
|
http://lammps.sandia.gov, Sandia National Laboratories
|
||||||
|
Steve Plimpton, sjplimp@sandia.gov
|
||||||
|
|
||||||
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||||
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||||
|
certain rights in this software. This software is distributed under
|
||||||
|
the GNU General Public License.
|
||||||
|
|
||||||
|
See the README file in the top-level LAMMPS directory.
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#ifndef LMP_COMMAND_H
|
||||||
|
#define LMP_COMMAND_H
|
||||||
|
|
||||||
|
#include "pointers.h"
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
|
class Command : protected Pointers {
|
||||||
|
public:
|
||||||
|
Command(class LAMMPS *lmp) : Pointers(lmp) {};
|
||||||
|
virtual void command(int, char **) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -52,7 +52,7 @@ enum{NONE,RATIO,SUBSET};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp), basistype(nullptr) {}
|
CreateAtoms::CreateAtoms(LAMMPS *lmp) : Command(lmp), basistype(nullptr) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(create_atoms,CreateAtoms)
|
|||||||
#ifndef LMP_CREATE_ATOMS_H
|
#ifndef LMP_CREATE_ATOMS_H
|
||||||
#define LMP_CREATE_ATOMS_H
|
#define LMP_CREATE_ATOMS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class CreateAtoms : protected Pointers {
|
class CreateAtoms : public Command {
|
||||||
public:
|
public:
|
||||||
CreateAtoms(class LAMMPS *);
|
CreateAtoms(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ enum{MANY,SBOND,SANGLE,SDIHEDRAL,SIMPROPER};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
CreateBonds::CreateBonds(LAMMPS *lmp) : Pointers(lmp) {}
|
CreateBonds::CreateBonds(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(create_bonds,CreateBonds)
|
|||||||
#ifndef LMP_CREATE_BONDS_H
|
#ifndef LMP_CREATE_BONDS_H
|
||||||
#define LMP_CREATE_BONDS_H
|
#define LMP_CREATE_BONDS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class CreateBonds : protected Pointers {
|
class CreateBonds : public Command {
|
||||||
public:
|
public:
|
||||||
CreateBonds(class LAMMPS *);
|
CreateBonds(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -12,22 +12,24 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "create_box.h"
|
#include "create_box.h"
|
||||||
#include <cstring>
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "atom_vec.h"
|
#include "atom_vec.h"
|
||||||
|
#include "comm.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "region_prism.h"
|
#include "region_prism.h"
|
||||||
#include "force.h"
|
|
||||||
#include "comm.h"
|
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "error.h"
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
CreateBox::CreateBox(LAMMPS *lmp) : Pointers(lmp) {}
|
CreateBox::CreateBox(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(create_box,CreateBox)
|
|||||||
#ifndef LMP_CREATE_BOX_H
|
#ifndef LMP_CREATE_BOX_H
|
||||||
#define LMP_CREATE_BOX_H
|
#define LMP_CREATE_BOX_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class CreateBox : protected Pointers {
|
class CreateBox : public Command {
|
||||||
public:
|
public:
|
||||||
CreateBox(class LAMMPS *);
|
CreateBox(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Pointers(lmp) {}
|
DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,12 +20,12 @@ CommandStyle(delete_atoms,DeleteAtoms)
|
|||||||
#ifndef LMP_DELETE_ATOMS_H
|
#ifndef LMP_DELETE_ATOMS_H
|
||||||
#define LMP_DELETE_ATOMS_H
|
#define LMP_DELETE_ATOMS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class DeleteAtoms : protected Pointers {
|
class DeleteAtoms : public Command {
|
||||||
public:
|
public:
|
||||||
DeleteAtoms(class LAMMPS *);
|
DeleteAtoms(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -30,7 +30,7 @@ enum{MULTI,ATOM,BOND,ANGLE,DIHEDRAL,IMPROPER,STATS};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
DeleteBonds::DeleteBonds(LAMMPS *lmp) : Pointers(lmp) {}
|
DeleteBonds::DeleteBonds(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(delete_bonds,DeleteBonds)
|
|||||||
#ifndef LMP_DELETE_BONDS_H
|
#ifndef LMP_DELETE_BONDS_H
|
||||||
#define LMP_DELETE_BONDS_H
|
#define LMP_DELETE_BONDS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class DeleteBonds : protected Pointers {
|
class DeleteBonds : public Command {
|
||||||
public:
|
public:
|
||||||
DeleteBonds(class LAMMPS *);
|
DeleteBonds(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -26,13 +26,13 @@ CommandStyle(kim_query,Deprecated)
|
|||||||
#ifndef LMP_DEPRECATED_H
|
#ifndef LMP_DEPRECATED_H
|
||||||
#define LMP_DEPRECATED_H
|
#define LMP_DEPRECATED_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Deprecated : protected Pointers {
|
class Deprecated : public Command {
|
||||||
public:
|
public:
|
||||||
Deprecated(class LAMMPS *lmp) : Pointers(lmp) {};
|
Deprecated(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ enum{MOVE,RAMP,RANDOM,ROTATE};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp)
|
DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
mvec = nullptr;
|
mvec = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(displace_atoms,DisplaceAtoms)
|
|||||||
#ifndef LMP_DISPLACE_ATOMS_H
|
#ifndef LMP_DISPLACE_ATOMS_H
|
||||||
#define LMP_DISPLACE_ATOMS_H
|
#define LMP_DISPLACE_ATOMS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class DisplaceAtoms : protected Pointers {
|
class DisplaceAtoms : public Command {
|
||||||
public:
|
public:
|
||||||
DisplaceAtoms(class LAMMPS *);
|
DisplaceAtoms(class LAMMPS *);
|
||||||
~DisplaceAtoms();
|
~DisplaceAtoms();
|
||||||
|
|||||||
@ -20,15 +20,15 @@ CommandStyle(info,Info)
|
|||||||
#ifndef LMP_INFO_H
|
#ifndef LMP_INFO_H
|
||||||
#define LMP_INFO_H
|
#define LMP_INFO_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Info : protected Pointers {
|
class Info : public Command {
|
||||||
public:
|
public:
|
||||||
Info(class LAMMPS *lmp) : Pointers(lmp) {};
|
Info(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|
||||||
bool is_active(const char *, const char *);
|
bool is_active(const char *, const char *);
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "comm_brick.h"
|
#include "comm_brick.h"
|
||||||
#include "comm_tiled.h"
|
#include "comm_tiled.h"
|
||||||
|
#include "command.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "dihedral.h"
|
#include "dihedral.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
@ -82,7 +83,7 @@ command line flags, holds the factory of commands and creates and
|
|||||||
initializes an instance of the Variable class.
|
initializes an instance of the Variable class.
|
||||||
|
|
||||||
To execute a command, a specific class instance, derived from
|
To execute a command, a specific class instance, derived from
|
||||||
:cpp:class:`Pointers`, is created, then its ``command()`` member
|
:cpp:class:`Command`, is created, then its ``command()`` member
|
||||||
function executed, and finally the class instance is deleted.
|
function executed, and finally the class instance is deleted.
|
||||||
|
|
||||||
\endverbatim
|
\endverbatim
|
||||||
@ -789,7 +790,9 @@ int Input::execute_command()
|
|||||||
|
|
||||||
if (command_map->find(command) != command_map->end()) {
|
if (command_map->find(command) != command_map->end()) {
|
||||||
CommandCreator &command_creator = (*command_map)[command];
|
CommandCreator &command_creator = (*command_map)[command];
|
||||||
command_creator(lmp,narg,arg);
|
Command *cmd = command_creator(lmp);
|
||||||
|
cmd->command(narg,arg);
|
||||||
|
delete cmd;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,10 +806,9 @@ int Input::execute_command()
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void Input::command_creator(LAMMPS *lmp, int narg, char **arg)
|
Command *Input::command_creator(LAMMPS *lmp)
|
||||||
{
|
{
|
||||||
T cmd(lmp);
|
return new T(lmp);
|
||||||
cmd.command(narg,arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
class Command;
|
||||||
|
|
||||||
class Input : protected Pointers {
|
class Input : protected Pointers {
|
||||||
friend class Info;
|
friend class Info;
|
||||||
@ -59,12 +60,12 @@ class Input : protected Pointers {
|
|||||||
FILE **infiles; // list of open input files
|
FILE **infiles; // list of open input files
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef void (*CommandCreator)(LAMMPS *, int, char **);
|
typedef Command * (*CommandCreator)(LAMMPS *);
|
||||||
typedef std::map<std::string,CommandCreator> CommandCreatorMap;
|
typedef std::map<std::string,CommandCreator> CommandCreatorMap;
|
||||||
CommandCreatorMap *command_map;
|
CommandCreatorMap *command_map;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template <typename T> static void command_creator(LAMMPS *, int, char **);
|
template <typename T> static Command *command_creator(LAMMPS *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parse(); // parse an input text line
|
void parse(); // parse an input text line
|
||||||
|
|||||||
@ -20,7 +20,6 @@ extern "C" {
|
|||||||
|
|
||||||
typedef void *(lammpsplugin_factory1)(void *);
|
typedef void *(lammpsplugin_factory1)(void *);
|
||||||
typedef void *(lammpsplugin_factory2)(void *, int, char **);
|
typedef void *(lammpsplugin_factory2)(void *, int, char **);
|
||||||
typedef void (lammpsplugin_factory3)(void *, int, char **);
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *version;
|
const char *version;
|
||||||
@ -31,7 +30,6 @@ extern "C" {
|
|||||||
union {
|
union {
|
||||||
lammpsplugin_factory1 *v1;
|
lammpsplugin_factory1 *v1;
|
||||||
lammpsplugin_factory2 *v2;
|
lammpsplugin_factory2 *v2;
|
||||||
lammpsplugin_factory3 *v3;
|
|
||||||
} creator;
|
} creator;
|
||||||
void *handle;
|
void *handle;
|
||||||
} lammpsplugin_t;
|
} lammpsplugin_t;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Minimize::Minimize(LAMMPS *lmp) : Pointers(lmp) {}
|
Minimize::Minimize(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(minimize,Minimize)
|
|||||||
#ifndef LMP_MINIMIZE_H
|
#ifndef LMP_MINIMIZE_H
|
||||||
#define LMP_MINIMIZE_H
|
#define LMP_MINIMIZE_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Minimize : protected Pointers {
|
class Minimize : public Command {
|
||||||
public:
|
public:
|
||||||
Minimize(class LAMMPS *);
|
Minimize(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -11,10 +11,6 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h
|
|
||||||
// due to OpenMPI bug which sets INT64_MAX via its mpi.h
|
|
||||||
// before lmptype.h can set flags to insure it is done correctly
|
|
||||||
|
|
||||||
#include "read_data.h"
|
#include "read_data.h"
|
||||||
|
|
||||||
#include "angle.h"
|
#include "angle.h"
|
||||||
@ -66,7 +62,7 @@ const char *suffixes[] = {"/cuda","/gpu","/opt","/omp","/kk",
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
|
ReadData::ReadData(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
line = new char[MAXLINE];
|
line = new char[MAXLINE];
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(read_data,ReadData)
|
|||||||
#ifndef LMP_READ_DATA_H
|
#ifndef LMP_READ_DATA_H
|
||||||
#define LMP_READ_DATA_H
|
#define LMP_READ_DATA_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ReadData : protected Pointers {
|
class ReadData : public Command {
|
||||||
public:
|
public:
|
||||||
ReadData(class LAMMPS *);
|
ReadData(class LAMMPS *);
|
||||||
~ReadData();
|
~ReadData();
|
||||||
|
|||||||
@ -15,10 +15,6 @@
|
|||||||
Contributing author: Timothy Sirk (ARL)
|
Contributing author: Timothy Sirk (ARL)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h
|
|
||||||
// due to OpenMPI bug which sets INT64_MAX via its mpi.h
|
|
||||||
// before lmptype.h can set flags to insure it is done correctly
|
|
||||||
|
|
||||||
#include "read_dump.h"
|
#include "read_dump.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -46,7 +42,7 @@ enum{NOADD,YESADD,KEEPADD};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp)
|
ReadDump::ReadDump(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
MPI_Comm_size(world,&nprocs);
|
MPI_Comm_size(world,&nprocs);
|
||||||
|
|||||||
@ -22,11 +22,11 @@ CommandStyle(read_dump,ReadDump)
|
|||||||
#ifndef LMP_READ_DUMP_H
|
#ifndef LMP_READ_DUMP_H
|
||||||
#define LMP_READ_DUMP_H
|
#define LMP_READ_DUMP_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ReadDump : protected Pointers {
|
class ReadDump : public Command {
|
||||||
public:
|
public:
|
||||||
ReadDump(class LAMMPS *);
|
ReadDump(class LAMMPS *);
|
||||||
~ReadDump();
|
~ReadDump();
|
||||||
|
|||||||
@ -43,7 +43,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ReadRestart::ReadRestart(LAMMPS *lmp) : Pointers(lmp) {}
|
ReadRestart::ReadRestart(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(read_restart,ReadRestart)
|
|||||||
#ifndef LMP_READ_RESTART_H
|
#ifndef LMP_READ_RESTART_H
|
||||||
#define LMP_READ_RESTART_H
|
#define LMP_READ_RESTART_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ReadRestart : protected Pointers {
|
class ReadRestart : public Command {
|
||||||
public:
|
public:
|
||||||
ReadRestart(class LAMMPS *);
|
ReadRestart(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Replicate::Replicate(LAMMPS *lmp) : Pointers(lmp) {}
|
Replicate::Replicate(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(replicate,Replicate)
|
|||||||
#ifndef LMP_REPLICATE_H
|
#ifndef LMP_REPLICATE_H
|
||||||
#define LMP_REPLICATE_H
|
#define LMP_REPLICATE_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Replicate : protected Pointers {
|
class Replicate : public Command {
|
||||||
public:
|
public:
|
||||||
Replicate(class LAMMPS *);
|
Replicate(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Rerun::Rerun(LAMMPS *lmp) : Pointers(lmp) {}
|
Rerun::Rerun(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(rerun,Rerun)
|
|||||||
#ifndef LMP_RERUN_H
|
#ifndef LMP_RERUN_H
|
||||||
#define LMP_RERUN_H
|
#define LMP_RERUN_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Rerun : protected Pointers {
|
class Rerun : public Command {
|
||||||
public:
|
public:
|
||||||
Rerun(class LAMMPS *);
|
Rerun(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -43,7 +43,7 @@ static int compare_coords(const int, const int, void *);
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ResetIDs::ResetIDs(LAMMPS *lmp) : Pointers(lmp) {}
|
ResetIDs::ResetIDs(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(reset_atom_ids,ResetIDs)
|
|||||||
#ifndef LMP_RESET_IDS_H
|
#ifndef LMP_RESET_IDS_H
|
||||||
#define LMP_RESET_IDS_H
|
#define LMP_RESET_IDS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ResetIDs : protected Pointers {
|
class ResetIDs : public Command {
|
||||||
public:
|
public:
|
||||||
struct AtomRvous {
|
struct AtomRvous {
|
||||||
bigint ibin;
|
bigint ibin;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) {
|
ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Command(lmp) {
|
||||||
cfa = nullptr;
|
cfa = nullptr;
|
||||||
cca = nullptr;
|
cca = nullptr;
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(reset_mol_ids,ResetMolIDs)
|
|||||||
#ifndef LMP_RESET_MOL_IDS_H
|
#ifndef LMP_RESET_MOL_IDS_H
|
||||||
#define LMP_RESET_MOL_IDS_H
|
#define LMP_RESET_MOL_IDS_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class ResetMolIDs : protected Pointers {
|
class ResetMolIDs : public Command {
|
||||||
public:
|
public:
|
||||||
ResetMolIDs(class LAMMPS *);
|
ResetMolIDs(class LAMMPS *);
|
||||||
~ResetMolIDs();
|
~ResetMolIDs();
|
||||||
|
|||||||
@ -31,7 +31,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Run::Run(LAMMPS *lmp) : Pointers(lmp) {}
|
Run::Run(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(run,Run)
|
|||||||
#ifndef LMP_RUN_H
|
#ifndef LMP_RUN_H
|
||||||
#define LMP_RUN_H
|
#define LMP_RUN_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Run : protected Pointers {
|
class Run : public Command {
|
||||||
public:
|
public:
|
||||||
Run(class LAMMPS *);
|
Run(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -20,13 +20,13 @@ CommandStyle(set,Set)
|
|||||||
#ifndef LMP_SET_H
|
#ifndef LMP_SET_H
|
||||||
#define LMP_SET_H
|
#define LMP_SET_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Set : protected Pointers {
|
class Set : public Command {
|
||||||
public:
|
public:
|
||||||
Set(class LAMMPS *lmp) : Pointers(lmp) {};
|
Set(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -42,7 +42,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Velocity::Velocity(LAMMPS *lmp) : Pointers(lmp) {}
|
Velocity::Velocity(LAMMPS *lmp) : Command(lmp) {}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(velocity,Velocity)
|
|||||||
#ifndef LMP_VELOCITY_H
|
#ifndef LMP_VELOCITY_H
|
||||||
#define LMP_VELOCITY_H
|
#define LMP_VELOCITY_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Velocity : protected Pointers {
|
class Velocity : public Command {
|
||||||
public:
|
public:
|
||||||
Velocity(class LAMMPS *);
|
Velocity(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -20,13 +20,13 @@ CommandStyle(write_coeff,WriteCoeff)
|
|||||||
#ifndef LMP_WRITE_COEFF_H
|
#ifndef LMP_WRITE_COEFF_H
|
||||||
#define LMP_WRITE_COEFF_H
|
#define LMP_WRITE_COEFF_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class WriteCoeff : protected Pointers {
|
class WriteCoeff : public Command {
|
||||||
public:
|
public:
|
||||||
WriteCoeff(class LAMMPS *lmp) : Pointers(lmp) {};
|
WriteCoeff(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ enum{ELLIPSOID,LINE,TRIANGLE,BODY}; // also in AtomVecHybrid
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
WriteData::WriteData(LAMMPS *lmp) : Pointers(lmp)
|
WriteData::WriteData(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
MPI_Comm_size(world,&nprocs);
|
MPI_Comm_size(world,&nprocs);
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(write_data,WriteData)
|
|||||||
#ifndef LMP_WRITE_DATA_H
|
#ifndef LMP_WRITE_DATA_H
|
||||||
#define LMP_WRITE_DATA_H
|
#define LMP_WRITE_DATA_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class WriteData : protected Pointers {
|
class WriteData : public Command {
|
||||||
public:
|
public:
|
||||||
WriteData(class LAMMPS *);
|
WriteData(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
@ -20,13 +20,13 @@ CommandStyle(write_dump,WriteDump)
|
|||||||
#ifndef LMP_WRITE_DUMP_H
|
#ifndef LMP_WRITE_DUMP_H
|
||||||
#define LMP_WRITE_DUMP_H
|
#define LMP_WRITE_DUMP_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class WriteDump : protected Pointers {
|
class WriteDump : public Command {
|
||||||
public:
|
public:
|
||||||
WriteDump(class LAMMPS *lmp) : Pointers(lmp) {};
|
WriteDump(class LAMMPS *lmp) : Command(lmp) {};
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp)
|
WriteRestart::WriteRestart(LAMMPS *lmp) : Command(lmp)
|
||||||
{
|
{
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
MPI_Comm_size(world,&nprocs);
|
MPI_Comm_size(world,&nprocs);
|
||||||
|
|||||||
@ -20,11 +20,11 @@ CommandStyle(write_restart,WriteRestart)
|
|||||||
#ifndef LMP_WRITE_RESTART_H
|
#ifndef LMP_WRITE_RESTART_H
|
||||||
#define LMP_WRITE_RESTART_H
|
#define LMP_WRITE_RESTART_H
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "command.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class WriteRestart : protected Pointers {
|
class WriteRestart : public Command {
|
||||||
public:
|
public:
|
||||||
WriteRestart(class LAMMPS *);
|
WriteRestart(class LAMMPS *);
|
||||||
void command(int, char **);
|
void command(int, char **);
|
||||||
|
|||||||
Reference in New Issue
Block a user