OGS
XdmfWriter.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 <functional>
7#include <string>
8#include <vector>
9
10namespace MeshLib::IO
11{
12class XdmfWriter final
13{
14public:
20 XdmfWriter(std::string xdmf_filename,
21 std::function<std::string(std::vector<double>)>
22 xdmf_writer_fn);
23 XdmfWriter(XdmfWriter&&) = default;
25 XdmfWriter(XdmfWriter const&) = delete;
26 XdmfWriter& operator=(XdmfWriter const&) = delete;
28
33 void addTimeStep(double const& time_step);
34
35private:
36 std::string filename;
37 std::vector<double> times;
38 std::function<std::string(std::vector<double>)> xdmf_writer;
39};
40} // namespace MeshLib::IO
std::function< std::string(std::vector< double >)> xdmf_writer
Definition XdmfWriter.h:38
std::vector< double > times
Definition XdmfWriter.h:37
XdmfWriter(std::string xdmf_filename, std::function< std::string(std::vector< double >)> xdmf_writer_fn)
Writes xdmf string into file on class destruction.
XdmfWriter(XdmfWriter const &)=delete
XdmfWriter(XdmfWriter &&)=default
void addTimeStep(double const &time_step)
Adds data for lazy (xdmf) writing algorithm.
XdmfWriter & operator=(XdmfWriter &&)=default
XdmfWriter & operator=(XdmfWriter const &)=delete