Gromacs
2024.4
|
#include <gromacs/modularsimulator/statepropagatordata.h>
Element for StatePropagatorData.
The StatePropagatorData::Element
takes part in the simulator run, as it might have to save a valid state at the right moment during the integration. Placing the StatePropagatorData::Element correctly is the duty of the simulator builder - this might be automatized later if we have enough meta-data of the variables (i.e., if StatePropagatorData
knows at which time the variables currently are, and can decide when a valid state (full-time step of all variables) is reached. The StatePropagatorData::Element
is also a client of both the trajectory signaller and writer - it will save a state for later writeout during the simulator step if it knows that trajectory writing will occur later in the step, and it knows how to write to file given a file pointer by the TrajectoryElement
. It is also responsible to store the state for checkpointing.
Public Member Functions | |
Element (StatePropagatorData *statePropagatorData, FILE *fplog, const t_commrec *cr, int nstxout, int nstvout, int nstfout, int nstxout_compressed, bool canMoleculesBeDistributedOverPBC, bool writeFinalConfiguration, std::string finalConfigurationFilename, const t_inputrec *inputrec, const gmx_mtop_t &globalTop) | |
Constructor. | |
void | scheduleTask (Step step, Time time, const RegisterRunFunction ®isterRunFunction) override |
Register run function for step / time. More... | |
void | elementSetup () override |
Backup starting velocities. More... | |
void | elementTeardown () override |
No element teardown needed. | |
void | setFreeEnergyPerturbationData (FreeEnergyPerturbationData *freeEnergyPerturbationData) |
Set free energy data. | |
void | saveCheckpointState (std::optional< WriteCheckpointData > checkpointData, const t_commrec *cr) override |
ICheckpointHelperClient write checkpoint implementation. | |
void | restoreCheckpointState (std::optional< ReadCheckpointData > checkpointData, const t_commrec *cr) override |
ICheckpointHelperClient read checkpoint implementation. | |
const std::string & | clientID () override |
ICheckpointHelperClient key implementation. | |
Public Member Functions inherited from gmx::ISimulatorElement | |
virtual | ~ISimulatorElement ()=default |
Standard virtual destructor. | |
Public Member Functions inherited from gmx::ITrajectoryWriterClient | |
virtual | ~ITrajectoryWriterClient ()=default |
Standard virtual destructor. | |
Public Member Functions inherited from gmx::ITrajectorySignallerClient | |
virtual | ~ITrajectorySignallerClient ()=default |
Standard virtual destructor. | |
Public Member Functions inherited from gmx::ICheckpointHelperClient | |
virtual | ~ICheckpointHelperClient ()=default |
Standard virtual destructor. | |
Public Member Functions inherited from gmx::ILastStepSignallerClient | |
virtual | ~ILastStepSignallerClient ()=default |
Standard virtual destructor. | |
Static Public Member Functions | |
static ISimulatorElement * | getElementPointerImpl (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper, ObservablesReducer *observablesReducer) |
Factory method implementation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from gmx::ITrajectoryWriterClient | |
virtual void | trajectoryWriterSetup (gmx_mdoutf *outf)=0 |
Setup method with valid output pointer. | |
|
overridevirtual |
Backup starting velocities.
This is only needed for vv, where the first (velocity) half step is only used to compute the constraint virial, but the velocities need to be reset after. TODO: There must be a more elegant solution to this!
Implements gmx::ISimulatorElement.
|
static |
Factory method implementation.
legacySimulatorData | Pointer allowing access to simulator level data |
builderHelper | ModularSimulatorAlgorithmBuilder helper object |
statePropagatorData | Pointer to the StatePropagatorData object |
energyData | Pointer to the EnergyData object |
freeEnergyPerturbationData | Pointer to the FreeEnergyPerturbationData object |
globalCommunicationHelper | Pointer to the GlobalCommunicationHelper object |
observablesReducer | Pointer to the ObservablesReducer object |
storeElement
|
overridevirtual |
Register run function for step / time.
This needs to be called during the integration part of the simulator, at the moment at which the state is at a full time step. Positioning this element is the responsibility of the programmer writing the integration algorithm! If the current step is a trajectory writing step, StatePropagatorData will save a backup for later writeout.
This is also the place at which the current state becomes the previous state.
step | The step number |
time | The time |
registerRunFunction | Function allowing to register a run function |
Implements gmx::ISimulatorElement.