https://mooseframework.inl.gov
ExecutorInterface.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 "ExecutorInterface.h"
11 
12 #include "FEProblem.h"
13 #include "MooseObject.h"
14 #include "NullExecutor.h"
15 #include "Executor.h"
16 #include "MooseApp.h"
17 
20 {
21  return emptyInputParameters();
22 }
23 
25  : _ei_moose_object(moose_object), _ei_app(moose_object->getMooseApp())
26 {
27 }
28 
29 Executor &
30 ExecutorInterface::getExecutor(const std::string & param_name) const
31 {
32  auto & params = _ei_moose_object->parameters();
33 
34  if (!params.isParamValid(param_name))
35  return *_ei_app.getNullExecutor();
36 
37  return _ei_app.getExecutor(_ei_moose_object->getParam<ExecutorName>(param_name));
38 }
39 
40 Executor &
41 ExecutorInterface::getExecutorByName(const ExecutorName & executor_name) const
42 {
43  return _ei_app.getExecutor(executor_name);
44 }
Executor & getExecutorByName(const ExecutorName &executor_name) const
Get an Executor based on its actual name.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const MooseObject * _ei_moose_object
InputParameters emptyInputParameters()
Executor & getExecutor(const std::string &param_name) const
Get an Executor based on a parameter name.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
static InputParameters validParams()
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
NullExecutor * getNullExecutor() const
Definition: MooseApp.h:362
ExecutorInterface(const MooseObject *moose_object)
const InputParameters & parameters() const
Get the parameters of the object.
Executor * getExecutor() const
Definition: MooseApp.h:361
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26