Gromacs
2024.4
|
#include <gromacs/modularsimulator/compositesimulatorelement.h>
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 ®isterRunFunction) 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. | |
|
overridevirtual |
|
overridevirtual |
Element teardown.
Calls the teardown functions of the single elements.
Implements gmx::ISimulatorElement.
|
overridevirtual |
Register run function for step / time.
Lets every member of the composite simulator register run functions for the given step.
step | The step number |
time | The time |
registerRunFunction | Function allowing to register a run function |
Implements gmx::ISimulatorElement.