include/meltpooldg/utilities/restart.hpp Source File

Developer Documentation: include/meltpooldg/utilities/restart.hpp Source File
Developer Documentation
restart.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <chrono>
8#include <filesystem>
9#include <functional>
10#include <string>
11#include <vector>
12
13
15{
16 template <typename number>
18 {
19 public:
22
23 bool
24 do_load() const;
25
26 bool
27 do_save() const;
28
32 void
34
35 private:
37 std::filesystem::path dir;
38 std::filesystem::path prefix;
40 mutable number last_written_time = 0.0;
41 std::chrono::time_point<std::chrono::system_clock> real_time_start;
42 std::vector<std::string> suffices = {"_tria",
43 "_tria.info",
44 "_tria_fixed.data",
45 "_tria_variable.data",
46 "_problem.restart"};
47
48 number
50 };
51
52 /***************************************************************************************
53 * internal functions
54 ***************************************************************************************/
55
56 template <int dim, typename VectorType>
57 void
59 const std::string &prefix);
60
75 template <int dim, typename VectorType>
76 void
78 const std::function<void()> &post,
79 const std::function<void()> &setup_dof_system,
80 const std::string &prefix);
81
82} // namespace MeltPoolDG::Restart
Definition restart.hpp:18
const RestartData< number > & data
Definition restart.hpp:36
std::filesystem::path prefix
Definition restart.hpp:38
number last_written_time
Definition restart.hpp:40
std::vector< std::string > suffices
Definition restart.hpp:42
void prepare_save()
Definition restart.cpp:61
bool do_load() const
Definition restart.cpp:37
std::chrono::time_point< std::chrono::system_clock > real_time_start
Definition restart.hpp:41
bool do_save() const
Definition restart.cpp:44
number compute_current_time() const
Definition restart.cpp:102
const TimeIntegration::TimeIterator< number > & time
Definition restart.hpp:39
std::filesystem::path dir
Definition restart.hpp:37
Definition time_iterator.hpp:15
Definition restart.hpp:15
void serialize_internal(const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors, const std::string &prefix)
Definition restart.cpp:115
void deserialize_internal(const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors, const std::function< void()> &post, const std::function< void()> &setup_dof_system, const std::string &prefix)
Definition restart.cpp:155
std::function< void(DoFHandlerAndVectorDataType< dim, VectorType > &)> AttachDoFHandlerAndVectorsType
Definition attach_vectors.hpp:21
Definition restart_data.hpp:15