Gromacs
2021.4
|
#include <gromacs/modularsimulator/energydata.h>
Data class managing energies.
The EnergyData owns the EnergyObject, the tensors for the different virials and the pressure as well as the total dipole vector. It has a member class which is part of the simulator loop and and is responsible for saving energy data and writing it to trajectory.
The EnergyData offers an interface to add virial contributions, but also allows access to the raw pointers to tensor data, the dipole vector, and the legacy energy data structures.
The EnergyData owns an object of type EnergyData::Element, which takes part in the simulation loop, allowing to record and output energies during the simulation.
Classes | |
class | Element |
Element for EnergyData. More... | |
Public Member Functions | |
EnergyData (StatePropagatorData *statePropagatorData, FreeEnergyPerturbationData *freeEnergyPerturbationData, const gmx_mtop_t *globalTopology, const t_inputrec *inputrec, const MDAtoms *mdAtoms, gmx_enerdata_t *enerd, gmx_ekindata_t *ekind, const Constraints *constr, FILE *fplog, t_fcdata *fcd, const MdModulesNotifier &mdModulesNotifier, bool isMasterRank, ObservablesHistory *observablesHistory, StartingBehavior startingBehavior, bool simulationsShareState) | |
Constructor. | |
void | teardown () |
Final output. More... | |
void | addToForceVirial (const tensor virial, Step step) |
Add contribution to force virial. More... | |
void | addToConstraintVirial (const tensor virial, Step step) |
Add contribution to constraint virial. More... | |
rvec * | forceVirial (Step step) |
Get pointer to force virial tensor. More... | |
rvec * | constraintVirial (Step step) |
Get pointer to constraint virial tensor. More... | |
rvec * | totalVirial (Step step) |
Get pointer to total virial tensor. More... | |
rvec * | pressure (Step step) |
Get pointer to pressure tensor. More... | |
real * | muTot () |
Get pointer to mu_tot. More... | |
gmx_enerdata_t * | enerdata () |
Get pointer to energy structure. More... | |
gmx_ekindata_t * | ekindata () |
Get pointer to kinetic energy structure. More... | |
bool * | needToSumEkinhOld () |
Get pointer to needToSumEkinhOld. More... | |
bool | hasReadEkinFromCheckpoint () const |
Whether kinetic energy was read from checkpoint. More... | |
void | setVelocityScalingTemperatureCoupling (const VelocityScalingTemperatureCoupling *velocityScalingTemperatureCoupling) |
Set velocity scaling temperature coupling. More... | |
void | setParrinelloRahamnBarostat (const ParrinelloRahmanBarostat *parrinelloRahmanBarostat) |
set Parrinello-Rahman barostat More... | |
Element * | element () |
Get pointer to element (whose lifetime is managed by this) | |
Static Public Member Functions | |
static void | initializeEnergyHistory (StartingBehavior startingBehavior, ObservablesHistory *observablesHistory, EnergyOutput *energyOutput) |
Initialize energy history. More... | |
void gmx::EnergyData::addToConstraintVirial | ( | const tensor | virial, |
Step | step | ||
) |
Add contribution to constraint virial.
This automatically resets the tensor if the step is higher than the current step, starting the tensor calculation for a new step at zero. Otherwise, it adds the new contribution to the existing virial.
void gmx::EnergyData::addToForceVirial | ( | const tensor | virial, |
Step | step | ||
) |
Add contribution to force virial.
This automatically resets the tensor if the step is higher than the current step, starting the tensor calculation for a new step at zero. Otherwise, it adds the new contribution to the existing virial.
rvec * gmx::EnergyData::constraintVirial | ( | Step | step | ) |
Get pointer to constraint virial tensor.
Allows access to the raw pointer to the tensor.
gmx_ekindata_t * gmx::EnergyData::ekindata | ( | ) |
Get pointer to kinetic energy structure.
gmx_enerdata_t * gmx::EnergyData::enerdata | ( | ) |
Get pointer to energy structure.
rvec * gmx::EnergyData::forceVirial | ( | Step | step | ) |
Get pointer to force virial tensor.
Allows access to the raw pointer to the tensor.
bool gmx::EnergyData::hasReadEkinFromCheckpoint | ( | ) | const |
Whether kinetic energy was read from checkpoint.
This is needed by the compute globals element TODO: Remove this when moving global reduction to client system (#3421)
|
static |
Initialize energy history.
Kept as a static function to allow usage from legacy code
real * gmx::EnergyData::muTot | ( | ) |
Get pointer to mu_tot.
Allows access to the raw pointer to the dipole vector.
bool * gmx::EnergyData::needToSumEkinhOld | ( | ) |
Get pointer to needToSumEkinhOld.
rvec * gmx::EnergyData::pressure | ( | Step | step | ) |
Get pointer to pressure tensor.
Allows access to the raw pointer to the tensor.
void gmx::EnergyData::setParrinelloRahamnBarostat | ( | const ParrinelloRahmanBarostat * | parrinelloRahmanBarostat | ) |
set Parrinello-Rahman barostat
This allows to set a pointer to the Parrinello-Rahman barostat used to print the box velocities. TODO: This should be made obsolete my a more modular energy element
void gmx::EnergyData::setVelocityScalingTemperatureCoupling | ( | const VelocityScalingTemperatureCoupling * | velocityScalingTemperatureCoupling | ) |
Set velocity scaling temperature coupling.
This allows to set a pointer to a velocity scaling temperature coupling element used to obtain contributions to the conserved energy. TODO: This should be made obsolete my a more modular energy element
void gmx::EnergyData::teardown | ( | ) |
Final output.
Prints the averages to log. This is called from ModularSimulatorAlgorithm.
rvec * gmx::EnergyData::totalVirial | ( | Step | step | ) |
Get pointer to total virial tensor.
Allows access to the raw pointer to the tensor.