Molecular Dynamics Simulation  1.0
TemperatureSensorInterceptor.h
Go to the documentation of this file.
1 #pragma once
2 #include <chrono>
3 
7 
9  public:
13  explicit TemperatureSensorInterceptor(std::shared_ptr<Thermostat> thermostat, double sample_every_x_percent)
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:
57  std::unique_ptr<CSVWriter> csv_writer;
58 
62  std::shared_ptr<Thermostat> thermostat;
63 
65 };
Class to run a simulation.
Definition: Simulation.h:20
TemperatureSensorInterceptor(std::shared_ptr< Thermostat > thermostat, double sample_every_x_percent)
Construct a new TemperatureSensor Interceptor object.
void onSimulationStart(Simulation &simulation) override
This function is empty as the thermostat doesnt need initialization.
std::unique_ptr< CSVWriter > csv_writer
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...
std::shared_ptr< Thermostat > thermostat
The thermostat that is used to scale the temperature.
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.
void logSummary(int depth) const override
Logs the summary of the thermostat.