OGS
HdfWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5#include <hdf5.h>
6
7#include <filesystem>
8#include <map>
9#include <memory>
10#include <vector>
11
12#include "HdfData.h"
13
14namespace MeshLib::IO
15{
16using HDFAttributes = std::vector<HdfData>;
23
24class HdfWriter final
25{
26public:
45 HdfWriter(std::vector<MeshHdfData> const& meshes,
46 unsigned long long initial_step,
47 double initial_time,
48 std::filesystem::path const& filepath,
49 bool use_compression,
50 bool is_file_manager,
51 unsigned int n_files,
52 bool static_file);
60 void writeStep(double time);
61 ~HdfWriter();
62
63private:
64 // internal data holder
65 struct HdfMesh;
66
71
72 std::filesystem::path const _hdf5_filepath;
73 hid_t const _file;
74 hid_t const _meshes_group;
75 std::vector<std::unique_ptr<HdfMesh>> _hdf_meshes;
76 std::vector<double> _step_times;
77 bool const _use_compression;
78 bool const _is_file_manager;
79 bool const _static_file;
80};
81} // namespace MeshLib::IO
bool const _use_compression
Definition HdfWriter.h:77
std::filesystem::path const _hdf5_filepath
Definition HdfWriter.h:72
std::vector< std::unique_ptr< HdfMesh > > _hdf_meshes
Definition HdfWriter.h:75
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, bool static_file)
Write file with geometry and topology data. The data itself is held by a structure outside of this cl...
bool const _is_file_manager
Definition HdfWriter.h:78
hid_t const _meshes_group
Definition HdfWriter.h:74
void writeStep(double time)
Writes attributes. The data itself is hold by a structure outside of this class. The writer assumes t...
bool const _static_file
Definition HdfWriter.h:79
std::vector< double > _step_times
Definition HdfWriter.h:76
std::vector< HdfData > HDFAttributes
Definition HdfWriter.h:16
HDFAttributes constant_attributes
Definition HdfWriter.h:19
HDFAttributes variable_attributes
Definition HdfWriter.h:20