Mirheo Objects¶
All Mirheo objects must derive from this base class:
-
class
MirObject
¶ Base class for all the objects of Mirheo.
Subclassed by mirheo::MirSimulationObject, mirheo::Postprocess, mirheo::PostprocessPlugin, mirheo::Simulation
Public Functions
-
MirObject
(const std::string &name)¶ Construct a MirObject object.
- Parameters
name
: Name of the object.
-
const std::string &
getName
() const¶ Return the name of the object.
-
const char *
getCName
() const¶ Return the name of the object in c style. Useful for printf.
-
virtual void
checkpoint
(MPI_Comm comm, const std::string &path, int checkPointId)¶ Save the state of the object on disk.
- Parameters
comm
: MPI communicator to perform the I/O.path
: The directory path to store the object state.checkPointId
: The id of the dump.
-
virtual void
restart
(MPI_Comm comm, const std::string &path)¶ Load the state of the object from the disk.
- Parameters
comm
: MPI communicator to perform the I/O.path
: The directory path to store the object state.
-
std::string
createCheckpointName
(const std::string &path, const std::string &identifier, const std::string &extension) const¶ Helper function to create file name for checkpoint/restart.
- Return
- The file name.
- Parameters
path
: The checkpoint/restart directory.identifier
: An additional identifier, ignored if empty.extension
: File extension.
-
std::string
createCheckpointNameWithId
(const std::string &path, const std::string &identifier, const std::string &extension, int checkpointId) const¶ Helper function to create file name for checkpoint/restart with a given Id.
- Return
- The file name.
- Parameters
path
: The checkpoint/restart directory.identifier
: An additional identifier, ignored if empty.extension
: File extension.checkpointId
: Dump Id.
-
void
createCheckpointSymlink
(MPI_Comm comm, const std::string &path, const std::string &identifier, const std::string &extension, int checkpointId) const¶ Create a symlink with a name with no id to the file with a given id.
- Parameters
comm
: MPI communicator to perform the I/O.path
: The checkpoint/restart directory.identifier
: An additional identifier, ignored if empty.extension
: File extension.checkpointId
: Dump Id.
-
-
class
MirSimulationObject
: public mirheo::MirObject¶ Base class for the objects of Mirheo simulation task.
Contains global information common to all objects.
Subclassed by mirheo::Bouncer, mirheo::Field, mirheo::Integrator, mirheo::Interaction, mirheo::ObjectBelongingChecker, mirheo::ParticleVector, mirheo::SimulationPlugin, mirheo::Wall
Public Functions
-
MirSimulationObject
(const MirState *state, const std::string &name)¶ Construct a MirSimulationObject object.
- Parameters
name
: Name of the object.state
: State of the simulation.
-