www.mooseframework.org
SetupInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "SetupInterface.h"
11 #include "Conversion.h"
12 #include "FEProblem.h"
13 
14 template <>
17 {
19 
20  // Add the 'execute_on' input parameter for users to set
22  execute_options = EXEC_LINEAR;
23  params.addParam<ExecFlagEnum>("execute_on", execute_options, execute_options.getDocString());
24  return params;
25 }
26 
28  : _execute_enum(moose_object->parameters().isParamValid("execute_on")
29  ? moose_object->parameters().get<ExecFlagEnum>("execute_on")
30  : _empty_execute_enum),
31  _exec_flags(_execute_enum.begin(), _execute_enum.end()), // deprecated TODO: ExecFlagType
32  _current_execute_flag(
33  (moose_object->parameters().getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"))
34  ->getCurrentExecuteOnFlag())
35 {
36  _empty_execute_enum.clear(); // remove any flags for the case when "execute_on" is not used
37 }
38 
40 
41 void
43 {
44 }
45 
46 void
48 {
49 }
50 
51 void
53 {
54 }
55 
56 void
58 {
59 }
60 
61 void
63 {
64 }
65 
66 const ExecFlagEnum &
68 {
69  return _execute_enum;
70 }
71 
72 const std::vector<ExecFlagType> &
74 {
75  // TODO: ExecFlagType
76  mooseDeprecated("The execFlags() method is being removed because MOOSE has been updated to use a "
77  "ExecFlagEnum for execute flags. The current flags should be retrieved from "
78  "the \"exeucte_on\" parameters of your object or by using the \"_execute_enum\" "
79  "reference to the parameter or the getExecuteOnEnum() method.");
80 
81  return _exec_flags;
82 }
83 
86 {
87  // TODO: ExecFlagType
88  mooseDeprecated("The execBitFlags method is being removed because MOOSE was updated to use a "
89  "ExecFlagEnum for execute flags. This method maintains the behavior of the "
90  "original method but the use of this method should be removed from your "
91  "application. The ExecFlagEnum should be inspected directly via the "
92  "getExecuteOnEnum() method.");
93 
94  unsigned int exec_bit_field = EXEC_NONE;
95  for (const auto & flag : _exec_flags)
96  exec_bit_field |= flag.id();
97  return ExecFlagType("deprecated", exec_bit_field);
98 }
99 
102 {
103  // TODO: ExecFlagType
104  ::mooseDeprecated("The 'getExecuteOptions' was replaced by the ExecFlagEnum class because MOOSE "
105  "was updated to use this for the execute flags and the new function provides "
106  "additional arguments for modification of the enum.");
108 }
virtual void subdomainSetup()
Gets called when the subdomain changes (i.e.
static ExecFlagEnum getExecuteOptions()
(DEPRECATED) Returns the available options for the &#39;execute_on&#39; input parameters TODO: ExecFlagType ...
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:24
MooseEnumItem ExecFlagType
Definition: Moose.h:95
InputParameters validParams< SetupInterface >()
const ExecFlagType EXEC_NONE
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
ExecFlagType execBitFlags() const
(DEPRECATED) Build and return the execution flags as a bitfield TODO: ExecFlagType ...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const std::vector< ExecFlagType > & execFlags() const
(DEPRECATED) Get the execution flag for the object TODO: ExecFlagType
virtual ~SetupInterface()
InputParameters emptyInputParameters()
ExecFlagEnum getDefaultExecFlagEnum()
Return the default ExecFlagEnum for MOOSE.
Definition: MooseUtils.C:667
virtual void timestepSetup()
Gets called at the beginning of the timestep before this object is asked to do its job...
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const ExecFlagEnum & getExecuteOnEnum() const
Return the execute on MultiMooseEnum for this object.
std::string getDocString() const
Generate a documentation string for the "execute_on" parameter.
Definition: ExecFlagEnum.C:39
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:236
SetupInterface(const MooseObject *moose_object)
const ExecFlagType EXEC_LINEAR
void clear()
Clear the MultiMooseEnum.
const ExecFlagEnum & _execute_enum
Execute settings for this oejct.
const int & id() const
Return the numeric, name, or raw name.
Definition: MooseEnumItem.h:36
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
ExecFlagEnum _empty_execute_enum
Empty ExecFlagEnum for the case when the "execute_on" parameter is not included.
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job...
const std::vector< ExecFlagType > _exec_flags
(DEPRECATED) execution flag (when is the object executed/evaluated) TODO: ExecFlagType ...
virtual void jacobianSetup()
Gets called just before the Jacobian is computed and before this object is asked to do its job...
virtual void residualSetup()
Gets called just before the residual is computed and before this object is asked to do its job...