www.mooseframework.org
Restartable.C
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 #include "InputParameters.h"
11 #include "Restartable.h"
12 #include "SubProblem.h"
13 #include "FEProblem.h"
14 #include "MooseObject.h"
15 #include "MooseApp.h"
16 
17 Restartable::Restartable(const MooseObject * moose_object, const std::string & system_name)
18  : Restartable(moose_object->getMooseApp(),
19  moose_object->name(),
20  system_name,
21  moose_object->parameters().isParamValid("_tid")
22  ? moose_object->parameters().get<THREAD_ID>("_tid")
23  : 0)
24 {
25 }
26 
28  const std::string & system_name,
29  THREAD_ID tid)
30  : Restartable(moose_object->getMooseApp(), moose_object->name(), system_name, tid)
31 {
32 }
33 
35  const std::string & name,
36  const std::string & system_name,
37  THREAD_ID tid)
38  : _restartable_app(moose_app),
39  _restartable_name(name),
40  _restartable_system_name(system_name),
41  _restartable_tid(tid)
42 {
43 }
44 
45 void
47  std::unique_ptr<RestartableDataValue> data,
48  THREAD_ID tid)
49 {
50  _restartable_app.registerRestartableData(name, std::move(data), tid);
51 }
52 
53 void
55 {
57 }
void registerRecoverableData(std::string name)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:889
A class for creating restricted objects.
Definition: Restartable.h:29
Base class for MOOSE-based applications.
Definition: MooseApp.h:59
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
void registerRestartableData(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Definition: MooseApp.C:1089
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46
MooseApp & _restartable_app
Reference to the application.
Definition: Restartable.h:189
unsigned int THREAD_ID
Definition: MooseTypes.h:161