forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Executioner.h
143 lines (116 loc) · 3.8 KB
/
Executioner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "MooseObject.h"
#include "UserObjectInterface.h"
#include "PostprocessorInterface.h"
#include "Restartable.h"
#include "PerfGraphInterface.h"
#include "FEProblemSolve.h"
#include "PicardSolve.h"
// System includes
#include <string>
class Problem;
class Executioner;
template <>
InputParameters validParams<Executioner>();
/**
* Executioners are objects that do the actual work of solving your problem.
*/
class Executioner : public MooseObject,
public UserObjectInterface,
public PostprocessorInterface,
public Restartable,
public PerfGraphInterface
{
public:
/**
* Constructor
*
* @param parameters The parameters object holding data for the class to use.
*/
Executioner(const InputParameters & parameters);
virtual ~Executioner() {}
/**
* Initialize the executioner
*/
virtual void init() {}
/**
* Pure virtual execute function MUST be overridden by children classes.
* This is where the Executioner actually does it's work.
*/
virtual void execute() = 0;
/**
* Override this for actions that should take place before execution
*/
virtual void preExecute() {}
/**
* Override this for actions that should take place after execution
*/
virtual void postExecute() {}
/**
* Override this for actions that should take place before execution, called by PicardSolve
*/
virtual void preSolve() {}
/**
* Override this for actions that should take place after execution, called by PicardSolve
*/
virtual void postSolve() {}
/**
* Deprecated:
* Return a reference to this Executioner's Problem instance
*/
virtual Problem & problem();
/**
* Return a reference to this Executioner's FEProblemBase instance
*/
FEProblemBase & feProblem();
/** The name of the TimeStepper
* This is an empty string for non-Transient executioners
* @return A string of giving the TimeStepper name
*/
virtual std::string getTimeStepperName() { return std::string(); }
/**
* Can be used by subsclasses to call parentOutputPositionChanged()
* on the underlying FEProblemBase.
*/
virtual void parentOutputPositionChanged() {}
/**
* Whether or not the last solve converged.
*/
virtual bool lastSolveConverged() const = 0;
/// Return the underlining FEProblemSolve object.
FEProblemSolve & feProblemSolve() { return _feproblem_solve; }
/// Return underlining PicardSolve object.
PicardSolve & picardSolve() { return _picard_solve; }
/// Augmented Picard convergence check that to be called by PicardSolve and can be overridden by derived executioners
virtual bool augmentedPicardConvergenceCheck() const { return false; }
/**
* Get the verbose output flag
* @return The verbose output flag
*/
const bool & verbose() const { return _verbose; }
protected:
/**
* Adds a postprocessor to report a Real class attribute
* @param name The name of the postprocessor to create
* @param attribute The Real class attribute to report
* @param execute_on When to execute the postprocessor that is created
*/
virtual void addAttributeReporter(const std::string & name,
Real & attribute,
const std::string execute_on = "");
FEProblemBase & _fe_problem;
FEProblemSolve _feproblem_solve;
PicardSolve _picard_solve;
// Restart
std::string _restart_file_base;
/// True if printing out additional information
const bool & _verbose;
};