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

#include <gromacs/modularsimulator/compositesimulatorelement.h>

+ Inheritance diagram for gmx::CompositeSimulatorElement:
+ Collaboration diagram for gmx::CompositeSimulatorElement:

Description

Composite simulator element.

The composite simulator element takes a call list of elements and implements the ISimulatorElement interface, making a group of elements effectively behave as one. This simplifies building algorithms.

The CompositeSimulatorElement can optionally also own the elements, but does not require this. The owner of a CompositeSimulatorElement object can hence decide to either pass the ownership to CompositeSimulatorElement, or keep the ownership (and guarantee that they remain valid during the life time of the CompositeSimulatorElement object). CompositeSimulatorElement will only call the setup and teardown methods on the owned elements, thereby avoiding to call them more than once. Consequently, the owner of the elements not owned by CompositeSimulatorElement is responsible to call setup and teardown methods on these elements.

Public Member Functions

 CompositeSimulatorElement (std::vector< compat::not_null< ISimulatorElement * >> elementCallList, std::vector< std::unique_ptr< ISimulatorElement >> elements, int frequency)
 Constructor.
 
void scheduleTask (Step step, Time time, const RegisterRunFunction &registerRunFunction) override
 Register run function for step / time. More...
 
void elementSetup () override
 Element setup. More...
 
void elementTeardown () override
 Element teardown. More...
 
- Public Member Functions inherited from gmx::ISimulatorElement
virtual ~ISimulatorElement ()=default
 Standard virtual destructor.
 

Member Function Documentation

void gmx::CompositeSimulatorElement::elementSetup ( )
overridevirtual

Element setup.

Calls the setup functions of the single elements.

Implements gmx::ISimulatorElement.

void gmx::CompositeSimulatorElement::elementTeardown ( )
overridevirtual

Element teardown.

Calls the teardown functions of the single elements.

Implements gmx::ISimulatorElement.

void gmx::CompositeSimulatorElement::scheduleTask ( Step  step,
Time  time,
const RegisterRunFunction registerRunFunction 
)
overridevirtual

Register run function for step / time.

Lets every member of the composite simulator register run functions for the given step.

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: