9 t_start = std::chrono::high_resolution_clock::now();
19 t_end = std::chrono::high_resolution_clock::now();
20 t_diff = std::chrono::duration_cast<std::chrono::milliseconds>(
t_end -
t_start).count();
28 std::string indent = std::string(depth * 2,
' ');
34 ParticleUpdateCounterInterceptor::operator std::string()
const {
35 return "ParticleUpdateCalculator: " +
std::to_string(particle_updates_per_second) +
" particle updates per second";
const std::string ansi_end
const std::string ansi_orange_bold
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
double getParticleUpdatesPerSecond() const
Get the particle updates per second.
void logSummary(int depth) const override
Logs the summary of the particle update counter.
double particle_updates_per_second
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 onSimulationStart(Simulation &simulation) override
This function is sets the particle_updates to 0 and initializes the start time of the simulation.
std::chrono::high_resolution_clock::time_point t_end
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::chrono::milliseconds::rep t_diff
std::chrono::high_resolution_clock::time_point t_start
size_t every_nth_iteration
Class to run a simulation.
std::unique_ptr< ParticleContainer > particle_container
Reference to the ParticleContainer on whose content the simulation is performed.
std::string to_string(const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"})