Gromacs  2025.0-dev-20241011-013a99c
 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::ComputeGlobalsElement< algorithm > Class Template Referencefinal

#include <gromacs/modularsimulator/computeglobalselement.h>

+ Inheritance diagram for gmx::ComputeGlobalsElement< algorithm >:
+ Collaboration diagram for gmx::ComputeGlobalsElement< algorithm >:

Description

template<ComputeGlobalsAlgorithm algorithm>
class gmx::ComputeGlobalsElement< algorithm >

Encapsulate the calls to compute_globals

This element aims at offering an interface to the legacy implementation which is compatible with the new simulator approach.

The element comes in 3 (templated) flavors: the leap-frog case, the first call during a velocity-verlet integrator, and the second call during a velocity-verlet integrator. In velocity verlet, the state at the beginning of the step corresponds to positions at time t velocities at time t - dt/2 The first velocity propagation (+dt/2) therefore actually corresponds to the previous step, bringing the state to the full timestep at time t. Most global reductions are made at this point. The second call is needed to correct the constraint virial after the second propagation of velocities (+dt/2) and of the positions (+dt).

Template Parameters
algorithmThe global reduction scheme

Public Member Functions

 ComputeGlobalsElement (StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, SimulationSignals *signals, int nstglobalcomm, FILE *fplog, const MDLogger &mdlog, t_commrec *cr, const t_inputrec *inputrec, const MDAtoms *mdAtoms, t_nrnb *nrnb, gmx_wallcycle *wcycle, t_forcerec *fr, const gmx_mtop_t &global_top, Constraints *constr, ObservablesReducer *observablesReducer)
 Constructor.
 
 ~ComputeGlobalsElement () override
 Destructor.
 
void elementSetup () override
 Element setup - first call to compute_globals. More...
 
void scheduleTask (Step step, Time time, const RegisterRunFunction &registerRunFunction) override
 Register run function for step / time. More...
 
void elementTeardown () override
 No element teardown needed.
 
template<>
ISimulatorElementgetElementPointerImpl (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper, ObservablesReducer *observablesReducer)
 
template<>
ISimulatorElementgetElementPointerImpl (LegacySimulatorData *simulator, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper, ObservablesReducer *observablesReducer)
 
- Public Member Functions inherited from gmx::ISimulatorElement
virtual ~ISimulatorElement ()=default
 Standard virtual destructor.
 
- Public Member Functions inherited from gmx::IEnergySignallerClient
virtual ~IEnergySignallerClient ()=default
 Standard virtual destructor.
 
- Public Member Functions inherited from gmx::ITrajectorySignallerClient
virtual ~ITrajectorySignallerClient ()=default
 Standard virtual destructor.
 

Static Public Member Functions

static ISimulatorElementgetElementPointerImpl (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper, ObservablesReducer *observablesReducer)
 Factory method implementation. More...
 

Additional Inherited Members

Member Function Documentation

template<ComputeGlobalsAlgorithm algorithm>
void gmx::ComputeGlobalsElement< algorithm >::elementSetup ( )
overridevirtual

Element setup - first call to compute_globals.

Implements gmx::ISimulatorElement.

template<ComputeGlobalsAlgorithm algorithm>
static ISimulatorElement* gmx::ComputeGlobalsElement< algorithm >::getElementPointerImpl ( LegacySimulatorData legacySimulatorData,
ModularSimulatorAlgorithmBuilderHelper builderHelper,
StatePropagatorData statePropagatorData,
EnergyData energyData,
FreeEnergyPerturbationData freeEnergyPerturbationData,
GlobalCommunicationHelper globalCommunicationHelper,
ObservablesReducer observablesReducer 
)
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
observablesReducerPointer to the ObservablesReducer object
Exceptions
std::bad_any_caston internal error in VelocityVerlet algorithm builder.
std::bad_allocwhen out of memory.
Returns
Pointer to the element to be added. Element needs to have been stored using storeElement
template<ComputeGlobalsAlgorithm algorithm>
void gmx::ComputeGlobalsElement< algorithm >::scheduleTask ( Step  step,
Time  time,
const RegisterRunFunction registerRunFunction 
)
overridevirtual

Register run function for step / time.

This registers the call to compute_globals when needed.

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: