www.mooseframework.org
SetupRecoverFileBaseAction.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 // MOOSE includes
12 #include "MooseApp.h"
13 #include "OutputWarehouse.h"
14 #include "Checkpoint.h"
15 #include "MooseObjectAction.h"
16 #include "RestartableDataReader.h"
17 
18 registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "setup_recover_file_base");
19 registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "recover_meta_data");
20 
23 {
25  return params;
26 }
27 
29  : Action(params)
30 {
31 }
32 
33 void
35 {
36  // Even during a normal run, we still need to check integrity of the data store to make
37  // sure that all requested properties have been declared.
38  if (_current_task == "recover_meta_data")
40 
41  // Do nothing if the App is not recovering
42  // Don't look for a checkpoint file unless we're the ultimate master app
44  return;
45 
46  if (_current_task == "setup_recover_file_base")
47  {
50 
51  // Set the recover file base in the App
52  mooseInfo("Using ", _app.getRestartRecoverFileBase(), " for recovery.");
53  }
54  else // recover_meta_data
55  {
56  // Make sure that all of the mesh meta-data attributes have been declared (after the mesh
57  // generators have run.
59  }
60 }
static const std::string & checkpointSuffix()
The file suffix for the checkpoint mesh.
Definition: MooseApp.C:2396
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:823
void mooseInfo(Args &&... args) const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void checkMetaDataIntegrity() const
Function to check the integrity of the restartable meta data structure.
Definition: MooseApp.C:2741
std::string convertLatestCheckpoint(std::string orig)
Replaces "LATEST" placeholders with the latest checkpoint file name.
Definition: MooseUtils.C:146
Base class for actions.
Definition: Action.h:38
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
Definition: MooseApp.h:510
static InputParameters validParams()
Definition: Action.C:23
static InputParameters validParams()
Class constructor.
const std::string & _current_task
The current action (even though we have separate instances for each action)
Definition: Action.h:145
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:69
SetupRecoverFileBaseAction(const InputParameters &params)
void loadRestartableMetaData(const std::filesystem::path &folder_base)
Loads all available restartable meta data if it is available with the folder base folder_base...
Definition: MooseApp.C:1902
registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "setup_recover_file_base")
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:1167
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
Definition: MooseApp.h:498