https://mooseframework.inl.gov
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 
12 #include "MFEMInitialCondition.h"
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 
32  : MFEMExecutedObject(params)
33 {
34 }
35 
36 std::optional<std::string>
38 {
39  return getParam<VariableName>("variable");
40 }
41 
42 #endif
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
Base class for MFEM objects that participate in execution ordering but are not UserObjects.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Declare the common parameters used by MFEM executed objects.
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.
static InputParameters validParams()
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:30