https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SetupRecoverFileBaseAction.C
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// MOOSE includes
12#include "MooseApp.h"
13#include "OutputWarehouse.h"
14#include "Checkpoint.h"
15#include "MooseObjectAction.h"
17
18registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "setup_recover_file_base");
19registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "recover_meta_data");
20
27
32
33void
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}
registerMooseAction("MooseApp", SetupRecoverFileBaseAction, "setup_recover_file_base")
Base class for actions.
Definition Action.h:38
static InputParameters validParams()
Definition Action.C:26
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
const std::string & _current_task
The current action (even though we have separate instances for each action)
Definition Action.h:172
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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:2545
static const std::string & checkpointSuffix()
The file suffix for the checkpoint mesh.
Definition MooseApp.C:3039
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
Definition MooseApp.h:512
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition MooseApp.h:866
void checkMetaDataIntegrity() const
Function to check the integrity of the restartable meta data structure.
Definition MooseApp.C:3395
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
Definition MooseApp.h:500
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition MooseApp.C:1669
void mooseInfo(Args &&... args) const
Definition MooseBase.h:334
SetupRecoverFileBaseAction(const InputParameters &params)
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static InputParameters validParams()
std::string convertLatestCheckpoint(std::string orig)
Definition MooseUtils.C:168