https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RestartableDataIO.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "PerfGraphInterface.h"
13
14#include "libmesh/parallel_object.h"
15
16#include <vector>
17#include <variant>
18#include <filesystem>
19
21
28{
29public:
31 RestartableDataIO(MooseApp & app, std::vector<RestartableDataMap> & data);
32
36 static const std::string & getRestartableExt();
40 static const std::string & restartableDataFile();
44 static const std::string & restartableHeaderFile();
45
51 static std::filesystem::path restartableDataFolder(const std::filesystem::path & folder_base);
57 static std::filesystem::path restartableDataFile(const std::filesystem::path & folder_base);
63 static std::filesystem::path restartableHeaderFile(const std::filesystem::path & folder_base);
64
65protected:
75 std::size_t dataSize() const;
76
79 const std::variant<RestartableDataMap *, std::vector<RestartableDataMap> *> _data;
80
82 static const unsigned int CURRENT_BACKUP_FILE_VERSION;
85};
unsigned int THREAD_ID
Definition MooseTypes.h:237
Base class for MOOSE-based applications.
Definition MooseApp.h:110
Interface for objects interacting with the PerfGraph.
Class for doing restart.
static const std::string & restartableDataFile()
const std::variant< RestartableDataMap *, std::vector< RestartableDataMap > * > _data
The data we wish to act on This is a variant so that we can act on threaded and non-threaded data.
static const std::string & restartableHeaderFile()
RestartableDataMap & currentData(const THREAD_ID tid)
static const std::string & getRestartableExt()
static const unsigned int CURRENT_BACKUP_FILE_VERSION
The current version for the backup file.
static std::filesystem::path restartableDataFolder(const std::filesystem::path &folder_base)
int COMPARE_HASH_CODE_TYPE
The type to used for comparing hash codes (sanity checking)
std::size_t dataSize() const
Storage for restartable data that is ordered based on insertion order.