https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMInitialCondition.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#ifdef MOOSE_MFEM_ENABLED
11
13
16{
17 auto params = MFEMExecutedObject::validParams();
18 params.addRequiredParam<VariableName>("variable",
19 "The variable to apply the initial condition on.");
20 params.registerBase("InitialCondition");
21 params.addClassDescription(
22 "Base class for objects that set the initial condition on an MFEM variable.");
23 // We cannot generally execute this at construction time since the coefficient may be based on a
24 // MOOSE function which is not itself setup until its initialSetup is called. MFEM initial
25 // conditions therefore run in the explicit executed-object pass on EXEC_INITIAL.
26 params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL};
27 params.suppressParameter<ExecFlagEnum>("execute_on");
28 return params;
29}
30
35
36std::optional<std::string>
38{
39 return getParam<VariableName>("variable");
40}
41
42#endif
const ExecFlagType EXEC_INITIAL
Definition Moose.C:30
A MultiMooseEnum object to hold "execute_on" flags.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for MFEM objects that participate in execution ordering but are not UserObjects.
static InputParameters validParams()
Declare the common parameters used by MFEM executed objects.
static InputParameters validParams()
MFEMInitialCondition(const InputParameters &params)
virtual std::optional< std::string > suppliedVariableName() const override
Return the variable name supplied by this object, or std::nullopt if none.