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 const std::vector<std::string>& species_names,
44 std::optional<export_metadata_t> user_description
45 = std::nullopt);
46
55 void write_initial(double weight, const Core::SimulationParameters& params);
56
65 void write_final(const Simulation::Getter& getter,
66 std::size_t number_particles);
67
77 void init_fields(uint64_t n_iter,
78 uint64_t n_compartments,
79 uint64_t n_species,
80 bool is_two_phase_flow);
81
93 void update_fields(double t,
94 std::span<const double> concentration_liquid,
95 std::span<const double> liquid_volume,
96 std::optional<std::span<const double>> concentration_gas,
97 std::optional<std::span<const double>> volume_gas,
98 std::optional<std::span<const double>> mtr);
99
100 private:
101 static const std::string
103 uint64_t n_expected_export{};
105 };
106
107} // namespace Core
108
109#endif
DataExporter(const DataExporter &)=delete
static const std::string base_group_name
Definition main_exporter.hpp:102
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:53
void write_final(const Simulation::Getter &getter, std::size_t number_particles)
Writes final simulation data to the output.
Definition main_exporter.cpp:154
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:33
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:119
uint64_t n_expected_export
Definition main_exporter.hpp:103
Definition simulation_getter.hpp:15
Core component to perform simulation.
Definition data_exporter.hpp:38
Definition simulation_parameters.hpp:58
Definition execinfo.hpp:21