Molecular Dynamics Simulation
1.0
|
A thermostat that can be used to control the temperature of a particle container. Allows for gradual scaling of the temperature towards a set target. More...
#include <Thermostat.h>
Public Member Functions | |
Thermostat (double target_temperature, double max_temperature_change, ThirdDimension third_dimension) | |
Construct a new Thermostat object. More... | |
virtual | ~Thermostat ()=default |
Destroy the Thermostat object. More... | |
virtual void | scaleTemperature (const std::unique_ptr< ParticleContainer > &particle_container) const =0 |
Scale the temperature of a particle container towards the target temperature. Capped by the maximum temperature change. More... | |
virtual double | getCurrentContainerTemperature (const std::unique_ptr< ParticleContainer > &particle_container) const =0 |
Get the current temperature of a particle container. More... | |
void | setTemperature (double new_temperature, const std::unique_ptr< ParticleContainer > &particle_container) |
Set the initial temperature of a particle container. This function sets the velocity of all particles in the container to a random value according to the Maxwell-Boltzmann distribution (all previous velocities are discarded). Use this function for systems with no initial velocity. More... | |
double | getTargetTemperature () const |
Get the target temperature of the thermostat. More... | |
double | getMaxTemperatureChange () const |
Get the maximum temperature change of the thermostat. More... | |
ThirdDimension | getThirdDimension () const |
Get if the third dimension is enabled on this thermostat or not. More... | |
Static Public Member Functions | |
static void | setParticleTemperature (double new_temperature, Particle &particle, ThirdDimension third_dimension) |
Set the temperature of a particle. This method adds a random velocity to the particle according to the Maxwell-Boltzmann distribution. This function can be used for particle generators since previous velocities are not discarded. More... | |
Protected Attributes | |
const double | target_temperature |
The target temperature for thermostat applications. More... | |
const double | max_temperature_change |
The maximum temperature change allowed per thermostat application. More... | |
const ThirdDimension | third_dimension |
Defines whether the third dimension is enabled. More... | |
A thermostat that can be used to control the temperature of a particle container. Allows for gradual scaling of the temperature towards a set target.
Definition at line 13 of file Thermostat.h.
|
explicit |
Construct a new Thermostat object.
target_temperature | The target temperature for thermostat applications. |
max_temperature_change | The maximum temperature change allowed per thermostat application. |
third_dimension | Wether the third dimension is enabled or not. |
Definition at line 7 of file Thermostat.cpp.
|
virtualdefault |
Destroy the Thermostat object.
|
pure virtual |
Get the current temperature of a particle container.
particle_container | The particle container to get the temperature of. |
Implemented in RelativeThermostat, and AbsoluteThermostat.
double Thermostat::getMaxTemperatureChange | ( | ) | const |
Get the maximum temperature change of the thermostat.
Definition at line 36 of file Thermostat.cpp.
double Thermostat::getTargetTemperature | ( | ) | const |
Get the target temperature of the thermostat.
Definition at line 34 of file Thermostat.cpp.
ThirdDimension Thermostat::getThirdDimension | ( | ) | const |
Get if the third dimension is enabled on this thermostat or not.
Definition at line 38 of file Thermostat.cpp.
|
pure virtual |
Scale the temperature of a particle container towards the target temperature. Capped by the maximum temperature change.
particle_container | The particle container to scale the temperature of. |
Implemented in RelativeThermostat, and AbsoluteThermostat.
|
static |
Set the temperature of a particle. This method adds a random velocity to the particle according to the Maxwell-Boltzmann distribution. This function can be used for particle generators since previous velocities are not discarded.
new_temperature | The new temperature of the particle. |
particle | The particle to set the initial temperature of. |
third_dimension | Wether the third dimension is enabled or not. |
Definition at line 20 of file Thermostat.cpp.
void Thermostat::setTemperature | ( | double | new_temperature, |
const std::unique_ptr< ParticleContainer > & | particle_container | ||
) |
Set the initial temperature of a particle container. This function sets the velocity of all particles in the container to a random value according to the Maxwell-Boltzmann distribution (all previous velocities are discarded). Use this function for systems with no initial velocity.
new_temperature | The new temperature of the particle container. |
particle_container | The particle container to set the initial temperature of. |
Definition at line 26 of file Thermostat.cpp.
|
protected |
The maximum temperature change allowed per thermostat application.
Definition at line 94 of file Thermostat.h.
|
protected |
The target temperature for thermostat applications.
Definition at line 89 of file Thermostat.h.
|
protected |
Defines whether the third dimension is enabled.
Definition at line 99 of file Thermostat.h.