Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Thermostat.h
Go to the documentation of this file.
1 //
2 // Created by daniel on 29.06.24.
3 //
4 
5 #pragma once
6 
7 #include "models/Model.h"
8 
13 class Thermostat {
14 
15  protected:
30 
31 public:
37  virtual double calculateKineticEnergy() = 0;
38 
44  virtual double calculateTemperature() = 0;
45 
56  Thermostat(Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange,
57  int dimensions);
58 
63  void initialiseSystem();
64 
69 
75 
80  this->targetTemperature = targetTemperature;
81  }
82 
83  virtual ~Thermostat() = default;
84 };
85 
86 
87 
Abstract base class for any model for molecule simulation.
Definition: Model.h:17
Base class for controling the temperature of the simulated system.
Definition: Thermostat.h:13
virtual double calculateTemperature()=0
Helper method to calculate the current temperature of the system.
double targetTemperature
Definition: Thermostat.h:27
double maxTemperatureChange
Definition: Thermostat.h:28
Thermostat(Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange, int dimensions)
Construct a thermostat for a model.
Definition: Thermostat.cpp:7
virtual ~Thermostat()=default
virtual void setTemperatureOfTheSystemViaVelocityScaling()=0
Set the temperature of the current system to targetTemperature.
int dimensions
Definition: Thermostat.h:29
double initTemperature
Definition: Thermostat.h:26
virtual double calculateKineticEnergy()=0
Helper method to calculate the current kinetic energy of the system.
void initialiseSystem()
Set the temperature of the system to initTemperature before starting the simultion by applying Browni...
Definition: Thermostat.cpp:13
void setTargetTemperature(double targetTemperature)
Definition: Thermostat.h:79
Model & model
Definition: Thermostat.h:25
virtual void setTemperatureOfTheSystemViaGradualVelocityScaling()=0
Set the temperature of the current system to targetTemperature, if the change in temperature does not...
Class corresponding to the model schema type.
Definition: ConfigurationFile.h:2755