BioCMAMC-ST
Core::MainExporter Class Reference

Exporter for host-only data related to general-purpose simulation data (e.g., concentration, parameters, and other global data). More...

#include <main_exporter.hpp>

Inheritance diagram for Core::MainExporter:
[legend]
Collaboration diagram for Core::MainExporter:
[legend]

Public Member Functions

 MainExporter ()=default
 Default constructor for MainExporter.
 
 MainExporter (const ExecInfo &info, std::string_view _filename, std::optional< export_metadata_t > user_description=std::nullopt)
 Constructs a MainExporter instance.
 
void write_initial (double weight, const Core::SimulationParameters &params)
 Writes initial simulation data to the output.
 
void write_final (Simulation::SimulationUnit &simulation, std::size_t number_particles)
 Writes final simulation data to the output.
 
void init_fields (uint64_t n_iter, uint64_t n_compartments, uint64_t n_species, bool is_two_phase_flow)
 Initializes fields required for simulation export.
 
void update_fields (double t, std::span< double > concentration_liquid, std::span< const double > liquid_volume, std::optional< std::span< const double > > concentration_gas, std::optional< std::span< const double > > volume_gas, std::optional< std::span< const double > > mtr)
 Updates fields with the current simulation state.
 
- Public Member Functions inherited from Core::DataExporter
 DataExporter (const DataExporter &)=delete
 
 DataExporter (DataExporter &&)=delete
 
DataExporteroperator= (const DataExporter &)=delete
 
DataExporteroperator= (DataExporter &&)=delete
 
 DataExporter ()=default
 
void do_link (std::string_view filename, std::string_view link_name, std::string_view groupname)
 Creates a link to a specified file.
 

Private Attributes

uint64_t n_expected_export {}
 

Static Private Attributes

static const std::string base_group_name = "records/"
 

Additional Inherited Members

- Protected Types inherited from Core::DataExporter
using export_metadata_t
 Metadata types for export.
 
using export_metadata_kv
 Key-value pairs for metadata.
 
using ViewParticleProperties
 View for particle properties.
 
using simple_export_t
 
using export_initial_kv
 Initial export key-value pairs.
 
using matrix_variant_t
 Variant for matrix data types.
 
- Protected Member Functions inherited from Core::DataExporter
 DataExporter (const ExecInfo &info, std::string_view _filename, std::optional< export_metadata_t > user_description=std::nullopt)
 
 ~DataExporter ()
 
void write_matrix (std::string_view name, std::span< const double > values, bool compress=false)
 
void write_matrix (std::string_view name, std::span< const double > values, size_t n_row, size_t n_col, bool compress=false)
 
void prepare_matrix (MultiMatrixDescription description)
 
void append_matrix (std::string_view name, matrix_variant_t data)
 
void append_array (std::string_view name, std::span< const double > data, uint64_t last_size=0)
 
void write_properties (std::optional< std::string > specific_dataspace, const export_metadata_kv &values)
 
void write_simple (const export_initial_kv &values, std::string_view root)
 
void write_simple (std::string specific_dataspace, const simple_export_t &values)
 
- Protected Attributes inherited from Core::DataExporter
export_metadata_kv metadata
 
uint64_t export_counter = 0
 

Detailed Description

Exporter for host-only data related to general-purpose simulation data (e.g., concentration, parameters, and other global data).

This class is responsible for exporting simulation data at both the initial and final stages, as well as for managing field updates during the simulation. It provides functionalities to handle both single-phase and two-phase flow simulations.

Constructor & Destructor Documentation

◆ MainExporter() [1/2]

Core::MainExporter::MainExporter ( )
default

Default constructor for MainExporter.

◆ MainExporter() [2/2]

Core::MainExporter::MainExporter ( const ExecInfo & info,
std::string_view _filename,
std::optional< export_metadata_t > user_description = std::nullopt )

Constructs a MainExporter instance.

Parameters
infoExecution information required for export operations.
_filenameThe filename for data export.
user_descriptionOptional metadata describing the export.
Here is the call graph for this function:

Member Function Documentation

◆ init_fields()

void Core::MainExporter::init_fields ( uint64_t n_iter,
uint64_t n_compartments,
uint64_t n_species,
bool is_two_phase_flow )

Initializes fields required for simulation export.

Parameters
n_iterNumber of iterations for the simulation.
n_compartmentsNumber of compartments to manage.
n_speciesNumber of species or particle types being simulated.
is_two_phase_flowFlag indicating if the simulation involves two-phase flow.
Here is the call graph for this function:

◆ update_fields()

void Core::MainExporter::update_fields ( double t,
std::span< double > concentration_liquid,
std::span< const double > liquid_volume,
std::optional< std::span< const double > > concentration_gas,
std::optional< std::span< const double > > volume_gas,
std::optional< std::span< const double > > mtr )

Updates fields with the current simulation state.

Parameters
tCurrent simulation time.
concentration_liquidA span of doubles representing liquid phase concentrations.
liquid_volumeA span of doubles representing liquid phase volumes.
concentration_gasOptional span of doubles for gas phase concentrations.
volume_gasOptional span of doubles for gas phase volumes.
Here is the call graph for this function:

◆ write_final()

void Core::MainExporter::write_final ( Simulation::SimulationUnit & simulation,
std::size_t number_particles )

Writes final simulation data to the output.

Parameters
simulationReference to the simulation unit containing final state information.
distributionFinal distribution of particles or entities across compartments.
Here is the call graph for this function:

◆ write_initial()

void Core::MainExporter::write_initial ( double weight,
const Core::SimulationParameters & params )

Writes initial simulation data to the output.

Parameters
weightInitial particle weight used in the simulation.
paramsCore simulation parameters
distributionInitial distribution of particles or entities across compartments.
Here is the call graph for this function:

Member Data Documentation

◆ base_group_name

const std::string Core::MainExporter::base_group_name = "records/"
staticprivate

Base group name for exported data organization.

◆ n_expected_export

uint64_t Core::MainExporter::n_expected_export {}
private

Expected number of exports for tracking purposes.


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