https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Executor.C
Go to the documentation of this file.
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#include "Executor.h"
11#include "MooseApp.h"
12#include "FEProblem.h"
13
14#include "ExecFlagRegistry.h"
15
18{
20
21 params.addParam<ExecFlagType>(
22 "begin_exec_flag", EXEC_NONE, "exec flag associated with the beginning of this executor");
23 params.addParam<ExecFlagType>(
24 "end_exec_flag", EXEC_NONE, "exec flag associated with the end of this executor");
25 params.registerBase("Executor");
26 return params;
27}
28
30 : Executioner(parameters, false),
32 _begin_flag(getParam<ExecFlagType>("begin_exec_flag")),
33 _end_flag(getParam<ExecFlagType>("end_exec_flag"))
34{
35 if (!parameters.isParamSetByUser("begin_exec_flag"))
36 _begin_flag = registerExecFlag("exec_" + _name + "_begin");
37 if (!parameters.isParamSetByUser("end_exec_flag"))
38 _end_flag = registerExecFlag("exec_" + _name + "_end");
39}
40
43{
45 auto result = run();
47
48 _result = result;
49 return result;
50}
const ExecFlagType EXEC_NONE
Definition Moose.C:29
Executioners are objects that do the actual work of solving your problem.
Definition Executioner.h:37
static InputParameters validParams()
Definition Executioner.C:26
FEProblemBase & _fe_problem
Interface class for classes which interact with Postprocessors.
Result _result
Stores the result representing the outcome from the run function.
Definition Executor.h:174
static InputParameters validParams()
Definition Executor.C:17
ExecFlagType _end_flag
The execute-on flag to associate with the end of this executor's execution.
Definition Executor.h:169
ExecFlagType _begin_flag
The execute-on flag to associate with the beginning of this executor's execution.
Definition Executor.h:165
Result exec()
This is the main function for executors - this is how executors should invoke child/sub executors - b...
Definition Executor.C:42
virtual Result run()=0
This function contains the primary execution implementation for a executor.
Executor(const InputParameters &parameters)
Definition Executor.C:29
virtual void executeAllObjects(const ExecFlagType &exec_type)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & _name
The name of this class.
Definition MooseBase.h:381
Class for containing MooseEnum item information.
This object tracks the success/failure state of the executor system as execution proceeds in a simula...
Definition Executor.h:36