Molecular Dynamics Simulation  1.0
RadialDistributionFunctionInterceptor.h
Go to the documentation of this file.
1 #pragma once
2 #include <chrono>
3 #include <memory>
4 
7 
9  public:
15 
22  void onSimulationStart(Simulation& simulation) override;
23 
31  void operator()(size_t iteration, Simulation& simulation) override;
32 
40  void onSimulationEnd(size_t iteration, Simulation& simulation) override;
41 
50  explicit operator std::string() const override;
51 
55  void logSummary(int depth) const override;
56 
57  double calculateLocalDensity(size_t N, size_t bin_index) const;
58 
59  private:
60  void saveCurrentRadialDistribution(size_t iteration, Simulation& simulation);
61 
62  private:
63  double bin_width;
65  std::unique_ptr<CSVWriter> csv_writer;
66 };
void operator()(size_t iteration, Simulation &simulation) override
This function is called on every nth iteration. It counts the number of particle updates which have b...
void logSummary(int depth) const override
Logs the summary of the radial distribution function.
void onSimulationStart(Simulation &simulation) override
This function is sets the particle_updates to 0 and initializes the start time of the simulation.
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.
double calculateLocalDensity(size_t N, size_t bin_index) const
RadialDistributionFunctionInterceptor(double bin_width, double sample_every_x_percent)
Construct a new Thermostat Interceptor object.
void saveCurrentRadialDistribution(size_t iteration, Simulation &simulation)
Class to run a simulation.
Definition: Simulation.h:20