1#ifndef __CORE_DATA_EXPORTER_HPP__
2#define __CORE_DATA_EXPORTER_HPP__
4#include <common/execinfo.hpp>
5#include <core/simulation_parameters.hpp>
13#include <unordered_map>
16#include <common/common.hpp>
61 void do_link(std::string_view filename, std::string_view link_name, std::string_view groupname);
79 std::optional<std::vector<unsigned long long>>
87 std::variant<uint64_t, int, std::string>;
89 std::unordered_map<std::string,
92 Kokkos::View<double**, Kokkos::LayoutRight, HostSpace>;
94 std::variant<size_t, std::string, std::vector<size_t>, double, uint32_t>;
97 std::unordered_map<std::string,
101 std::span<const std::size_t>,
107 std::string_view _filename,
108 std::optional<export_metadata_t> user_description = std::nullopt);
111 void write_matrix(std::string_view name, std::span<const double> values,
bool compress =
false);
114 std::span<const double> values,
117 bool compress =
false);
123 void append_array(std::string_view name, std::span<const double> data, uint64_t last_size = 0);
136 std::unordered_map<std::string, MultiMatrixDescription>
descriptors;
Definition impl_default_dataexporter.cpp:9
A class responsible for exporting various types of data such as matrices, arrays, and metadata in a s...
Definition data_exporter.hpp:42
void append_matrix(std::string_view name, matrix_variant_t data)
Definition impl_default_dataexporter.cpp:35
void append_array(std::string_view name, std::span< const double > data, uint64_t last_size=0)
Definition impl_default_dataexporter.cpp:39
void do_link(std::string_view filename, std::string_view link_name, std::string_view groupname)
Creates a link to a specified file.
Definition impl_default_dataexporter.cpp:11
std::variant< std::span< const double >, std::span< const std::size_t >, double > matrix_variant_t
Variant for matrix data types.
Definition data_exporter.hpp:100
std::variant< uint64_t, int, std::string > export_metadata_t
Metadata types for export.
Definition data_exporter.hpp:86
void write_simple(const export_initial_kv &values, std::string_view root)
Definition impl_default_dataexporter.cpp:59
std::unordered_map< std::string, MultiMatrixDescription > descriptors
Definition data_exporter.hpp:136
Kokkos::View< double **, Kokkos::LayoutRight, HostSpace > ViewParticleProperties
View for particle properties.
Definition data_exporter.hpp:91
void write_matrix(std::string_view name, std::span< const double > values, bool compress=false)
Definition impl_default_dataexporter.cpp:25
uint64_t export_counter
Definition data_exporter.hpp:133
void write_properties(std::optional< std::string > specific_dataspace, const export_metadata_kv &values)
Definition impl_default_dataexporter.cpp:46
void prepare_matrix(MultiMatrixDescription description)
Definition impl_default_dataexporter.cpp:31
DataExporter(const DataExporter &)=delete
std::variant< size_t, std::string, std::vector< size_t >, double, uint32_t > simple_export_t
Definition data_exporter.hpp:93
DataExporter & operator=(DataExporter &&)=delete
std::unordered_map< std::string, export_metadata_t > export_metadata_kv
Key-value pairs for metadata.
Definition data_exporter.hpp:88
export_metadata_kv metadata
Definition data_exporter.hpp:132
std::unordered_map< std::string, simple_export_t > export_initial_kv
Initial export key-value pairs.
Definition data_exporter.hpp:96
std::unique_ptr< impl > pimpl
Definition data_exporter.hpp:138
DataExporter(DataExporter &&)=delete
DataExporter & operator=(const DataExporter &)=delete
Core component to perform simulation.
Definition data_exporter.hpp:18
bool check_results_file_name(Core::UserControlParameters ¶ms)
Definition main_exporter.cpp:170
Describes the properties of a multi-dimensional matrix for export operations.
Definition data_exporter.hpp:75
std::vector< size_t > dims
Dataset dimensions.
Definition data_exporter.hpp:77
std::optional< std::vector< unsigned long long > > chunk_dims
Data chunk along each dimension.
Definition data_exporter.hpp:80
bool is_integer
Matrix data is integer type or floating point.
Definition data_exporter.hpp:82
std::vector< size_t > max_dims
Expected dataset max dimensions.
Definition data_exporter.hpp:78
bool compression
Matrix data has to be compressed or not.
Definition data_exporter.hpp:81
std::string name
Dataset name.
Definition data_exporter.hpp:76
A structure to hold user-defined control parameters for simulation settings.
Definition simulation_parameters.hpp:24
Definition execinfo.hpp:12