https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMObject.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 "MFEMObject.h"
13#include "MFEMProblem.h"
14#include "SubProblem.h"
15
18{
24 params.addClassDescription("Base class for MFEM objects backed directly by MooseObject.");
25 return params;
26}
27
29 : MooseObject(parameters),
34 _mfem_problem(
35 static_cast<MFEMProblem &>(*parameters.getCheckedPointerParam<SubProblem *>("_subproblem")))
36{
37}
38
39mfem::Coefficient &
40MFEMObject::getScalarCoefficientByName(const MFEMScalarCoefficientName & name)
41{
43}
44
45mfem::VectorCoefficient &
46MFEMObject::getVectorCoefficientByName(const MFEMVectorCoefficientName & name)
47{
49}
50
51mfem::MatrixCoefficient &
52MFEMObject::getMatrixCoefficientByName(const MFEMMatrixCoefficientName & name)
53{
55}
56
57mfem::Coefficient &
58MFEMObject::getScalarCoefficient(const std::string & name)
59{
60 return getScalarCoefficientByName(getParam<MFEMScalarCoefficientName>(name));
61}
62
63mfem::VectorCoefficient &
64MFEMObject::getVectorCoefficient(const std::string & name)
65{
66 return getVectorCoefficientByName(getParam<MFEMVectorCoefficientName>(name));
67}
68
69mfem::MatrixCoefficient &
70MFEMObject::getMatrixCoefficient(const std::string & name)
71{
72 return getMatrixCoefficientByName(getParam<MFEMMatrixCoefficientName>(name));
73}
74
75#endif
Interface for objects that need to use functions.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
mfem::Coefficient & getScalarCoefficientByName(const MFEMScalarCoefficientName &name)
Retrieve a scalar MFEM coefficient by its declared name.
Definition MFEMObject.C:40
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Retrieve a vector MFEM coefficient using the value of an input parameter.
Definition MFEMObject.C:64
mfem::MatrixCoefficient & getMatrixCoefficientByName(const MFEMMatrixCoefficientName &name)
Retrieve a matrix MFEM coefficient by its declared name.
Definition MFEMObject.C:52
mfem::VectorCoefficient & getVectorCoefficientByName(const MFEMVectorCoefficientName &name)
Retrieve a vector MFEM coefficient by its declared name.
Definition MFEMObject.C:46
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
Definition MFEMObject.C:17
mfem::MatrixCoefficient & getMatrixCoefficient(const std::string &name)
Retrieve a matrix MFEM coefficient using the value of an input parameter.
Definition MFEMObject.C:70
MFEMObject(const InputParameters &parameters)
Construct an MFEM object backed directly by MooseObject.
Definition MFEMObject.C:28
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
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
static InputParameters validParams()
Definition MooseObject.C:25
mfem::MatrixCoefficient & getMatrixCoefficient(const std::string &name)
Return scalar coefficient with the given name.
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Return a vector coefficient with the given name or, if that doesn't exists, try interpreting the name...
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Return a scalar coefficient with the given name or, if that doesn't exists, try interpreting the name...
Interface class for classes which interact with Postprocessors.
static InputParameters validParams()
Interface to allow object to consume Reporter values.
static InputParameters validParams()
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79