OGS
XdmfHdfWriter.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
6#include <set>
7
8#include "HdfWriter.h"
9#include "MeshLib/Mesh.h"
10#include "XdmfWriter.h"
11
12namespace MeshLib::IO
13{
14class XdmfHdfWriter final
15{
16public:
17 // clang-format off
60 // clang-format on
62 std::vector<std::reference_wrapper<const MeshLib::Mesh>> const& meshes,
63 std::filesystem::path const& filepath, unsigned long long time_step,
64 double initial_time, std::set<std::string> const& output_variable_names,
65 std::set<std::string> const& static_attribute_names,
66 bool use_compression, unsigned int n_files,
67 unsigned int chunk_size_bytes, bool store_static_data_separately);
68
73 void writeStep(double time);
74
75private:
76 std::unique_ptr<HdfWriter> _static_hdf_writer;
77 // hdf_writer must be destructed before xdmf_writer
78 std::unique_ptr<HdfWriter> _hdf_writer;
79 std::vector<std::unique_ptr<XdmfWriter>> _xdmf_writer;
80};
81} // namespace MeshLib::IO
XdmfHdfWriter(std::vector< std::reference_wrapper< const MeshLib::Mesh > > const &meshes, std::filesystem::path const &filepath, unsigned long long time_step, double initial_time, std::set< std::string > const &output_variable_names, std::set< std::string > const &static_attribute_names, bool use_compression, unsigned int n_files, unsigned int chunk_size_bytes, bool store_static_data_separately)
Write xdmf and h5 file with geometry and topology data.
std::unique_ptr< HdfWriter > _hdf_writer
std::vector< std::unique_ptr< XdmfWriter > > _xdmf_writer
std::unique_ptr< HdfWriter > _static_hdf_writer
void writeStep(double time)
Adds data for either lazy (xdmf) or eager (hdf) writing algorithm.