8 : target_temperature(target_temperature), max_temperature_change(max_temperature_change), third_dimension(third_dimension) {
11 throw std::runtime_error(
"Target temperature must be positive");
15 Logger::logger->error(
"Max temperature change must be an absolute value (positive)");
16 throw std::runtime_error(
"Max temperature change must be an absolute value (positive)");
29 for (
auto& particle : *particle_container) {
ThirdDimension
Enum class to define the dimension count of the simulation (2D or 3D). Affects primarily the dimensio...
std::array< double, 3 > maxwellBoltzmannDistributedVelocity(double averageVelocity, size_t dimensions)
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
Class to represent a particle.
const std::array< double, 3 > & getV() const
Gets the velocity of the particle.
double getM() const
Gets the mass of the particle.
void setV(const std::array< double, 3 > &v)
Sets the velocity of the particle.
Thermostat(double target_temperature, double max_temperature_change, ThirdDimension third_dimension)
Construct a new Thermostat object.
const double max_temperature_change
The maximum temperature change allowed per thermostat application.
ThirdDimension getThirdDimension() const
Get if the third dimension is enabled on this thermostat or not.
const double target_temperature
The target temperature for thermostat applications.
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...
double getMaxTemperatureChange() const
Get the maximum temperature change of the thermostat.
const ThirdDimension third_dimension
Defines whether the third dimension is enabled.
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 th...
double getTargetTemperature() const
Get the target temperature of the thermostat.