Gromacs  2024
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::NoseHooverTemperatureCoupling Class Referencefinal
+ Inheritance diagram for gmx::NoseHooverTemperatureCoupling:
+ Collaboration diagram for gmx::NoseHooverTemperatureCoupling:

Description

Implements the Nose-Hoover temperature coupling.

Public Member Functions

real integral (int temperatureGroup, real numDegreesOfFreedom, real referenceTemperature)
 Calculate the current value of the temperature coupling integral.
 
real apply (Step gmx_unused step, int temperatureGroup, real currentKineticEnergy, real currentTemperature, const TemperatureCouplingData &thermostatData) override
 Apply the Nose-Hoover temperature control.
 
real applyLeapFrog (Step gmx_unused step, int temperatureGroup, real currentKineticEnergy, real currentTemperature, const TemperatureCouplingData &thermostatData)
 Apply for leap-frog. More...
 
void connectWithPropagator (const PropagatorConnection &connectionData, int numTemperatureGroups) override
 Connect with propagator - Nose-Hoover scales start and end step velocities.
 
 NoseHooverTemperatureCoupling (int numTemperatureGroups, ArrayRef< const real > referenceTemperature, ArrayRef< const real > couplingTime)
 Constructor.
 
template<CheckpointDataOperation operation>
void doCheckpointData (CheckpointData< operation > *checkpointData)
 Helper function to read from / write to CheckpointData.
 
void writeCheckpoint (std::optional< WriteCheckpointData > checkpointData, const t_commrec *cr) override
 Write thermostat dof to checkpoint.
 
void readCheckpoint (std::optional< ReadCheckpointData > checkpointData, const t_commrec *cr) override
 Read thermostat dof from checkpoint.
 
real updateReferenceTemperatureAndIntegral (int temperatureGroup, real gmx_unused newTemperature, ReferenceTemperatureChangeAlgorithm gmx_unused algorithm, const TemperatureCouplingData &temperatureCouplingData) override
 Adapt masses.
 
- Public Member Functions inherited from gmx::ITemperatureCouplingImpl
virtual real apply (Step step, int temperatureGroup, real currentKineticEnergy, real currentTemperature, const TemperatureCouplingData &temperatureCouplingData)=0
 Make a temperature control step. More...
 
virtual real updateReferenceTemperatureAndIntegral (int temperatureGroup, real newTemperature, ReferenceTemperatureChangeAlgorithm algorithm, const TemperatureCouplingData &temperatureCouplingData)=0
 Update the reference temperature and update and return the temperature coupling integral.
 
virtual ~ITemperatureCouplingImpl ()=default
 Standard virtual destructor.
 

Member Function Documentation

real gmx::NoseHooverTemperatureCoupling::applyLeapFrog ( Step gmx_unused  step,
int  temperatureGroup,
real  currentKineticEnergy,
real  currentTemperature,
const TemperatureCouplingData thermostatData 
)
inline

Apply for leap-frog.

This is called after the force calculation, before coordinate update

We expect system to be at x(t), v(t-dt/2), f(t), T(t-dt/2) Internal variables are at xi(t-dt), v_xi(t-dt) Force on xi is calculated at time of system temperature After calling this, we will have xi(t), v_xi(t) The thermostat integral returned is a function of xi and v_xi, and hence at time t.

This performs an update of the thermostat variables calculated as a_xi(t-dt/2) = (T_sys(t-dt/2) - T_ref) / mass_xi; v_xi(t) = v_xi(t-dt) + dt_xi * a_xi(t-dt/2); xi(t) = xi(t-dt) + dt_xi * (v_xi(t-dt) + v_xi(t))/2;

This will be followed by leap-frog integration of coordinates, calculated as v(t-dt/2) *= - 0.5 * dt * v_xi(t); // scale previous velocities v(t+dt/2) = update_leapfrog_v(v(t-dt/2), f(t)); // do whatever LF does v(t+dt/2) *= 1 / (1 + 0.5 * dt * v_xi(t)) // scale new velocities x(t+dt) = update_leapfrog_x(x(t), v(t+dt/2)); // do whatever LF does


The documentation for this class was generated from the following file: