10     : output_format(output_format), fps(fps), video_length(video_length) {
 
   13         throw std::runtime_error(
"FPS must be positive");
 
   17         throw std::runtime_error(
"Video length must be positive");
 
   45     std::string indent = std::string(depth * 2, 
' ');
 
   49     std::string output_format_s =
 
   50         std::find_if(supported_output_formats.begin(), supported_output_formats.end(), [
this](
const auto& format) {
 
   51             return format.second == output_format;
 
   55     Logger::logger->info(
"{}║   ┌Output format: {}", indent, output_format_s);
 
   60 FrameWriterInterceptor::operator std::string()
 const { 
return "Frame Writer: " + 
std::to_string(file_counter) + 
" files saved"; }
 
const std::string ansi_end
 
const std::string ansi_orange_bold
 
FrameWriterInterceptor(OutputFormat output_format, int fps, int video_length)
Construct a new Save File Interceptor object.
 
OutputFormat output_format
 
void onSimulationStart(Simulation &simulation) override
This function saves the initial state of the simulation.
 
void onSimulationEnd(size_t iteration, Simulation &simulation) override
This function saves the final state of the simulation.
 
void operator()(size_t iteration, Simulation &simulation) override
This function is called on every nth iteration. It writes the current state of the simulation to a fi...
 
std::unique_ptr< FileOutputHandler > file_output_handler
 
void logSummary(int depth) const override
Logs the summary of the thermostat.
 
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
 
size_t every_nth_iteration
 
double delta_t
Time step of a single simulation iteration.
 
size_t start_iteration
Start iteration of the simulation.
 
double end_time
End time of the simulation.
 
Class to run a simulation.
 
std::unique_ptr< ParticleContainer > particle_container
Reference to the ParticleContainer on whose content the simulation is performed.
 
const SimulationParams & params
Reference to the simulation parameters object.
 
std::string to_string(const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"})