Gromacs
2025-dev-20240913-b871546
|
#include <gromacs/modularsimulator/nosehooverchains.h>
Class holding data used by the Nose-Hoover chains.
As the Trotter update is split in several sub-steps (i.e. is updated by several element instances), the NHC degrees of freedom must be stored centrally rather than by the single elements.
This class manages these extra degrees of freedom. It controls access (making sure that only one element has write access at a time), 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 | |
NoseHooverChainsData (int numTemperatureGroups, real couplingTimeStep, int chainLength, ArrayRef< const real > referenceTemperature, ArrayRef< const real > couplingTime, ArrayRef< const real > numDegreesOfFreedom, NhcUsage nhcUsage) | |
Constructor. | |
~NoseHooverChainsData () | |
Explicit default destructor. | |
NoseHooverChainsData (const NoseHooverChainsData &other) | |
Explicit copy constructor (interface has a standard destructor) | |
real | applyNhc (int temperatureGroup, double propagationTimeStep, real currentKineticEnergy) |
Propagate the NHC degrees of freedom for a temperature group and return its current velocity scaling value. More... | |
int | numTemperatureGroups () const |
The number of temperature groups. | |
bool | isAtFullCouplingTimeStep () const |
Whether the NHC degrees of freedom are at a full coupling time step. | |
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. | |
Public Member Functions inherited from gmx::ICheckpointHelperClient | |
virtual | ~ICheckpointHelperClient ()=default |
Standard virtual destructor. | |
Static Public Member Functions | |
static void | build (NhcUsage nhcUsage, LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, EnergyData *energyData) |
Build object and store in builder helper object. | |
static std::string | dataID (NhcUsage nhcUsage) |
Identifier used to store objects. | |
real gmx::NoseHooverChainsData::applyNhc | ( | int | temperatureGroup, |
double | propagationTimeStep, | ||
real | currentKineticEnergy | ||
) |
Propagate the NHC degrees of freedom for a temperature group and return its current velocity scaling value.
temperatureGroup | The temperature group to be propagated |
propagationTimeStep | The time step by which the DOF are propagated |
currentKineticEnergy | The current kinetic energy of the temperature group |