Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
pvd_handler.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2019-2020, 2022, 2024 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_pvd_handler_h
5#define lethe_pvd_handler_h
6
7#include <core/parameters.h>
8
9using namespace dealii;
10
11/**
12 * @brief The PVDHandler class manages the storage of the information required to write pvd file.
13 * It is particularly necessary for simulations which must be restarted from
14 * checkpoint since it manages the continuity of the pvd output.
15 */
17{
18public:
19 /**
20 * @brief save Saves the content of the pvd times_and_names to a file
21 *
22 * @param filename Name of the file to which the PVDHandler content is save
23 */
24 void
25 save(const std::string &filename) const;
26
27 /**
28 * @brief read Reads the content of a pvd times_and_names checpoint
29 *
30 * @param filename Name of the file frin which the PVDHandler content is read
31 */
32 void
33 read(const std::string &filename);
34
35 void
36 append(double time, const std::string &pvtu_filename)
37 {
38 times_and_names.emplace_back(time, pvtu_filename);
39 }
40
41 // The name of the pvtu files and the time associated with each file
42 // is stored in a simple vector of pairs.
43 std::vector<std::pair<double, std::string>> times_and_names;
44};
45
46#endif
The PVDHandler class manages the storage of the information required to write pvd file....
Definition pvd_handler.h:17
void read(const std::string &filename)
read Reads the content of a pvd times_and_names checpoint
std::vector< std::pair< double, std::string > > times_and_names
Definition pvd_handler.h:43
void append(double time, const std::string &pvtu_filename)
Definition pvd_handler.h:36
void save(const std::string &filename) const
save Saves the content of the pvd times_and_names to a file