www.mooseframework.org
RestartableDataIO.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
20 class RestartableDataMap;
21 
28 {
29 public:
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 
65 protected:
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 };
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 unsigned int CURRENT_BACKUP_FILE_VERSION
The current version for the backup file.
Class for doing restart.
std::size_t dataSize() const
static const std::string & restartableHeaderFile()
Base class for MOOSE-based applications.
Definition: MooseApp.h:73
int COMPARE_HASH_CODE_TYPE
The type to used for comparing hash codes (sanity checking)
RestartableDataMap & currentData(const THREAD_ID tid)
Storage for restartable data that is ordered based on insertion order.
static const std::string & getRestartableExt()
Interface for objects interacting with the PerfGraph.
static std::filesystem::path restartableDataFolder(const std::filesystem::path &folder_base)
RestartableDataIO(MooseApp &app, RestartableDataMap &data)
unsigned int THREAD_ID
Definition: MooseTypes.h:198