From 75579fc1003b815bdecd8e62f2e0d0de0daa13c8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 14 Apr 2021 07:05:00 -0400 Subject: [PATCH] take advantage of having the common Command base class to unify code paths --- doc/src/Developer_plugins.rst | 61 +++++++++++++----------------- examples/plugins/helloplugin.cpp | 11 +++--- src/KIM/kim_command.h | 2 +- src/MESSAGE/message.h | 2 +- src/MESSAGE/server.h | 2 +- src/PLUGIN/plugin.cpp | 2 +- src/PLUGIN/plugin.h | 2 +- src/REPLICA/hyper.h | 2 +- src/REPLICA/neb.h | 2 +- src/REPLICA/prd.h | 2 +- src/REPLICA/tad.h | 2 +- src/REPLICA/temper.h | 2 +- src/SPIN/neb_spin.h | 2 +- src/USER-COLVARS/group_ndx.h | 2 +- src/USER-COLVARS/ndx_group.h | 2 +- src/USER-MISC/temper_grem.h | 2 +- src/USER-MISC/temper_npt.h | 2 +- src/USER-PHONON/dynamical_matrix.h | 2 +- src/USER-PHONON/third_order.h | 2 +- src/balance.h | 2 +- src/change_box.h | 2 +- src/create_atoms.h | 2 +- src/create_bonds.h | 2 +- src/create_box.h | 2 +- src/delete_atoms.h | 2 +- src/delete_bonds.h | 2 +- src/deprecated.h | 2 +- src/displace_atoms.h | 2 +- src/info.h | 2 +- src/input.cpp | 11 +++--- src/input.h | 5 ++- src/lammpsplugin.h | 2 - src/minimize.h | 2 +- src/read_data.h | 2 +- src/read_dump.h | 2 +- src/read_restart.h | 2 +- src/replicate.h | 2 +- src/rerun.h | 2 +- src/reset_atom_ids.h | 2 +- src/reset_mol_ids.h | 2 +- src/run.h | 2 +- src/set.h | 2 +- src/velocity.h | 2 +- src/write_coeff.h | 2 +- src/write_data.h | 2 +- src/write_dump.h | 2 +- src/write_restart.h | 2 +- 47 files changed, 83 insertions(+), 91 deletions(-) diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 68f1f1387c..1beedcf213 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -59,31 +59,25 @@ Members of ``lammpsplugin_t`` * - author - String with the name and email of the author * - 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 - Pointer to factory function for compute, fix, or region styles - * - creator.v3 - - Pointer to factory function for command styles * - handle - Pointer to the open DSO file handle 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" -element is for factory functions of supported styles computing forces (i.e. -pair, bond, angle, dihedral, or improper styles) and the function takes -as single argument the pointer to the LAMMPS instance. The factory function -is cast to the ``lammpsplugin_factory1`` type before assignment. The -"creator.v2" element is for factory functions creating an instance of -a fix, compute, or region style and takes three arguments: a pointer to -the LAMMPS instance, an integer with the length of the argument list and -a ``char **`` pointer to the list of arguments. The factory function pointer -needs to be cast to the ``lammpsplugin_factory2`` type before assignment. -The "creator.v3" element takes the same arguments as "creator.v3" but is -specific to creating command styles: the factory function has to instantiate -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. +and which of those is determined by the style of plugin. The +"creator.v1" element is for factory functions of supported styles +computing forces (i.e. command, pair, bond, angle, dihedral, or +improper styles) and the function takes as single argument the pointer +to the LAMMPS instance. The factory function is cast to the +``lammpsplugin_factory1`` type before assignment. The "creator.v2" +element is for factory functions creating an instance of a fix, compute, +or region style and takes three arguments: a pointer to the LAMMPS +instance, an integer with the length of the argument list and a ``char +**`` pointer to the list of arguments. The factory function pointer +needs to be cast to the ``lammpsplugin_factory2`` type before +assignment. Pair style example ^^^^^^^^^^^^^^^^^^ @@ -123,12 +117,12 @@ function would look like this: The factory function in this example is called ``morse2creator()``. It 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 -``lammpsplugin_factory1`` pointer type. It returns a +be assigned to the *creator.v1* member of the plugin struct and cast to +the ``lammpsplugin_factory1`` function pointer type. It returns a pointer to the allocated class instance derived from the ``Pair`` class. -This function may be declared static to avoid clashes with other plugins. -The name of the derived class, ``PairMorse2``, must be unique inside -the entire LAMMPS executable. +This function may be declared static to avoid clashes with other +plugins. The name of the derived class, ``PairMorse2``, however must be +unique inside the entire LAMMPS executable. Fix style example ^^^^^^^^^^^^^^^^^ @@ -169,9 +163,9 @@ Below is an example for that: 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 -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: .. code-block:: C++ @@ -180,15 +174,15 @@ file as the plugin interface code: #include "comm.h" #include "error.h" - #include "pointers.h" + #include "command.h" #include "version.h" #include namespace LAMMPS_NS { - class Hello : protected Pointers { + class Hello : public Command { public: - Hello(class LAMMPS *lmp) : Pointers(lmp) {}; + Hello(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); }; } @@ -202,10 +196,9 @@ file as the plugin interface code: 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); - hello.command(argc,argv); + return new Hello(lmp); } 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.style = "command"; 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.creator.v3 = (lammpsplugin_factory3 *) &hellocreator; + plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator; plugin.handle = handle; (*register_plugin)(&plugin,lmp); } diff --git a/examples/plugins/helloplugin.cpp b/examples/plugins/helloplugin.cpp index f453add374..f4a49c1a5a 100644 --- a/examples/plugins/helloplugin.cpp +++ b/examples/plugins/helloplugin.cpp @@ -9,7 +9,7 @@ #include namespace LAMMPS_NS { - class Hello : protected Command { + class Hello : public Command { public: Hello(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); @@ -25,10 +25,9 @@ void Hello::command(int argc, char **argv) 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); - hello.command(argc,argv); + return new Hello(lmp); } 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.style = "command"; 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.creator.v3 = (lammpsplugin_factory3 *) &hellocreator; + plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator; plugin.handle = handle; (*register_plugin)(&plugin,lmp); } diff --git a/src/KIM/kim_command.h b/src/KIM/kim_command.h index 64abeed9e0..b27b0e0873 100644 --- a/src/KIM/kim_command.h +++ b/src/KIM/kim_command.h @@ -66,7 +66,7 @@ CommandStyle(kim,KimCommand) namespace LAMMPS_NS { -class KimCommand : protected Command { +class KimCommand : public Command { public: KimCommand(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/MESSAGE/message.h b/src/MESSAGE/message.h index c499ff6537..88c658e44b 100644 --- a/src/MESSAGE/message.h +++ b/src/MESSAGE/message.h @@ -24,7 +24,7 @@ CommandStyle(message,Message) namespace LAMMPS_NS { -class Message : protected Command { +class Message : public Command { public: Message(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/MESSAGE/server.h b/src/MESSAGE/server.h index 63191ccf33..7c93db8c64 100644 --- a/src/MESSAGE/server.h +++ b/src/MESSAGE/server.h @@ -24,7 +24,7 @@ CommandStyle(server,Server) namespace LAMMPS_NS { -class Server : protected Command { +class Server : public Command { public: Server(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/PLUGIN/plugin.cpp b/src/PLUGIN/plugin.cpp index a2f74060f1..d311b64520 100644 --- a/src/PLUGIN/plugin.cpp +++ b/src/PLUGIN/plugin.cpp @@ -257,7 +257,7 @@ namespace LAMMPS_NS "style {} from plugin", plugin->name)); } - (*command_map)[plugin->name] = (Input::CommandCreator)plugin->creator.v3; + (*command_map)[plugin->name] = (Input::CommandCreator)plugin->creator.v1; } else { utils::logmesg(lmp,fmt::format("Loading plugin for {} styles not " diff --git a/src/PLUGIN/plugin.h b/src/PLUGIN/plugin.h index 61355f4113..4b4bca9878 100644 --- a/src/PLUGIN/plugin.h +++ b/src/PLUGIN/plugin.h @@ -26,7 +26,7 @@ CommandStyle(plugin,Plugin) namespace LAMMPS_NS { - class Plugin : protected Command { + class Plugin : public Command { public: Plugin(class LAMMPS *); void command(int, char **); diff --git a/src/REPLICA/hyper.h b/src/REPLICA/hyper.h index faad58994b..a96ccf3727 100644 --- a/src/REPLICA/hyper.h +++ b/src/REPLICA/hyper.h @@ -24,7 +24,7 @@ CommandStyle(hyper,Hyper) namespace LAMMPS_NS { -class Hyper : protected Command { +class Hyper : public Command { public: Hyper(class LAMMPS *); ~Hyper() {} diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h index d8a9d5d3e4..8298766ccf 100644 --- a/src/REPLICA/neb.h +++ b/src/REPLICA/neb.h @@ -24,7 +24,7 @@ CommandStyle(neb,NEB) namespace LAMMPS_NS { -class NEB : protected Command { +class NEB : public Command { public: NEB(class LAMMPS *); NEB(class LAMMPS *, double, double, int, int, int, double *, double *); diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h index b331f7dc02..0d8fde1bfe 100644 --- a/src/REPLICA/prd.h +++ b/src/REPLICA/prd.h @@ -24,7 +24,7 @@ CommandStyle(prd,PRD) namespace LAMMPS_NS { -class PRD : protected Command { +class PRD : public Command { public: PRD(class LAMMPS *); ~PRD() {} diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h index 3a525146a6..91e570c707 100644 --- a/src/REPLICA/tad.h +++ b/src/REPLICA/tad.h @@ -24,7 +24,7 @@ CommandStyle(tad,TAD) namespace LAMMPS_NS { -class TAD : protected Command { +class TAD : public Command { public: TAD(class LAMMPS *); ~TAD(); diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h index ce7944da95..3f7d813f2a 100644 --- a/src/REPLICA/temper.h +++ b/src/REPLICA/temper.h @@ -24,7 +24,7 @@ CommandStyle(temper,Temper) namespace LAMMPS_NS { -class Temper : protected Command { +class Temper : public Command { public: Temper(class LAMMPS *); ~Temper(); diff --git a/src/SPIN/neb_spin.h b/src/SPIN/neb_spin.h index 3dbae09297..54d85093a5 100644 --- a/src/SPIN/neb_spin.h +++ b/src/SPIN/neb_spin.h @@ -24,7 +24,7 @@ CommandStyle(neb/spin,NEBSpin) namespace LAMMPS_NS { -class NEBSpin : protected Command { +class NEBSpin : public Command { public: NEBSpin(class LAMMPS *); ~NEBSpin(); diff --git a/src/USER-COLVARS/group_ndx.h b/src/USER-COLVARS/group_ndx.h index 46ba86c860..58b210937a 100644 --- a/src/USER-COLVARS/group_ndx.h +++ b/src/USER-COLVARS/group_ndx.h @@ -26,7 +26,7 @@ CommandStyle(group2ndx,Group2Ndx) namespace LAMMPS_NS { -class Group2Ndx : protected Command { +class Group2Ndx : public Command { public: Group2Ndx(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/USER-COLVARS/ndx_group.h b/src/USER-COLVARS/ndx_group.h index 1c881a65bf..e0fc6cf527 100644 --- a/src/USER-COLVARS/ndx_group.h +++ b/src/USER-COLVARS/ndx_group.h @@ -27,7 +27,7 @@ CommandStyle(ndx2group,Ndx2Group) namespace LAMMPS_NS { -class Ndx2Group : protected Command { +class Ndx2Group : public Command { public: Ndx2Group(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/USER-MISC/temper_grem.h b/src/USER-MISC/temper_grem.h index b720aeb45c..3c1891f22d 100644 --- a/src/USER-MISC/temper_grem.h +++ b/src/USER-MISC/temper_grem.h @@ -24,7 +24,7 @@ CommandStyle(temper/grem,TemperGrem) namespace LAMMPS_NS { -class TemperGrem : protected Command { +class TemperGrem : public Command { public: TemperGrem(class LAMMPS *); ~TemperGrem(); diff --git a/src/USER-MISC/temper_npt.h b/src/USER-MISC/temper_npt.h index 5c285f083c..a0eb1c1e9b 100644 --- a/src/USER-MISC/temper_npt.h +++ b/src/USER-MISC/temper_npt.h @@ -25,7 +25,7 @@ CommandStyle(temper/npt,TemperNPT) namespace LAMMPS_NS { -class TemperNPT : protected Command { +class TemperNPT : public Command { public: TemperNPT(class LAMMPS *); ~TemperNPT(); diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index 30baeda27f..d8c3ad411b 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -15,7 +15,7 @@ CommandStyle(dynamical_matrix,DynamicalMatrix) namespace LAMMPS_NS { -class DynamicalMatrix : protected Command { +class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); virtual ~DynamicalMatrix(); diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index 87b0c695f6..56a0266937 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -16,7 +16,7 @@ CommandStyle(third_order,ThirdOrder) namespace LAMMPS_NS { - class ThirdOrder : protected Command { + class ThirdOrder : public Command { public: ThirdOrder(class LAMMPS *); virtual ~ThirdOrder(); diff --git a/src/balance.h b/src/balance.h index 25ccac85ae..0642fe04f6 100644 --- a/src/balance.h +++ b/src/balance.h @@ -24,7 +24,7 @@ CommandStyle(balance,Balance) namespace LAMMPS_NS { -class Balance : protected Command { +class Balance : public Command { public: class RCB *rcb; class FixStore *fixstore; // per-atom weights stored in FixStore diff --git a/src/change_box.h b/src/change_box.h index 2f6802194b..f48edb2d9f 100644 --- a/src/change_box.h +++ b/src/change_box.h @@ -24,7 +24,7 @@ CommandStyle(change_box,ChangeBox) namespace LAMMPS_NS { -class ChangeBox : protected Command { +class ChangeBox : public Command { public: ChangeBox(class LAMMPS *); void command(int, char **); diff --git a/src/create_atoms.h b/src/create_atoms.h index 8f0e016192..deb155b96a 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -24,7 +24,7 @@ CommandStyle(create_atoms,CreateAtoms) namespace LAMMPS_NS { -class CreateAtoms : protected Command { +class CreateAtoms : public Command { public: CreateAtoms(class LAMMPS *); void command(int, char **); diff --git a/src/create_bonds.h b/src/create_bonds.h index f25cb6d1bc..d2d50c86c6 100644 --- a/src/create_bonds.h +++ b/src/create_bonds.h @@ -24,7 +24,7 @@ CommandStyle(create_bonds,CreateBonds) namespace LAMMPS_NS { -class CreateBonds : protected Command { +class CreateBonds : public Command { public: CreateBonds(class LAMMPS *); void command(int, char **); diff --git a/src/create_box.h b/src/create_box.h index 846af6bcee..26a2be6fe1 100644 --- a/src/create_box.h +++ b/src/create_box.h @@ -24,7 +24,7 @@ CommandStyle(create_box,CreateBox) namespace LAMMPS_NS { -class CreateBox : protected Command { +class CreateBox : public Command { public: CreateBox(class LAMMPS *); void command(int, char **); diff --git a/src/delete_atoms.h b/src/delete_atoms.h index e43bebfa54..5ff1d12f65 100644 --- a/src/delete_atoms.h +++ b/src/delete_atoms.h @@ -25,7 +25,7 @@ CommandStyle(delete_atoms,DeleteAtoms) namespace LAMMPS_NS { -class DeleteAtoms : protected Command { +class DeleteAtoms : public Command { public: DeleteAtoms(class LAMMPS *); void command(int, char **); diff --git a/src/delete_bonds.h b/src/delete_bonds.h index 2f255e12d6..5c56a67f68 100644 --- a/src/delete_bonds.h +++ b/src/delete_bonds.h @@ -24,7 +24,7 @@ CommandStyle(delete_bonds,DeleteBonds) namespace LAMMPS_NS { -class DeleteBonds : protected Command { +class DeleteBonds : public Command { public: DeleteBonds(class LAMMPS *); void command(int, char **); diff --git a/src/deprecated.h b/src/deprecated.h index 4b6cba7f30..d5997d7199 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -30,7 +30,7 @@ CommandStyle(kim_query,Deprecated) namespace LAMMPS_NS { -class Deprecated : protected Command { +class Deprecated : public Command { public: Deprecated(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/displace_atoms.h b/src/displace_atoms.h index 98247b7244..c2c2e8306f 100644 --- a/src/displace_atoms.h +++ b/src/displace_atoms.h @@ -24,7 +24,7 @@ CommandStyle(displace_atoms,DisplaceAtoms) namespace LAMMPS_NS { -class DisplaceAtoms : protected Command { +class DisplaceAtoms : public Command { public: DisplaceAtoms(class LAMMPS *); ~DisplaceAtoms(); diff --git a/src/info.h b/src/info.h index 536a93c559..386d38c39f 100644 --- a/src/info.h +++ b/src/info.h @@ -26,7 +26,7 @@ CommandStyle(info,Info) namespace LAMMPS_NS { -class Info : protected Command { +class Info : public Command { public: Info(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/input.cpp b/src/input.cpp index 9079cdd76c..16cef08c36 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -21,6 +21,7 @@ #include "comm.h" #include "comm_brick.h" #include "comm_tiled.h" +#include "command.h" #include "compute.h" #include "dihedral.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. 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. \endverbatim @@ -789,7 +790,8 @@ int Input::execute_command() if (command_map->find(command) != command_map->end()) { CommandCreator &command_creator = (*command_map)[command]; - command_creator(lmp,narg,arg); + Command *cmd = command_creator(lmp); + cmd->command(narg,arg); return 0; } @@ -803,10 +805,9 @@ int Input::execute_command() ------------------------------------------------------------------------- */ template -void Input::command_creator(LAMMPS *lmp, int narg, char **arg) +Command *Input::command_creator(LAMMPS *lmp) { - T cmd(lmp); - cmd.command(narg,arg); + return new T(lmp); } /* ---------------------------------------------------------------------- */ diff --git a/src/input.h b/src/input.h index 809a7a5f94..59be026640 100644 --- a/src/input.h +++ b/src/input.h @@ -19,6 +19,7 @@ #include namespace LAMMPS_NS { + class Command; class Input : protected Pointers { friend class Info; @@ -59,12 +60,12 @@ class Input : protected Pointers { FILE **infiles; // list of open input files public: - typedef void (*CommandCreator)(LAMMPS *, int, char **); + typedef Command * (*CommandCreator)(LAMMPS *); typedef std::map CommandCreatorMap; CommandCreatorMap *command_map; protected: - template static void command_creator(LAMMPS *, int, char **); + template static Command *command_creator(LAMMPS *); private: void parse(); // parse an input text line diff --git a/src/lammpsplugin.h b/src/lammpsplugin.h index 1baed9799d..e544e8bffe 100644 --- a/src/lammpsplugin.h +++ b/src/lammpsplugin.h @@ -20,7 +20,6 @@ extern "C" { typedef void *(lammpsplugin_factory1)(void *); typedef void *(lammpsplugin_factory2)(void *, int, char **); - typedef void (lammpsplugin_factory3)(void *, int, char **); typedef struct { const char *version; @@ -31,7 +30,6 @@ extern "C" { union { lammpsplugin_factory1 *v1; lammpsplugin_factory2 *v2; - lammpsplugin_factory3 *v3; } creator; void *handle; } lammpsplugin_t; diff --git a/src/minimize.h b/src/minimize.h index 10b244130a..32d08c5f52 100644 --- a/src/minimize.h +++ b/src/minimize.h @@ -24,7 +24,7 @@ CommandStyle(minimize,Minimize) namespace LAMMPS_NS { -class Minimize : protected Command { +class Minimize : public Command { public: Minimize(class LAMMPS *); void command(int, char **); diff --git a/src/read_data.h b/src/read_data.h index d251259a08..7ccbeebd58 100644 --- a/src/read_data.h +++ b/src/read_data.h @@ -24,7 +24,7 @@ CommandStyle(read_data,ReadData) namespace LAMMPS_NS { -class ReadData : protected Command { +class ReadData : public Command { public: ReadData(class LAMMPS *); ~ReadData(); diff --git a/src/read_dump.h b/src/read_dump.h index ba59cc9224..842b629fa4 100644 --- a/src/read_dump.h +++ b/src/read_dump.h @@ -26,7 +26,7 @@ CommandStyle(read_dump,ReadDump) namespace LAMMPS_NS { -class ReadDump : protected Command { +class ReadDump : public Command { public: ReadDump(class LAMMPS *); ~ReadDump(); diff --git a/src/read_restart.h b/src/read_restart.h index 3a2c7965b3..fc2a27fa67 100644 --- a/src/read_restart.h +++ b/src/read_restart.h @@ -24,7 +24,7 @@ CommandStyle(read_restart,ReadRestart) namespace LAMMPS_NS { -class ReadRestart : protected Command { +class ReadRestart : public Command { public: ReadRestart(class LAMMPS *); void command(int, char **); diff --git a/src/replicate.h b/src/replicate.h index fd865a9c71..b4be578b23 100644 --- a/src/replicate.h +++ b/src/replicate.h @@ -24,7 +24,7 @@ CommandStyle(replicate,Replicate) namespace LAMMPS_NS { -class Replicate : protected Command { +class Replicate : public Command { public: Replicate(class LAMMPS *); void command(int, char **); diff --git a/src/rerun.h b/src/rerun.h index 57aa32227f..c10ca8780e 100644 --- a/src/rerun.h +++ b/src/rerun.h @@ -24,7 +24,7 @@ CommandStyle(rerun,Rerun) namespace LAMMPS_NS { -class Rerun : protected Command { +class Rerun : public Command { public: Rerun(class LAMMPS *); void command(int, char **); diff --git a/src/reset_atom_ids.h b/src/reset_atom_ids.h index a017abbbc8..6c262f2bd8 100644 --- a/src/reset_atom_ids.h +++ b/src/reset_atom_ids.h @@ -24,7 +24,7 @@ CommandStyle(reset_atom_ids,ResetIDs) namespace LAMMPS_NS { -class ResetIDs : protected Command { +class ResetIDs : public Command { public: struct AtomRvous { bigint ibin; diff --git a/src/reset_mol_ids.h b/src/reset_mol_ids.h index c25f64fe43..5759cf8b4e 100644 --- a/src/reset_mol_ids.h +++ b/src/reset_mol_ids.h @@ -24,7 +24,7 @@ CommandStyle(reset_mol_ids,ResetMolIDs) namespace LAMMPS_NS { -class ResetMolIDs : protected Command { +class ResetMolIDs : public Command { public: ResetMolIDs(class LAMMPS *); ~ResetMolIDs(); diff --git a/src/run.h b/src/run.h index a9a4a556f0..747af6a61c 100644 --- a/src/run.h +++ b/src/run.h @@ -24,7 +24,7 @@ CommandStyle(run,Run) namespace LAMMPS_NS { -class Run : protected Command { +class Run : public Command { public: Run(class LAMMPS *); void command(int, char **); diff --git a/src/set.h b/src/set.h index 02e81b057a..330bd484a3 100644 --- a/src/set.h +++ b/src/set.h @@ -24,7 +24,7 @@ CommandStyle(set,Set) namespace LAMMPS_NS { -class Set : protected Command { +class Set : public Command { public: Set(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/velocity.h b/src/velocity.h index 5c54302a1e..d7405f87fd 100644 --- a/src/velocity.h +++ b/src/velocity.h @@ -24,7 +24,7 @@ CommandStyle(velocity,Velocity) namespace LAMMPS_NS { -class Velocity : protected Command { +class Velocity : public Command { public: Velocity(class LAMMPS *); void command(int, char **); diff --git a/src/write_coeff.h b/src/write_coeff.h index 2555454db0..8815162c48 100644 --- a/src/write_coeff.h +++ b/src/write_coeff.h @@ -24,7 +24,7 @@ CommandStyle(write_coeff,WriteCoeff) namespace LAMMPS_NS { -class WriteCoeff : protected Command { +class WriteCoeff : public Command { public: WriteCoeff(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/write_data.h b/src/write_data.h index c9ba5a4a52..cecfaa4800 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -24,7 +24,7 @@ CommandStyle(write_data,WriteData) namespace LAMMPS_NS { -class WriteData : protected Command { +class WriteData : public Command { public: WriteData(class LAMMPS *); void command(int, char **); diff --git a/src/write_dump.h b/src/write_dump.h index 5d1499934a..763fd12f60 100644 --- a/src/write_dump.h +++ b/src/write_dump.h @@ -24,7 +24,7 @@ CommandStyle(write_dump,WriteDump) namespace LAMMPS_NS { -class WriteDump : protected Command { +class WriteDump : public Command { public: WriteDump(class LAMMPS *lmp) : Command(lmp) {}; void command(int, char **); diff --git a/src/write_restart.h b/src/write_restart.h index 0b8826f10b..05f5c45ec6 100644 --- a/src/write_restart.h +++ b/src/write_restart.h @@ -24,7 +24,7 @@ CommandStyle(write_restart,WriteRestart) namespace LAMMPS_NS { -class WriteRestart : protected Command { +class WriteRestart : public Command { public: WriteRestart(class LAMMPS *); void command(int, char **);