Gromacs  2024.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::ModularSimulatorAlgorithmBuilderHelper Class Reference

#include <gromacs/modularsimulator/simulatoralgorithm.h>

Description

Helper for element addition.

Such an object will be given to each invocation of getElementPointer

Note: It would be nicer to define this as a member type of ModularSimulatorAlgorithmBuilder, but this would break forward declaration. This object is therefore defined as friend class.

Public Member Functions

 ModularSimulatorAlgorithmBuilderHelper (ModularSimulatorAlgorithmBuilder *builder)
 Constructor.
 
template<typename Element >
Element * storeElement (std::unique_ptr< Element > element)
 Store an element to the ModularSimulatorAlgorithmBuilder.
 
bool elementIsStored (const ISimulatorElement *element) const
 Check if an element is stored in the ModularSimulatorAlgorithmBuilder.
 
void registerPreStepScheduling (SchedulingFunction schedulingFunction)
 Register callback to schedule a pre-step run. More...
 
void registerPostStepScheduling (SchedulingFunction schedulingFunction)
 Register callback to schedule a post-step run. More...
 
template<typename ValueType >
void storeBuilderData (const std::string &key, const ValueType &value)
 Set arbitrary data in the ModularSimulatorAlgorithmBuilder. More...
 
std::optional< std::any > builderData (const std::string &key) const
 Get previously stored builder data. Returns std::nullopt if key is not found.
 
template<typename ValueType >
void storeSimulationData (const std::string &key, ValueType &&value)
 
template<typename ValueType >
std::optional< ValueType * > simulationData (const std::string &key)
 
void registerTemperaturePressureControl (std::function< void(const PropagatorConnection &)> registrationFunction)
 Register temperature / pressure control algorithm to be matched with a propagator.
 
void registerPropagator (PropagatorConnection connectionData)
 Register a propagator to be used with a temperature / pressure control algorithm.
 
void registerReferenceTemperatureUpdate (ReferenceTemperatureCallback referenceTemperatureCallback)
 Register for callback after an update to the reference temperature.
 
ReferenceTemperatureCallback changeReferenceTemperatureCallback ()
 Get a callback to change reference temperature.
 

Member Function Documentation

void gmx::ModularSimulatorAlgorithmBuilderHelper::registerPostStepScheduling ( SchedulingFunction  schedulingFunction)

Register callback to schedule a post-step run.

This allows elements to schedule a function call after the integration step. The function call is guaranteed to happen after all functions scheduled for the integration step. It is not guaranteed to happen in any specific order compared to other elements registering a post-step scheduling function.

void gmx::ModularSimulatorAlgorithmBuilderHelper::registerPreStepScheduling ( SchedulingFunction  schedulingFunction)

Register callback to schedule a pre-step run.

This allows elements to schedule a function call before the integration step. The function call is guaranteed to happen before any functions scheduled for the integration step. It is not guaranteed to happen in any specific order compared to other elements registering a pre-step scheduling function.

template<typename ValueType >
std::optional< ValueType * > gmx::ModularSimulatorAlgorithmBuilderHelper::simulationData ( const std::string &  key)

template<typename ValueType >
void gmx::ModularSimulatorAlgorithmBuilderHelper::storeBuilderData ( const std::string &  key,
const ValueType &  value 
)

Set arbitrary data in the ModularSimulatorAlgorithmBuilder.

Allows to store arbitrary data with lifetime equal to the builder. Functionality is used by stateful static builder functions.

template<typename ValueType >
void gmx::ModularSimulatorAlgorithmBuilderHelper::storeSimulationData ( const std::string &  key,
ValueType &&  value 
)


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