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 : #pragma once 11 : 12 : #include "MooseTypes.h" 13 : #include "ExecFlagEnum.h" 14 : #include "MooseEnum.h" 15 : #include "InputParameters.h" 16 : 17 : // Forward declarations 18 : class InputParameters; 19 : class MooseObject; 20 : template <typename T> 21 : InputParameters validParams(); 22 : 23 : class SetupInterface 24 : { 25 : public: 26 : SetupInterface(const MooseObject * moose_object); 27 : virtual ~SetupInterface(); 28 : 29 : static InputParameters validParams(); 30 : 31 : /** 32 : * Gets called at the beginning of the simulation before this object is asked to do its job 33 : */ 34 : virtual void initialSetup(); 35 : 36 : /** 37 : * Gets called at the beginning of the timestep before this object is asked to do its job 38 : */ 39 : virtual void timestepSetup(); 40 : 41 : /** 42 : * Gets called just before the Jacobian is computed and before this object is asked to do its job 43 : */ 44 : virtual void jacobianSetup(); 45 : 46 : /** 47 : * Gets called just before the residual is computed and before this object is asked to do its job 48 : */ 49 : virtual void residualSetup(); 50 : 51 : /** 52 : * Gets called when the subdomain changes (i.e. in a Jacobian or residual loop) and before this 53 : * object is asked to do its job 54 : */ 55 : virtual void subdomainSetup(); 56 : 57 : /** 58 : * Gets called in FEProblemBase::execute() for execute flags other than initial, timestep_begin, 59 : * nonlinear, linear and subdomain 60 : */ 61 27658827 : virtual void customSetup(const ExecFlagType & /*exec_type*/) {} 62 : 63 : /** 64 : * Return the execute on MultiMooseEnum for this object. 65 : */ 66 : const ExecFlagEnum & getExecuteOnEnum() const; 67 : 68 : private: 69 : /// Empty ExecFlagEnum for the case when the "execute_on" parameter is not included. This 70 : /// is private because others should not be messing with it. 71 : ExecFlagEnum _empty_execute_enum; 72 : 73 : protected: 74 : /// Execute settings for this object. 75 : const ExecFlagEnum & _execute_enum; 76 : 77 : /// Reference to FEProblemBase 78 : const ExecFlagType & _current_execute_flag; 79 : 80 : // FEProblemBase::addMultiApp needs to reset the execution flags 81 : friend class FEProblemBase; 82 : };