www.mooseframework.org
Executioner.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 #include "MooseObject.h"
13 #include "UserObjectInterface.h"
14 #include "PostprocessorInterface.h"
15 #include "Restartable.h"
16 #include "PerfGraphInterface.h"
17 #include "FEProblemSolve.h"
18 #include "PicardSolve.h"
19 
20 // System includes
21 #include <string>
22 
23 class Problem;
24 class Executioner;
25 
26 template <>
28 
32 class Executioner : public MooseObject,
33  public UserObjectInterface,
35  public Restartable,
36  public PerfGraphInterface
37 {
38 public:
45 
46  virtual ~Executioner() {}
47 
49 
53  virtual void init() {}
54 
59  virtual void execute() = 0;
60 
64  virtual void preExecute() {}
65 
69  virtual void postExecute() {}
70 
74  virtual void preSolve() {}
75 
79  virtual void postSolve() {}
80 
85  virtual Problem & problem();
86 
91 
96  virtual std::string getTimeStepperName() { return std::string(); }
97 
102  virtual void parentOutputPositionChanged() {}
103 
107  virtual bool lastSolveConverged() const = 0;
108 
111 
114 
116  virtual bool augmentedPicardConvergenceCheck() const { return false; }
117 
122  const bool & verbose() const { return _verbose; }
123 
127  unsigned int numGridSteps() const { return _num_grid_steps; }
128 
129 protected:
136  virtual PostprocessorValue & addAttributeReporter(const std::string & name,
137  Real initial_value = 0);
138 
140 
143 
144  // Restart
145  std::string _restart_file_base;
146 
148  const bool & _verbose;
149 
156  const unsigned int _num_grid_steps;
157 };
Executioner::init
virtual void init()
Initialize the executioner.
Definition: Executioner.h:53
Executioner::getTimeStepperName
virtual std::string getTimeStepperName()
The name of the TimeStepper This is an empty string for non-Transient executioners.
Definition: Executioner.h:96
Executioner::Executioner
Executioner(const InputParameters &parameters)
Constructor.
Definition: Executioner.C:45
Executioner::preExecute
virtual void preExecute()
Override this for actions that should take place before execution.
Definition: Executioner.h:64
Executioner::augmentedPicardConvergenceCheck
virtual bool augmentedPicardConvergenceCheck() const
Augmented Picard convergence check that to be called by PicardSolve and can be overridden by derived ...
Definition: Executioner.h:116
Executioner::parentOutputPositionChanged
virtual void parentOutputPositionChanged()
Can be used by subsclasses to call parentOutputPositionChanged() on the underlying FEProblemBase.
Definition: Executioner.h:102
PerfGraphInterface.h
UserObjectInterface.h
Executioner::numGridSteps
unsigned int numGridSteps() const
Get the number of grid sequencing steps.
Definition: Executioner.h:127
Executioner::verbose
const bool & verbose() const
Get the verbose output flag.
Definition: Executioner.h:122
PicardSolve.h
Executioner::_restart_file_base
std::string _restart_file_base
Definition: Executioner.h:145
MooseObject::parameters
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:76
Executioner
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:32
UserObjectInterface
Interface for objects that need to use UserObjects.
Definition: UserObjectInterface.h:28
Executioner::feProblem
FEProblemBase & feProblem()
Return a reference to this Executioner's FEProblemBase instance.
Definition: Executioner.C:102
Executioner::validParams
static InputParameters validParams()
Definition: Executioner.C:26
Executioner::preSolve
virtual void preSolve()
Override this for actions that should take place before execution, called by PicardSolve.
Definition: Executioner.h:74
Executioner::_feproblem_solve
FEProblemSolve _feproblem_solve
Definition: Executioner.h:141
Executioner::execute
virtual void execute()=0
Pure virtual execute function MUST be overridden by children classes.
Executioner::_verbose
const bool & _verbose
True if printing out additional information.
Definition: Executioner.h:148
Executioner::feProblemSolve
FEProblemSolve & feProblemSolve()
Return the underlining FEProblemSolve object.
Definition: Executioner.h:110
MooseObject
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:50
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition: InputParameters.h:53
PostprocessorValue
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:189
PostprocessorInterface
Interface class for classes which interact with Postprocessors.
Definition: PostprocessorInterface.h:34
PicardSolve
Definition: PicardSolve.h:22
Executioner::problem
virtual Problem & problem()
Deprecated: Return a reference to this Executioner's Problem instance.
Definition: Executioner.C:95
Problem
Class that hold the whole problem being solved.
Definition: Problem.h:24
Restartable
A class for creating restricted objects.
Definition: Restartable.h:29
Executioner::_picard_solve
PicardSolve _picard_solve
Definition: Executioner.h:142
Executioner::postExecute
virtual void postExecute()
Override this for actions that should take place after execution.
Definition: Executioner.h:69
MooseObject.h
Executioner::_num_grid_steps
const unsigned int _num_grid_steps
The number of steps to perform in a grid sequencing algorithm.
Definition: Executioner.h:156
Restartable.h
Executioner::~Executioner
virtual ~Executioner()
Definition: Executioner.h:46
FEProblemSolve
Definition: FEProblemSolve.h:19
Executioner::postSolve
virtual void postSolve()
Override this for actions that should take place after execution, called by PicardSolve.
Definition: Executioner.h:79
PerfGraphInterface
Interface for objects that needs transient capabilities.
Definition: PerfGraphInterface.h:31
Executioner::lastSolveConverged
virtual bool lastSolveConverged() const =0
Whether or not the last solve converged.
Executioner::_fe_problem
FEProblemBase & _fe_problem
Definition: Executioner.h:139
FEProblemSolve.h
PostprocessorInterface.h
Executioner::addAttributeReporter
virtual PostprocessorValue & addAttributeReporter(const std::string &name, Real initial_value=0)
Adds a postprocessor that the executioner can directly assign values to.
Definition: Executioner.C:108
FEProblemBase
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition: FEProblemBase.h:139
validParams< Executioner >
InputParameters validParams< Executioner >()
Executioner::picardSolve
PicardSolve & picardSolve()
Return underlining PicardSolve object.
Definition: Executioner.h:113
MooseObject::name
virtual const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:70