Molecular Dynamics Simulation  1.0
VelocityProfileInterceptor.h
Go to the documentation of this file.
1 #pragma once
2 #include <chrono>
3 #include <memory>
4 
7 
9  public:
13  VelocityProfileInterceptor(std::pair<std::array<double, 3>, std::array<double, 3>> box, size_t num_bins, size_t sample_every_x_percent);
14 
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::pair<std::array<double, 3>, std::array<double, 3>> box;
58  size_t num_bins;
59  std::array<double, 3> bin_width;
61  std::unique_ptr<CSVWriter> csv_writer_x;
62  std::unique_ptr<CSVWriter> csv_writer_y;
63  std::unique_ptr<CSVWriter> csv_writer_z;
64 };
Class to run a simulation.
Definition: Simulation.h:20
VelocityProfileInterceptor(std::pair< std::array< double, 3 >, std::array< double, 3 >> box, size_t num_bins, size_t sample_every_x_percent)
Construct a new Thermostat Interceptor object.
std::unique_ptr< CSVWriter > csv_writer_x
std::unique_ptr< CSVWriter > csv_writer_y
std::pair< std::array< double, 3 >, std::array< double, 3 > > box
void logSummary(int depth) const override
Logs the summary of the radial distribution function.
std::unique_ptr< CSVWriter > csv_writer_z
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 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 onSimulationStart(Simulation &simulation) override
This function is sets the particle_updates to 0 and initializes the start time of the simulation.