RASPA3 3.0.13
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
Thermostat Struct Referenceexport
module thermostat

Represents a Nose-Hoover thermostat for molecular dynamics simulations. More...

Collaboration diagram for Thermostat:

Public Member Functions

 Thermostat ()
 Default constructor for the Thermostat struct.
 
 Thermostat (double temperature, std::size_t thermostatChainLength, std::size_t numberOfYoshidaSuzukiSteps, double deltaT, std::size_t translationalDegreesOfFreedom, std::size_t rotationalDgreesOfFreedom)
 Constructs a Thermostat with specified parameters.
 
void initialize (RandomNumber &random)
 Initializes the thermostat with random velocities.
 
std::pair< double, double > NoseHooverNVT (double UKineticTranslation, double UKineticRotation)
 Performs a Nose-Hoover NVT integration step.
 
double getEnergy ()
 Computes the total energy of the thermostat.
 

Public Attributes

std::uint64_t versionNumber {1}
 Version number for serialization.
 
double temperature
 The target temperature for the thermostat.
 
std::size_t thermostatChainLength
 The length of the thermostat chain.
 
double timeScaleParameterThermostat {0.15}
 Time scale parameter for the thermostat.
 
std::size_t numberOfRespaSteps {5}
 Number of RESPA steps.
 
std::size_t numberOfYoshidaSuzukiSteps {5}
 Number of Yoshida-Suzuki steps for integration.
 
double deltaT {}
 The simulation time step.
 
std::size_t translationalCenterOfMassConstraint {}
 Constraint on translational center of mass degrees of freedom.
 
std::size_t translationalDegreesOfFreedom
 Number of translational degrees of freedom.
 
std::size_t rotationalDgreesOfFreedom
 Number of rotational degrees of freedom.
 
std::vector< double > thermostatDegreesOfFreedomTranslation
 Degrees of freedom for the translational thermostat chain.
 
std::vector< double > thermostatForceTranslation
 Forces for the translational thermostat chain.
 
std::vector< double > thermostatVelocityTranslation
 Velocities for the translational thermostat chain.
 
std::vector< double > thermostatPositionTranslation
 Positions for the translational thermostat chain.
 
std::vector< double > thermostatMassTranslation
 Masses for the translational thermostat chain.
 
std::vector< double > thermostatDegreesOfFreedomRotation
 Degrees of freedom for the rotational thermostat chain.
 
std::vector< double > thermostatForceRotation
 Forces for the rotational thermostat chain.
 
std::vector< double > thermostatVelocityRotation
 Velocities for the rotational thermostat chain.
 
std::vector< double > thermostatPositionRotation
 Positions for the rotational thermostat chain.
 
std::vector< double > thermostatMassRotation
 Masses for the rotational thermostat chain.
 
std::vector< double > w
 Weights for Yoshida-Suzuki integration steps.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const Thermostat &s)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, Thermostat &s)
 

Detailed Description

Represents a Nose-Hoover thermostat for molecular dynamics simulations.

The Thermostat struct encapsulates the properties and methods required to implement a Nose-Hoover thermostat for temperature control in molecular dynamics simulations. It includes parameters for temperature, thermostat chain length, Yoshida-Suzuki steps, and degrees of freedom. The struct provides methods to initialize the thermostat, perform Nose-Hoover NVT integration steps, and compute the thermostat's energy contribution.

Constructor & Destructor Documentation

◆ Thermostat() [1/2]

Thermostat::Thermostat ( )
inline

Default constructor for the Thermostat struct.

Initializes a Thermostat object with default values.

◆ Thermostat() [2/2]

Thermostat::Thermostat ( double  temperature,
std::size_t  thermostatChainLength,
std::size_t  numberOfYoshidaSuzukiSteps,
double  deltaT,
std::size_t  translationalDegreesOfFreedom,
std::size_t  rotationalDgreesOfFreedom 
)

Constructs a Thermostat with specified parameters.

Initializes a Thermostat with the provided temperature, thermostat chain length, number of Yoshida-Suzuki steps, time step deltaT, and degrees of freedom for translation and rotation.

Parameters
temperatureThe target temperature for the thermostat.
thermostatChainLengthThe length of the thermostat chain.
numberOfYoshidaSuzukiStepsThe number of Yoshida-Suzuki steps for integration.
deltaTThe simulation time step.
translationalDegreesOfFreedomThe number of translational degrees of freedom.
rotationalDgreesOfFreedomThe number of rotational degrees of freedom.

Member Function Documentation

◆ getEnergy()

double Thermostat::getEnergy ( )

Computes the total energy of the thermostat.

Calculates the energy contribution from both translational and rotational thermostat chains.

Returns
The total energy of the thermostat.

◆ initialize()

void Thermostat::initialize ( RandomNumber &  random)

Initializes the thermostat with random velocities.

Sets up the thermostat chain by initializing velocities using a random number generator.

Parameters
randomA reference to a RandomNumber generator.

◆ NoseHooverNVT()

std::pair< double, double > Thermostat::NoseHooverNVT ( double  UKineticTranslation,
double  UKineticRotation 
)

Performs a Nose-Hoover NVT integration step.

Updates the thermostat variables and computes scaling factors for translational and rotational degrees of freedom based on the provided kinetic energies.

Parameters
UKineticTranslationThe kinetic energy of translation.
UKineticRotationThe kinetic energy of rotation.
Returns
A pair of scaling factors for translation and rotation.

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