Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Public Member Functions | List of all members
DefaultThermostat Class Reference

Class for controling the temperature of the simulated system. More...

#include <DefaultThermostat.h>

Inheritance diagram for DefaultThermostat:
Inheritance graph
Collaboration diagram for DefaultThermostat:
Collaboration graph

Public Member Functions

double calculateKineticEnergy () override
 Helper method to calculate the current kinetic energy of the system. More...
 
double calculateTemperature () override
 Helper method to calculate the current temperature of the system. More...
 
 DefaultThermostat (Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange, int dimensions)
 Construct a default thermostat for a model. More...
 
void setTemperatureOfTheSystemViaVelocityScaling () override
 Set the temperature of the current system to targetTemperature. More...
 
void setTemperatureOfTheSystemViaGradualVelocityScaling () override
 Set the temperature of the current system to targetTemperature, if the change in temperature does not exceed maxTemperatureChange. If it does, the temperature will only be adjusted by the value of maxTemperatureChange. More...
 
- Public Member Functions inherited from Thermostat
 Thermostat (Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange, int dimensions)
 Construct a thermostat for a model. More...
 
void initialiseSystem ()
 Set the temperature of the system to initTemperature before starting the simultion by applying Brownian Motion to all particles. More...
 
void setTargetTemperature (double targetTemperature)
 
virtual ~Thermostat ()=default
 

Additional Inherited Members

- Protected Attributes inherited from Thermostat
Modelmodel
 
double initTemperature
 
double targetTemperature
 
double maxTemperatureChange
 
int dimensions
 

Detailed Description

Class for controling the temperature of the simulated system.

Constructor & Destructor Documentation

◆ DefaultThermostat()

DefaultThermostat::DefaultThermostat ( Model model,
double  temperatureInit,
double  temperatureTarget,
double  maxTemperatureChange,
int  dimensions 
)

Construct a default thermostat for a model.

Parameters
modelModel on which the thermostat is applied.
temperatureInitThe initial temperature of the system.
temperatureTargetTemperature the system should reach and preserve
maxTemperatureChangeThe maximal absolute temperature change that is allowed for one application of the thermostat.
dimensionsNumber of dimensions in which the simulation takes place.

Member Function Documentation

◆ calculateKineticEnergy()

double DefaultThermostat::calculateKineticEnergy ( )
overridevirtual

Helper method to calculate the current kinetic energy of the system.

Returns
Current kinetic energy of the system.

Implements Thermostat.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateTemperature()

double DefaultThermostat::calculateTemperature ( )
overridevirtual

Helper method to calculate the current temperature of the system.

Returns
Current temperature of the system.

Implements Thermostat.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTemperatureOfTheSystemViaGradualVelocityScaling()

void DefaultThermostat::setTemperatureOfTheSystemViaGradualVelocityScaling ( )
overridevirtual

Set the temperature of the current system to targetTemperature, if the change in temperature does not exceed maxTemperatureChange. If it does, the temperature will only be adjusted by the value of maxTemperatureChange.

Implements Thermostat.

Here is the call graph for this function:

◆ setTemperatureOfTheSystemViaVelocityScaling()

void DefaultThermostat::setTemperatureOfTheSystemViaVelocityScaling ( )
overridevirtual

Set the temperature of the current system to targetTemperature.

Implements Thermostat.

Here is the call graph for this function:

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