Gromacs  2021.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions
gmx::StatePropagatorData::Element Class Referencefinal

#include <gromacs/modularsimulator/statepropagatordata.h>

+ Inheritance diagram for gmx::StatePropagatorData::Element:
+ Collaboration diagram for gmx::StatePropagatorData::Element:

Description

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 &registerRunFunction) 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 ISimulatorElementgetElementPointerImpl (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper)
 Factory method implementation. More...
 

Additional Inherited Members

Member Function Documentation

void gmx::StatePropagatorData::Element::elementSetup ( )
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.

ISimulatorElement * gmx::StatePropagatorData::Element::getElementPointerImpl ( LegacySimulatorData legacySimulatorData,
ModularSimulatorAlgorithmBuilderHelper builderHelper,
StatePropagatorData statePropagatorData,
EnergyData energyData,
FreeEnergyPerturbationData freeEnergyPerturbationData,
GlobalCommunicationHelper globalCommunicationHelper 
)
static

Factory method implementation.

Parameters
legacySimulatorDataPointer allowing access to simulator level data
builderHelperModularSimulatorAlgorithmBuilder helper object
statePropagatorDataPointer to the StatePropagatorData object
energyDataPointer to the EnergyData object
freeEnergyPerturbationDataPointer to the FreeEnergyPerturbationData object
globalCommunicationHelperPointer to the GlobalCommunicationHelper object
Returns
Pointer to the element to be added. Element needs to have been stored using storeElement
void gmx::StatePropagatorData::Element::scheduleTask ( Step  step,
Time  time,
const RegisterRunFunction registerRunFunction 
)
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.

Parameters
stepThe step number
timeThe time
registerRunFunctionFunction allowing to register a run function

Implements gmx::ISimulatorElement.


The documentation for this class was generated from the following files: