Separate energy data and element
authorPascal Merz <pascal.merz@me.com>
Tue, 14 Jul 2020 13:27:20 +0000 (13:27 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 14 Jul 2020 13:27:20 +0000 (13:27 +0000)
commitfaf790d33e94749019036fcabe7f39c325819255
tree655a2523eddbf9fd063aba4c1fd77d240335ae44
parent7bdf0bbeea20f9f1a22878e7486685f38b583b10
Separate energy data and element

The EnergyElement was both holding data which is accessed by
a majority of the elements, and was an element itself. The element
part is needed to update the energy records and save data for
trajectory writing.
The double nature of the EnergyElement created some difficulty in
initializing the elements, however - the EnergyElement
has a well defined place within the simulator loop, but has to be
created ahead of time so that other elements can get a pointer to it
to query for or save energy data during the simulation run.

This change separates the ISimulatorElement implementation which
allows EnergyElement to take part in the simulation loop
into a member object. The data part of the EnergyElement is renamed
to EnergyData, the element is EnergyData::Element. The EnergyData
can now be created ahead of element construction time, while an
object of the member class can be created later. This will make the
implementation of a builder approach significantly easier.
The life time of the element is managed by the EnergyData object to
avoid problematic life time dependencies between the two.

Refs #3437
21 files changed:
docs/doxygen/lib/modularsimulator.md
src/gromacs/mdrun/md.cpp
src/gromacs/modularsimulator/computeglobalselement.cpp
src/gromacs/modularsimulator/computeglobalselement.h
src/gromacs/modularsimulator/constraintelement.cpp
src/gromacs/modularsimulator/constraintelement.h
src/gromacs/modularsimulator/domdechelper.h
src/gromacs/modularsimulator/energydata.cpp [moved from src/gromacs/modularsimulator/energyelement.cpp with 77% similarity]
src/gromacs/modularsimulator/energydata.h [moved from src/gromacs/modularsimulator/energyelement.h with 80% similarity]
src/gromacs/modularsimulator/forceelement.cpp
src/gromacs/modularsimulator/forceelement.h
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp
src/gromacs/modularsimulator/parrinellorahmanbarostat.h
src/gromacs/modularsimulator/pmeloadbalancehelper.h
src/gromacs/modularsimulator/propagator.h
src/gromacs/modularsimulator/simulatoralgorithm.cpp
src/gromacs/modularsimulator/simulatoralgorithm.h
src/gromacs/modularsimulator/statepropagatordata.h
src/gromacs/modularsimulator/vrescalethermostat.cpp
src/gromacs/modularsimulator/vrescalethermostat.h