www.mooseframework.org
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Resurrector Class Reference

Class for doing restart. More...

#include <Resurrector.h>

Public Member Functions

 Resurrector (FEProblemBase &fe_problem)
 
virtual ~Resurrector ()=default
 
void setRestartFile (const std::string &file_base)
 Set the file base name from which we will restart. More...
 
void setRestartSuffix (const std::string &file_ext)
 Set the file extension from which we will restart libMesh equation systems. More...
 
void restartFromFile ()
 Perform a restart from a file. More...
 
void restartRestartableData ()
 

Protected Attributes

FEProblemBase_fe_problem
 Reference to a FEProblemBase being restarted. More...
 
std::string _restart_file_base
 name of the file that we restart from More...
 
std::string _restart_file_suffix
 name of the file extension that we restart from More...
 
RestartableDataIO _restartable
 Restartable Data. More...
 

Static Protected Attributes

static const std::string MAT_PROP_EXT
 
static const std::string RESTARTABLE_DATA_EXT
 

Detailed Description

Class for doing restart.

It takes care of writing and reading the restart files.

Definition at line 32 of file Resurrector.h.

Constructor & Destructor Documentation

Resurrector::Resurrector ( FEProblemBase fe_problem)

Definition at line 28 of file Resurrector.C.

30 {
31 }
std::string _restart_file_suffix
name of the file extension that we restart from
Definition: Resurrector.h:66
FEProblemBase & _fe_problem
Reference to a FEProblemBase being restarted.
Definition: Resurrector.h:60
RestartableDataIO _restartable
Restartable Data.
Definition: Resurrector.h:69
virtual Resurrector::~Resurrector ( )
virtualdefault

Member Function Documentation

void Resurrector::restartFromFile ( )

Perform a restart from a file.

Definition at line 46 of file Resurrector.C.

47 {
48  Moose::perf_log.push("restartFromFile()", "Setup");
49  std::string file_name(_restart_file_base + '.' + _restart_file_suffix);
52  unsigned int read_flags = EquationSystems::READ_DATA;
54  read_flags |= EquationSystems::READ_ADDITIONAL_DATA;
55 
56  // Set libHilbert renumbering flag to false. We don't support
57  // N-to-M restarts regardless, and if we're *never* going to do
58  // N-to-M restarts then libHilbert is just unnecessary computation
59  // and communication.
60  const bool renumber = false;
61 
62  // DECODE or READ based on suffix.
63  // MOOSE doesn't currently use partition-agnostic renumbering, since
64  // it can break restarts when multiple nodes are at the same point
65  _fe_problem.es().read(file_name, read_flags, renumber);
66 
68  Moose::perf_log.pop("restartFromFile()", "Setup");
69 }
NonlinearSystemBase & getNonlinearSystemBase()
std::string _restart_file_suffix
name of the file extension that we restart from
Definition: Resurrector.h:66
bool skipAdditionalRestartData() const
Whether or not to skip loading the additional data when restarting.
virtual EquationSystems & es() override
virtual void update()
Update the system (doing libMesh magic)
Definition: SystemBase.C:665
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:121
PerfLog perf_log
Perflog to be used by applications.
void readRestartableDataHeader(std::string base_file_name)
Read restartable data header to verify that we are restarting on the correct number of processors and...
FEProblemBase & _fe_problem
Reference to a FEProblemBase being restarted.
Definition: Resurrector.h:60
static const std::string RESTARTABLE_DATA_EXT
Definition: Resurrector.h:72
RestartableDataIO _restartable
Restartable Data.
Definition: Resurrector.h:69
std::string _restart_file_base
name of the file that we restart from
Definition: Resurrector.h:63
void Resurrector::restartRestartableData ( )

Definition at line 72 of file Resurrector.C.

73 {
74  Moose::perf_log.push("restartRestartableData()", "Setup");
77  Moose::perf_log.pop("restartRestartableData()", "Setup");
78 }
std::set< std::string > & getRecoverableData()
Return a reference to the recoverable data object.
Definition: MooseApp.h:439
PerfLog perf_log
Perflog to be used by applications.
MooseApp & getMooseApp()
Get the MooseApp this object is associated with.
Definition: MooseObject.h:72
FEProblemBase & _fe_problem
Reference to a FEProblemBase being restarted.
Definition: Resurrector.h:60
const RestartableDatas & getRestartableData()
Return reference to the restatable data object.
Definition: MooseApp.h:433
void readRestartableData(const RestartableDatas &restartable_datas, const std::set< std::string > &_recoverable_data)
Read the restartable data.
RestartableDataIO _restartable
Restartable Data.
Definition: Resurrector.h:69
void Resurrector::setRestartFile ( const std::string &  file_base)

Set the file base name from which we will restart.

Parameters
file_baseThe file base name of a restart file

Definition at line 34 of file Resurrector.C.

35 {
36  _restart_file_base = file_base;
37 }
std::string _restart_file_base
name of the file that we restart from
Definition: Resurrector.h:63
void Resurrector::setRestartSuffix ( const std::string &  file_ext)

Set the file extension from which we will restart libMesh equation systems.

The default suffix is "xdr".

Parameters
file_extThe file extension of a restart file

Definition at line 40 of file Resurrector.C.

41 {
42  _restart_file_suffix = file_ext;
43 }
std::string _restart_file_suffix
name of the file extension that we restart from
Definition: Resurrector.h:66

Member Data Documentation

FEProblemBase& Resurrector::_fe_problem
protected

Reference to a FEProblemBase being restarted.

Definition at line 60 of file Resurrector.h.

Referenced by restartFromFile(), and restartRestartableData().

std::string Resurrector::_restart_file_base
protected

name of the file that we restart from

Definition at line 63 of file Resurrector.h.

Referenced by restartFromFile(), and setRestartFile().

std::string Resurrector::_restart_file_suffix
protected

name of the file extension that we restart from

Definition at line 66 of file Resurrector.h.

Referenced by restartFromFile(), and setRestartSuffix().

RestartableDataIO Resurrector::_restartable
protected

Restartable Data.

Definition at line 69 of file Resurrector.h.

Referenced by restartFromFile(), and restartRestartableData().

const std::string Resurrector::MAT_PROP_EXT
staticprotected

Definition at line 71 of file Resurrector.h.

const std::string Resurrector::RESTARTABLE_DATA_EXT
staticprotected

Definition at line 72 of file Resurrector.h.

Referenced by restartFromFile().


The documentation for this class was generated from the following files: