www.mooseframework.org
Checkpoint.h
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 #pragma once
11 
12 // MOOSE includes
13 #include "FileOutput.h"
14 #include "RestartableDataIO.h"
15 
16 #include <deque>
17 
18 // Forward declarations
19 class Checkpoint;
21 
22 template <>
24 
29 {
31  std::string checkpoint;
32 
34  std::string system;
35 
37  std::string restart;
38 };
39 
43 class Checkpoint : public FileOutput
44 {
45 public:
51 
55  virtual std::string filename() override;
56 
61  std::string directory();
62 
63 protected:
68  virtual void output(const ExecFlagType & type) override;
69 
70 private:
72 
74  unsigned int _num_files;
75 
77  const std::string _suffix;
78 
80  bool _binary;
81 
84 
87 
89  std::set<std::string> & _recoverable_data;
90 
93 
96 
99 
101  std::deque<CheckpointFileNames> _file_names;
102 };
103 
Checkpoint(const InputParameters &parameters)
Class constructor.
Definition: Checkpoint.C:47
std::vector< std::map< std::string, std::unique_ptr< RestartableDataValue > >> RestartableDatas
Container for storing material properties.
A structure for storing the various output files associated with checkpoint output.
Definition: Checkpoint.h:28
Class for doing restart.
RestartableDataIO _restartable_data_io
RestrableData input/output interface.
Definition: Checkpoint.h:98
Stores the stateful material properties computed by materials.
virtual void output(const ExecFlagType &type) override
Outputs a checkpoint file.
Definition: Checkpoint.C:78
std::string checkpoint
Filename for CheckpointIO file.
Definition: Checkpoint.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void updateCheckpointFiles(CheckpointFileNames file_struct)
Definition: Checkpoint.C:129
const std::string _suffix
Directory suffix.
Definition: Checkpoint.h:77
std::string system
Filename for EquationsSystems::write.
Definition: Checkpoint.h:34
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
virtual std::string filename() override
Returns the base filename for the checkpoint files.
Definition: Checkpoint.C:62
const MaterialPropertyStorage & _material_property_storage
Reference to the material property storage.
Definition: Checkpoint.h:92
InputParameters validParams< Checkpoint >()
Definition: Checkpoint.C:28
const MaterialPropertyStorage & _bnd_material_property_storage
Reference to the boundary material property storage.
Definition: Checkpoint.h:95
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
bool _parallel_mesh
True if running with parallel mesh.
Definition: Checkpoint.h:83
std::string restart
Filename for restartable data filename.
Definition: Checkpoint.h:37
bool _binary
True if outputing checkpoint files in binary format.
Definition: Checkpoint.h:80
std::set< std::string > & _recoverable_data
Reference to the recoverable data.
Definition: Checkpoint.h:89
std::string directory()
Retrieve the checkpoint output directory.
Definition: Checkpoint.C:72
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
const RestartableDatas & _restartable_data
Reference to the restartable data.
Definition: Checkpoint.h:86
std::deque< CheckpointFileNames > _file_names
Vector of checkpoint filename structures.
Definition: Checkpoint.h:101
An outputter with filename support.
Definition: FileOutput.h:26
unsigned int _num_files
Max no. of output files to store.
Definition: Checkpoint.h:74