Gromacs
2024.4
|
#include <gromacs/modularsimulator/mttk.h>
Class holding the extra dof and parameters used by the MTTK algorithm.
As the Trotter update is split in several sub-steps (i.e. is updated by several element instances), the MTTK degrees of freedom must be stored centrally rather than by the single elements.
This class manages these extra degrees of freedom. It controls access, keeps track of the current time stamp of the dofs, calculates the energy related to the dof at the requested times, and writes the data needed for restarts to checkpoint. As this is not implementing the ISimulatorElement interface, it is not part of the simulator loop, but relies on callbacks to perform its duties.
Public Member Functions | |
MttkData (real ensembleTemperature, real referencePressure, real couplingTimeStep, real couplingTime, real initialVolume, real numDegreesOfFreedom, real simulationTimeStep, const tensor compressibility, const StatePropagatorData *statePropagatorData, MttkPropagatorConnection *mttkPropagatorConnection) | |
Constructor. | |
MttkData (const MttkData &other) | |
Explicit copy constructor (interface has a standard destructor) | |
real | kineticEnergy () const |
The current kinetic energy of the MTTK degree of freedom. | |
void | scale (real scalingFactor, bool scalingAtFullCouplingTimeStep) |
Scale the MTTK dof velocity. More... | |
real | etaVelocity () const |
The current MTTK dof velocity. | |
void | setEtaVelocity (real etaVelocity, real etaVelocityTimeIncrement) |
Set a new MTTK velocity. | |
real | invEtaMass () const |
Get the inverse mass of the MTTK degree of freedom. | |
real | referencePressure () const |
Get the reference pressure. | |
rvec * | boxVelocities () |
Pointer to the box velocities. | |
void | propagatorCallback (Step step) const |
Inform the propagators that scaling is needed. | |
void | saveCheckpointState (std::optional< WriteCheckpointData > checkpointData, const t_commrec *cr) override |
ICheckpointHelperClient write checkpoint implementation. | |
void | restoreCheckpointState (std::optional< ReadCheckpointData > checkpointData, const t_commrec *cr) override |
ICheckpointHelperClient read checkpoint implementation. | |
const std::string & | clientID () override |
ICheckpointHelperClient key implementation. | |
void | calculateIntegralIfNeeded () |
Calculate the current value of the MTTK conserved energy if it is needed. | |
Public Member Functions inherited from gmx::ICheckpointHelperClient | |
virtual | ~ICheckpointHelperClient ()=default |
Standard virtual destructor. | |
Static Public Member Functions | |
static void | build (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, const MttkPropagatorConnectionDetails &mttkPropagatorConnectionDetails) |
Build object and store in builder helper object. | |
static std::string | dataID () |
Identifier used to store objects. | |
void gmx::MttkData::scale | ( | real | scalingFactor, |
bool | scalingAtFullCouplingTimeStep | ||
) |
Scale the MTTK dof velocity.
scalingFactor | The factor by which the velocity is scaled |
scalingAtFullCouplingTimeStep | Whether the calling object is at full timestep (determines whether the integral is calculated) |