ls1-MarDyn
ls1-MarDyn molecular dynamics code
|
The PluginBase class provides the interface for any kind of output/plugin classes - called "(output) plugins". More...
#include <PluginBase.h>
Public Member Functions | |
PluginBase () | |
Subclasses should use their constructur to pass parameters (e.g. filenames) | |
virtual void | init (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)=0 |
Method init will be called at the begin of the simulation. More... | |
virtual void | readXML (XMLfileUnits &xmlconfig)=0 |
Method readXML will be called once for each plugin section in the input file. More... | |
virtual void | beforeEventNewTimestep (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) |
Method will be called first thing in a new timestep. More... | |
virtual void | beforeForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) |
Method beforeForces will be called before forcefields have been applied no alterations w.r.t. Forces shall be made here. More... | |
virtual void | siteWiseForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) |
Method siteWiseForces will be called before forcefields have been applied alterations to sitewise forces and fullMolecule forces can be made here. More... | |
virtual void | afterForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) |
Method afterForces will be called after forcefields have been applied no sitewise Forces can be applied here. More... | |
virtual void | endStep (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep)=0 |
Method endStep will be called at the end of each time step. More... | |
virtual void | finish (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)=0 |
Method finish will be called at the end of the simulation. More... | |
virtual std::string | getPluginName ()=0 |
return the name of the plugin More... | |
virtual void | registerCallbacks (std::map< std::string, FunctionWrapper > &callbackMap) |
virtual void | accessAllCallbacks (const std::map< std::string, FunctionWrapper > &callbackMap) |
The PluginBase class provides the interface for any kind of output/plugin classes - called "(output) plugins".
There are a lot of different things that one might want to write out during a simulation, e.g. thermodynamic values, graphical information, time measurements, ... For all cases in which this output happens regularly at the end of each time step the PluginBase class provides a common interface. The interface provides access to the most important data: the particle container and the domain decomposition.
Of course, several plugins plugins will be needed in some cases. So the idea is, that all available plugins are registered in the PluginFactory and initialized in the Simulation at runtime as requested by the input file. The plugin will then be called at the respective points in the simulation automatically.
Therefore, each plugin has to implement at least the following five methods:
|
inlinevirtual |
Save callbacks from the callbackMap locally. This allows a plugin to call functions from other plugins. Example syntax:
callbackMap | Get callbacks from this map. |
Reimplemented in SpatialProfile.
|
inlinevirtual |
Method afterForces will be called after forcefields have been applied no sitewise Forces can be applied here.
Reimplemented in FlopRateWriter, RDF, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, CommunicationPartnerWriter, HaloParticleWriter, ODF, Dropaccelerator, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, and RegionSampling.
|
inlinevirtual |
Method will be called first thing in a new timestep.
Reimplemented in ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, MaxCheck, MirrorSystem, DistControl, and MettDeamon.
|
inlinevirtual |
Method beforeForces will be called before forcefields have been applied no alterations w.r.t. Forces shall be made here.
Reimplemented in ExamplePlugin, InMemoryCheckpointing, TestPlugin, COMaligner, DirectedPM, Dropaligner, FixRegion, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, and PosNegComp.
|
pure virtual |
Method endStep will be called at the end of each time step.
This method will be called every time step passing the simstep as an additional parameter. It can be used e.g. to write per time step data to a file or perform additional computations.
particleContainer | particle container storing the (local) molecules |
domainDecomp | domain decomposition in use |
domain |
Implemented in VectorizationTuner, CheckpointWriter, DecompWriter, EnergyLogWriter, FlopRateWriter, GammaWriter, MaxWriter, MmpldWriter, MmspdBinWriter, MmspdWriter, MPI_IOCheckpointWriter, MPICheckpointWriter, PovWriter, ResultWriter, SysMonOutput, VISWriter, VTKGridWriter, VTKMoleculeWriter, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, CommunicationPartnerWriter, HaloParticleWriter, KDTreePrinter, LoadbalanceWriter, ODF, TimerWriter, XyzWriter, COMaligner, DirectedPM, Dropaccelerator, Dropaligner, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, RegionSampling, Permittivity, SpatialProfile, WallPotential, and RDF.
|
pure virtual |
Method finish will be called at the end of the simulation.
This method will be called once at the end of the simulation. It can be used e.g. to closing output files or writing final statistics.
particleContainer | particle container storing the (local) molecules |
domainDecomp | domain decomposition in use |
domain |
Implemented in VectorizationTuner, CavityWriter, CheckpointWriter, DecompWriter, EnergyLogWriter, FlopRateWriter, GammaWriter, MaxWriter, MmpldWriter, MmspdBinWriter, MmspdWriter, MPI_IOCheckpointWriter, MPICheckpointWriter, PovWriter, RDF, ResultWriter, SysMonOutput, VISWriter, VTKGridWriter, VTKMoleculeWriter, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CommunicationPartnerWriter, HaloParticleWriter, KDTreePrinter, LoadbalanceWriter, ODF, TimerWriter, XyzWriter, COMaligner, DirectedPM, Dropaccelerator, Dropaligner, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, RegionSampling, Permittivity, SpatialProfile, and WallPotential.
|
pure virtual |
return the name of the plugin
Implemented in CheckpointWriter, DecompWriter, EnergyLogWriter, FlopRateWriter, GammaWriter, MaxWriter, MmpldWriter, MmspdBinWriter, MmspdWriter, MPI_IOCheckpointWriter, MPICheckpointWriter, PovWriter, RDF, ResultWriter, SysMonOutput, VISWriter, VTKGridWriter, VTKMoleculeWriter, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, CommunicationPartnerWriter, HaloParticleWriter, KDTreePrinter, LoadbalanceWriter, ODF, TimerWriter, XyzWriter, COMaligner, DirectedPM, Dropaccelerator, Dropaligner, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, RegionSampling, Permittivity, SpatialProfile, VectorizationTuner, and WallPotential.
|
pure virtual |
Method init will be called at the begin of the simulation.
This method will be called once at the begin of the simulation just right before the main time step loop. It can be used e.g. to open output files or initialize statistics.
particleContainer | particle container storing the (local) molecules |
domainDecomp | domain decomposition in use |
domain |
Implemented in CheckpointWriter, DecompWriter, EnergyLogWriter, FlopRateWriter, GammaWriter, MaxWriter, MmpldWriter, MmspdBinWriter, MmspdWriter, MPI_IOCheckpointWriter, MPICheckpointWriter, PovWriter, RDF, ResultWriter, SysMonOutput, VISWriter, VTKGridWriter, VTKMoleculeWriter, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, CommunicationPartnerWriter, HaloParticleWriter, KDTreePrinter, LoadbalanceWriter, ODF, TimerWriter, XyzWriter, COMaligner, DirectedPM, Dropaccelerator, Dropaligner, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, RegionSampling, Permittivity, SpatialProfile, VectorizationTuner, and WallPotential.
|
pure virtual |
Method readXML will be called once for each plugin section in the input file.
This method can be used to read in parameters from the corresponding plugin section in the xml config file. The method will be called once after an instance of the plugin is created.
The following xml object structure will be provided to the plugin:
xmlconfig | section of the xml file |
Implemented in FlopRateWriter, CheckpointWriter, DecompWriter, EnergyLogWriter, GammaWriter, MaxWriter, MmpldWriter, MmspdBinWriter, MmspdWriter, MPI_IOCheckpointWriter, MPICheckpointWriter, PovWriter, RDF, ResultWriter, SysMonOutput, VISWriter, VTKGridWriter, VTKMoleculeWriter, ExamplePlugin, InMemoryCheckpointing, TestPlugin, CavityWriter, CommunicationPartnerWriter, HaloParticleWriter, KDTreePrinter, LoadbalanceWriter, ODF, TimerWriter, XyzWriter, COMaligner, DirectedPM, Dropaccelerator, Dropaligner, FixRegion, LoadImbalanceThroughSleepPlugin, MaxCheck, Mirror, MirrorSystem, DistControl, DriftCtrl, ExtractPhase, MettDeamon, MettDeamonFeedrateDirector, PosNegComp, RegionSampling, Permittivity, SpatialProfile, VectorizationTuner, and WallPotential.
|
inlinevirtual |
Register callbacks to callbackMap. This allows to make functions of a plugin accessible to other plugins. New callbacks should be added to callbackMap. Example syntax:
callbackMap | Add callbacks to this map. |
Reimplemented in FixRegion.
|
inlinevirtual |
Method siteWiseForces will be called before forcefields have been applied alterations to sitewise forces and fullMolecule forces can be made here.
Reimplemented in MaxCheck, DistControl, MettDeamon, and WallPotential.