BioCMAMC-ST
ExportHandler Class Reference

#include <host_export_handler.hpp>

Collaboration diagram for ExportHandler:
[legend]

Public Member Functions

 ExportHandler ()=default
 ExportHandler (std::shared_ptr< Core::MainExporter > _main_exporter, ExecInfo _exec, std::size_t _dump_interval, std::size_t _n_iter_simulation)
void operator() (double current_time, size_t loop_counter, Simulation::SimulationUnit &simulation, Core::PartialExporter &partial_exporter)
 Handles periodic export of simulation data.
void pre_post_export (double current_time, const Simulation::SimulationUnit &simulation, const std::unique_ptr< CmaUtils::FlowMapTransitionner > &transitioner)
 Prepares and updates the exporter with the current simulation state before/after main loop.

Static Private Member Functions

static std::optional< std::span< std::size_t > > prepareEventSpan (Simulation::SimulationUnit &simulation)
 Prepares the event span if the event counter is enabled.

Private Attributes

size_t dump_counter {}
size_t dump_interval {}
size_t n_iter_simulation {}
ExecInfo exec {}
std::shared_ptr< Core::MainExportermain_exporter
IO::ProgressBar progressbar

Constructor & Destructor Documentation

◆ ExportHandler() [1/2]

ExportHandler::ExportHandler ( )
default

◆ ExportHandler() [2/2]

ExportHandler::ExportHandler ( std::shared_ptr< Core::MainExporter > _main_exporter,
ExecInfo _exec,
std::size_t _dump_interval,
std::size_t _n_iter_simulation )

Member Function Documentation

◆ operator()()

void ExportHandler::operator() ( double current_time,
size_t loop_counter,
Simulation::SimulationUnit & simulation,
Core::PartialExporter & partial_exporter )

Handles periodic export of simulation data.

This operator is called during the simulation loop to periodically export simulation state. It updates the main exporter, writes particle counts, and optionally saves data based on compile-time flag.

Parameters
current_timeThe current simulation time.
loop_counterThe current loop iteration counter.
simulationThe simulation unit containing the state and data to export.
partial_exporterThe partial exporter for writing particle and probe data.
Here is the call graph for this function:

◆ pre_post_export()

void ExportHandler::pre_post_export ( double current_time,
const Simulation::SimulationUnit & simulation,
const std::unique_ptr< CmaUtils::FlowMapTransitionner > & transitioner )

Prepares and updates the exporter with the current simulation state before/after main loop.

This function gathers the necessary data from the simulation and reactor state and updates the main exporter with this information.

Parameters
current_timeThe current simulation time.
simulationThe simulation unit containing the state and data to export.
transitionerThe flow map transitioner providing access to the reactor state.
Here is the call graph for this function:

◆ prepareEventSpan()

std::optional< std::span< std::size_t > > ExportHandler::prepareEventSpan ( Simulation::SimulationUnit & simulation)
staticprivate

Prepares the event span if the event counter is enabled.

Parameters
simulationThe simulation unit.
Returns
Optional span of event counts.
Here is the caller graph for this function:

Member Data Documentation

◆ dump_counter

size_t ExportHandler::dump_counter {}
private

◆ dump_interval

size_t ExportHandler::dump_interval {}
private

◆ exec

ExecInfo ExportHandler::exec {}
private

◆ main_exporter

std::shared_ptr<Core::MainExporter> ExportHandler::main_exporter
private

◆ n_iter_simulation

size_t ExportHandler::n_iter_simulation {}
private

◆ progressbar

IO::ProgressBar ExportHandler::progressbar
private

The documentation for this class was generated from the following files: