BioCMAMC-ST
Core::PartialExporter Class Reference

Exporter for each MPI worker (including host) that exports data relative to particle state. More...

#include <partial_exporter.hpp>

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

Public Member Functions

 PartialExporter (const ExecInfo &info, std::string_view _filename, std::optional< export_metadata_t > user_description=std::nullopt)
 Constructs a PartialExporter instance.
 
void init_fields (uint64_t n_iter, uint64_t n_compartments)
 Initializes the fields required for exporting data.
 
void write_particle_data (std::span< std::string > names, ViewParticleProperties particle_values, ViewParticleProperties spatial_values, const std::string &ds_name, bool compress_data)
 Writes particle data to the output.
 
void write_number_particle (const std::vector< size_t > &distribution)
 Writes the number of particles in each compartment.
 
void write_probe (std::span< const double > data)
 Writes probe data to the export.
 

Private Attributes

uint64_t probe_counter_n_element
 
- Private Attributes inherited from Core::DataExporter
export_metadata_kv metadata
 
uint64_t export_counter = 0
 

Additional Inherited Members

- Private 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.
 
- Private 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.
 
 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)
 

Detailed Description

Exporter for each MPI worker (including host) that exports data relative to particle state.

This class handles exporting particle-related data, including initialization of fields, writing particle data, managing particle number distributions, and writing probe data. It derives privately from DataExporter to encapsulate its backend.

Constructor & Destructor Documentation

◆ PartialExporter()

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

Constructs a PartialExporter instance.

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

Member Function Documentation

◆ init_fields()

void Core::PartialExporter::init_fields ( uint64_t n_iter,
uint64_t n_compartments )

Initializes the fields required for exporting data.

Parameters
n_iterNumber of iterations for the simulation or process.
n_compartmentsNumber of compartments to manage.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_number_particle()

void Core::PartialExporter::write_number_particle ( const std::vector< size_t > & distribution)

Writes the number of particles in each compartment.

Parameters
distributionA vector containing particle counts per compartment.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_particle_data()

void Core::PartialExporter::write_particle_data ( std::span< std::string > names,
ViewParticleProperties particle_values,
ViewParticleProperties spatial_values,
const std::string & ds_name,
bool compress_data )

Writes particle data to the output.

Parameters
namesA span of strings representing particle property names.
particle_valuesParticle properties such as mass, age ...
spatial_valuesParticle properties such as mass, age ... in space
ds_nameDataset name associated with this data.
compress_dataCompress particle or not (can be time consuming)
Here is the call graph for this function:

◆ write_probe()

void Core::PartialExporter::write_probe ( std::span< const double > data)

Writes probe data to the export.

Parameters
dataA span of constant doubles containing the probe measurements.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ probe_counter_n_element

uint64_t Core::PartialExporter::probe_counter_n_element
private

Counter for the number of probe elements.


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