BioCMAMC-ST
partial_exporter.hpp
1#ifndef __CORE_PARTIAL_EXPORTER_HPP__
2#define __CORE_PARTIAL_EXPORTER_HPP__
3
4#include <common/execinfo.hpp>
5#include <core/post_process.hpp>
6#include <cstddef>
7#include <cstdint>
8#include <dataexporter/data_exporter.hpp>
9#include <optional>
10#include <span>
11#include <string>
12#include <string_view>
13#include <unordered_map>
14#include <vector>
15
16namespace Core
17{
27 class PartialExporter final : public DataExporter
28 {
29 public:
38 PartialExporter(const ExecInfo& info,
39 std::string_view _filename,
40 std::optional<export_metadata_t> user_description
41 = std::nullopt);
42
49 void init_fields(uint64_t n_iter, uint64_t n_compartments);
50
58 const std::string& ds_name,
59 bool compress_data);
65 void write_number_particle(const std::vector<size_t>& distribution);
66
73 void write_probe(const std::string& probe_name,
74 std::span<const double> data);
75
83 void write_tally(std::span<const std::size_t> data);
84
85 private:
86 // uint64_t probe_counter_n_element; /**< Counter for the number of probe
87 // elements. */
88 std::unordered_map<std::string, uint64_t> probe_counter_n_element;
89 };
90
91}; // namespace Core
92
93#endif
DataExporter(const DataExporter &)=delete
void init_fields(uint64_t n_iter, uint64_t n_compartments)
Initializes the fields required for exporting data.
Definition partial_exporter.cpp:26
void write_particle_data(PostProcessing::BonceBuffer &&bonce, const std::string &ds_name, bool compress_data)
Writes particle data to the output.
Definition partial_exporter.cpp:107
PartialExporter(const ExecInfo &info, std::string_view _filename, std::optional< export_metadata_t > user_description=std::nullopt)
Constructs a PartialExporter instance.
Definition partial_exporter.cpp:15
void write_number_particle(const std::vector< size_t > &distribution)
Writes the number of particles in each compartment.
Definition partial_exporter.cpp:85
void write_probe(const std::string &probe_name, std::span< const double > data)
Writes probe data to the export.
Definition partial_exporter.cpp:94
std::unordered_map< std::string, uint64_t > probe_counter_n_element
Definition partial_exporter.hpp:88
void write_tally(std::span< const std::size_t > data)
Writes tally.
Definition partial_exporter.cpp:145
Core component to perform simulation.
Definition data_exporter.hpp:19
Definition execinfo.hpp:12
Definition post_process.hpp:21