Molecular Dynamics Simulation  1.0
ThermostatInterceptor.h
Go to the documentation of this file.
1 #pragma once
2 #include <chrono>
3 #include <memory>
4 
8 
10  public:
14  explicit ThermostatInterceptor(std::shared_ptr<Thermostat> thermostat, size_t application_interval);
15 
21  void onSimulationStart(Simulation& simulation) override;
22 
30  void operator()(size_t iteration, Simulation& simulation) override;
31 
39  void onSimulationEnd(size_t iteration, Simulation& simulation) override;
40 
49  explicit operator std::string() const override;
50 
54  void logSummary(int depth) const override;
55 
56  private:
60  std::shared_ptr<Thermostat> thermostat;
61 
66 };
Class to run a simulation.
Definition: Simulation.h:20
void onSimulationEnd(size_t iteration, Simulation &simulation) override
This function is empty as the thermostat doesnt need to do anything at the end of the simulation.
std::shared_ptr< Thermostat > thermostat
The thermostat that is used to scale the temperature.
void operator()(size_t iteration, Simulation &simulation) override
This function is called on every nth iteration. It scales the temperature of the particles in accorda...
ThermostatInterceptor(std::shared_ptr< Thermostat > thermostat, size_t application_interval)
Construct a new Thermostat Interceptor object.
void onSimulationStart(Simulation &simulation) override
This function is empty as the thermostat doesnt need initialization.
size_t application_interval
The interval at which the thermostat is applied.
void logSummary(int depth) const override
Logs the summary of the thermostat.