Line data Source code
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 11 : #include "SetupRecoverFileBaseAction.h" 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 : 21 : InputParameters 22 61934 : SetupRecoverFileBaseAction::validParams() 23 : { 24 61934 : InputParameters params = Action::validParams(); 25 61934 : return params; 26 : } 27 : 28 61934 : SetupRecoverFileBaseAction::SetupRecoverFileBaseAction(const InputParameters & params) 29 61934 : : Action(params) 30 : { 31 61934 : } 32 : 33 : void 34 122893 : SetupRecoverFileBaseAction::act() 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 122893 : if (_current_task == "recover_meta_data") 39 60983 : _app.checkMetaDataIntegrity(); 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 43 122893 : if (!_app.isRecovering() || !_app.isUltimateMaster()) 44 117029 : return; 45 : 46 5864 : if (_current_task == "setup_recover_file_base") 47 : { 48 2936 : _app.setRestartRecoverFileBase( 49 5864 : MooseUtils::convertLatestCheckpoint(_app.getRestartRecoverFileBase())); 50 : 51 : // Set the recover file base in the App 52 2928 : 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. 58 2928 : _app.loadRestartableMetaData(_app.getRestartRecoverFileBase() + _app.checkpointSuffix()); 59 : } 60 : }