https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMScalarBoundaryIC.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#include "MFEMProblem.h"
14
16
19{
22 params.addClassDescription("Sets the initial values of an MFEM scalar variable from a "
23 "user-specified scalar coefficient.");
24 params.addRequiredParam<MFEMScalarCoefficientName>("coefficient", "The scalar coefficient");
25 return params;
26}
27
29 : MFEMInitialCondition(params),
31 params, getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("variable")))
32{
33}
34
35void
37{
38 auto & coeff = getScalarCoefficient("coefficient");
39 auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
40 grid_function->ProjectBdrCoefficient(coeff, getBoundaryMarkers());
41}
42
43#endif
registerMooseObject("MooseApp", MFEMScalarBoundaryIC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for construction of an object that is restricted to a subset of boundaries of the problem ...
mfem::Array< int > & getBoundaryMarkers()
static InputParameters validParams()
Base class used to set the initial value(s) on an MFEMVariable.
static InputParameters validParams()
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition MFEMObject.h:45
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Retrieve a scalar MFEM coefficient using the value of an input parameter.
Definition MFEMObject.C:58
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
Class used to set the initial value(s) on a scalar valued MFEMVariable.
MFEMScalarBoundaryIC(const InputParameters &params)
static InputParameters validParams()
virtual void execute() override
Perform the main work for this object.