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 : 28 : #ifdef MOOSE_KOKKOS_ENABLED 29 : /** 30 : * Special constructor used for Kokkos functor copy during parallel dispatch 31 : */ 32 : SetupInterface(const SetupInterface & object, const Moose::Kokkos::FunctorCopy & key); 33 : #endif 34 : 35 : virtual ~SetupInterface(); 36 : 37 : static InputParameters validParams(); 38 : 39 : /** 40 : * Gets called at the beginning of the simulation before this object is asked to do its job 41 : */ 42 : virtual void initialSetup(); 43 : 44 : /** 45 : * Gets called at the beginning of the timestep before this object is asked to do its job 46 : */ 47 : virtual void timestepSetup(); 48 : 49 : /** 50 : * Gets called just before the Jacobian is computed and before this object is asked to do its job 51 : */ 52 : virtual void jacobianSetup(); 53 : 54 : /** 55 : * Gets called just before the residual is computed and before this object is asked to do its job 56 : */ 57 : virtual void residualSetup(); 58 : 59 : /** 60 : * Gets called when the subdomain changes (i.e. in a Jacobian or residual loop) and before this 61 : * object is asked to do its job 62 : */ 63 : virtual void subdomainSetup(); 64 : 65 : /** 66 : * Gets called in FEProblemBase::execute() for execute flags other than initial, timestep_begin, 67 : * nonlinear, linear and subdomain 68 : */ 69 32907618 : virtual void customSetup(const ExecFlagType & /*exec_type*/) {} 70 : 71 : /** 72 : * Return the execute on MultiMooseEnum for this object. 73 : */ 74 : const ExecFlagEnum & getExecuteOnEnum() const; 75 : 76 : private: 77 : /// Empty ExecFlagEnum for the case when the "execute_on" parameter is not included. This 78 : /// is private because others should not be messing with it. 79 : ExecFlagEnum _empty_execute_enum; 80 : 81 : protected: 82 : /// Execute settings for this object. 83 : const ExecFlagEnum & _execute_enum; 84 : 85 : /// Reference to FEProblemBase 86 : const ExecFlagType & _current_execute_flag; 87 : 88 : // FEProblemBase::addMultiApp needs to reset the execution flags 89 : friend class FEProblemBase; 90 : };