Line data Source code
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 : 16 : InputParameters 17 6274 : Executor::validParams() 18 : { 19 6274 : InputParameters params = Executioner::validParams(); 20 : 21 25096 : params.addParam<ExecFlagType>( 22 : "begin_exec_flag", EXEC_NONE, "exec flag associated with the beginning of this executor"); 23 25096 : params.addParam<ExecFlagType>( 24 : "end_exec_flag", EXEC_NONE, "exec flag associated with the end of this executor"); 25 6274 : params.registerBase("Executor"); 26 6274 : return params; 27 0 : } 28 : 29 75 : Executor::Executor(const InputParameters & parameters) 30 : : Executioner(parameters, false), 31 : ExecutorInterface(this), 32 75 : _begin_flag(getParam<ExecFlagType>("begin_exec_flag")), 33 300 : _end_flag(getParam<ExecFlagType>("end_exec_flag")) 34 : { 35 150 : if (!parameters.isParamSetByUser("begin_exec_flag")) 36 75 : _begin_flag = registerExecFlag("exec_" + _name + "_begin"); 37 150 : if (!parameters.isParamSetByUser("end_exec_flag")) 38 75 : _end_flag = registerExecFlag("exec_" + _name + "_end"); 39 75 : } 40 : 41 : Executor::Result 42 36 : Executor::exec() 43 : { 44 36 : _fe_problem.executeAllObjects(_begin_flag); 45 36 : auto result = run(); 46 36 : _fe_problem.executeAllObjects(_end_flag); 47 : 48 36 : _result = result; 49 36 : return result; 50 0 : }