BioCMAMC-ST
main_exporter.hpp
1#ifndef __CORE_MAIN_EXPORTER_HPP__
2#define __CORE_MAIN_EXPORTER_HPP__
3
4#include "simulation/simulation_getter.hpp"
5#include <common/execinfo.hpp>
6#include <core/simulation_parameters.hpp>
7#include <cstddef>
8#include <cstdint>
9#include <dataexporter/data_exporter.hpp>
10#include <optional>
11#include <span>
12#include <string>
13#include <string_view>
14
15namespace Core
16{
26 class MainExporter final : public DataExporter
27 {
28 public:
32 MainExporter() = default;
33
41 MainExporter(const ExecInfo& info,
42 std::string_view _filename,
43 std::optional<export_metadata_t> user_description
44 = std::nullopt);
45
54 void write_initial(double weight, const Core::SimulationParameters& params);
55
64 void write_final(const Simulation::Getter& getter,
65 std::size_t number_particles);
66
76 void init_fields(uint64_t n_iter,
77 uint64_t n_compartments,
78 uint64_t n_species,
79 bool is_two_phase_flow);
80
92 void update_fields(double t,
93 std::span<const double> concentration_liquid,
94 std::span<const double> liquid_volume,
95 std::optional<std::span<const double>> concentration_gas,
96 std::optional<std::span<const double>> volume_gas,
97 std::optional<std::span<const double>> mtr);
98
99 private:
100 static const std::string
102 uint64_t n_expected_export{};
104 };
105
106} // namespace Core
107
108#endif
DataExporter(const DataExporter &)=delete
static const std::string base_group_name
Definition main_exporter.hpp:101
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.
Definition main_exporter.cpp:49
void write_final(const Simulation::Getter &getter, std::size_t number_particles)
Writes final simulation data to the output.
Definition main_exporter.cpp:148
MainExporter()=default
Default constructor for MainExporter.
void write_initial(double weight, const Core::SimulationParameters &params)
Writes initial simulation data to the output.
Definition main_exporter.cpp:29
void update_fields(double t, std::span< const 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.
Definition main_exporter.cpp:113
uint64_t n_expected_export
Definition main_exporter.hpp:102
Definition simulation_getter.hpp:15
Core component to perform simulation.
Definition data_exporter.hpp:19
Definition simulation_parameters.hpp:58
Definition execinfo.hpp:12