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:
50 HdfWriter(std::vector<MeshHdfData> const& meshes,
51 unsigned long long initial_step,
52 double initial_time,
53 std::filesystem::path const& filepath,
54 bool use_compression,
55 bool is_file_manager,
56 unsigned int n_files);
64 void writeStep(double time);
65 ~HdfWriter();
66
67private:
68 // internal data holder
69 struct HdfMesh;
70
71 std::filesystem::path const _hdf5_filepath;
72 hid_t const _file;
73 hid_t const _meshes_group;
74 std::vector<std::unique_ptr<HdfMesh>> _hdf_meshes;
75 std::vector<double> _step_times;
76 bool const _use_compression;
77 bool const _is_file_manager;
78};
79} // namespace MeshLib::IO
Collects and holds all metadata for writing HDF5 file.
bool const _use_compression
Definition HdfWriter.h:76
std::filesystem::path const _hdf5_filepath
Definition HdfWriter.h:71
std::vector< std::unique_ptr< HdfMesh > > _hdf_meshes
Definition HdfWriter.h:74
bool const _is_file_manager
Definition HdfWriter.h:77
hid_t const _meshes_group
Definition HdfWriter.h:73
void writeStep(double time)
Writes attributes. The data itself is hold by a structure outside of this class. The writer assumes t...
HdfWriter(std::vector< MeshHdfData > const &meshes, unsigned long long initial_step, double initial_time, 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::vector< double > _step_times
Definition HdfWriter.h:75
std::vector< HdfData > HDFAttributes
Definition HdfWriter.h:25
HDFAttributes constant_attributes
Definition HdfWriter.h:28
HDFAttributes variable_attributes
Definition HdfWriter.h:29