3 #include <spdlog/fmt/chrono.h>
16 std::string indent = std::string(depth * 2,
' ');
18 Logger::logger->info(
"{}╔════════════════════════════════════════", indent);
35 Logger::logger->info(
"{}╚════════════════════════════════════════", indent);
42 std::time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
43 auto formatted_time = fmt::format(
"{:%d.%m.%Y-%H:%M:%S}", fmt::localtime(now));
47 (filename_prefix + (filename_prefix.empty() ?
"" :
"_") +
"performance_data_" + formatted_time +
".csv"),
48 {
"num_particles",
"particle_container",
"delta_t",
"total_time[s]",
"particle_updates_per_second[1/s]",
"total_iterations"},
false);
52 return std::dynamic_pointer_cast<ParticleUpdateCounterInterceptor>(interceptor) != nullptr;
55 auto particle_updates_per_second =
58 std::dynamic_pointer_cast<ParticleUpdateCounterInterceptor>(*particle_update_counter)->getParticleUpdatesPerSecond())
61 std::string container_type_string = std::visit([](
auto&& arg) {
return std::string(arg); },
params.
container_type);
const std::string ansi_yellow_bold
const std::string ansi_end
void writeRow(const std::vector< serializable_types > &row)
Writes a row to the CSV file.
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
std::vector< std::string > interceptor_summaries
Summary of the interceptors that were used during the simulation.
double total_time_seconds
Total time the simulation took to execute in seconds (includes time for writing output files and logg...
void savePerformanceDataCSV() const
Saves the simulation overview to a csv file.
void logSummary(int depth=0) const
Prints a summary of the simulation overview to the logger.
std::vector< Particle > resulting_particles
Resulting particles after the simulation.
size_t total_iterations
Total number of iterations the simulation ran for (includes an initial force calculation)
const SimulationParams & params
Original simulation parameters bevore the simulation.
size_t num_particles
Number of particles in the simulation.
double delta_t
Time step of a single simulation iteration.
std::vector< std::shared_ptr< SimulationInterceptor > > interceptors
List of interceptors to be used in the simulation.
std::filesystem::path output_dir_path
Path to the directory in which to save the simulation output.
std::filesystem::path input_file_path
Path to the input file of the simulation.
std::variant< DirectSumType, LinkedCellsType > container_type
Type of the particle container.
std::string to_string(const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"})