OGS
HdfWriter.h
Go to the documentation of this file.
1
13#pragma once
14#include <hdf5.h>
15
16#include <filesystem>
17#include <map>
18#include <memory>
19#include <vector>
20
21#include "HdfData.h"
22
23namespace MeshLib::IO
24{
25using HDFAttributes = std::vector<HdfData>;
32
33class HdfWriter final
34{
35public:
48 HdfWriter(std::vector<MeshHdfData> const& meshes,
49 unsigned long long initial_step,
50 std::filesystem::path const& filepath,
51 bool use_compression,
52 bool is_file_manager,
53 unsigned int n_files);
61 void writeStep(double time);
62 ~HdfWriter();
63
64private:
65 // internal data holder
66 struct HdfMesh;
67
68 std::filesystem::path const _hdf5_filepath;
69 hid_t const _file;
70 hid_t const _meshes_group;
71 std::vector<std::unique_ptr<HdfMesh>> _hdf_meshes;
72 std::vector<double> _step_times;
73 bool const _use_compression;
74 bool const _is_file_manager;
75};
76} // namespace MeshLib::IO
Collects and holds all metadata for writing HDF5 file.
bool const _use_compression
Definition HdfWriter.h:73
HdfWriter(std::vector< MeshHdfData > const &meshes, unsigned long long initial_step, std::filesystem::path const &filepath, bool use_compression, bool is_file_manager, unsigned int n_files)
Write file with geometry and topology data. The data itself is held by a structure outside of this cl...
std::filesystem::path const _hdf5_filepath
Definition HdfWriter.h:68
std::vector< std::unique_ptr< HdfMesh > > _hdf_meshes
Definition HdfWriter.h:71
bool const _is_file_manager
Definition HdfWriter.h:74
hid_t const _meshes_group
Definition HdfWriter.h:70
void writeStep(double time)
Writes attributes. The data itself is hold by a structure outside of this class. The writer assumes t...
std::vector< double > _step_times
Definition HdfWriter.h:72
std::vector< HdfData > HDFAttributes
Definition HdfWriter.h:25
HDFAttributes constant_attributes
Definition HdfWriter.h:28
HDFAttributes variable_attributes
Definition HdfWriter.h:29