https://mooseframework.inl.gov
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),
30  FunctionInterface(this),
33  ReporterInterface(this),
34  _mfem_problem(
35  static_cast<MFEMProblem &>(*parameters.getCheckedPointerParam<SubProblem *>("_subproblem")))
36 {
37 }
38 
39 mfem::Coefficient &
40 MFEMObject::getScalarCoefficientByName(const MFEMScalarCoefficientName & name)
41 {
43 }
44 
45 mfem::VectorCoefficient &
46 MFEMObject::getVectorCoefficientByName(const MFEMVectorCoefficientName & name)
47 {
49 }
50 
51 mfem::MatrixCoefficient &
52 MFEMObject::getMatrixCoefficientByName(const MFEMMatrixCoefficientName & name)
53 {
55 }
56 
57 mfem::Coefficient &
58 MFEMObject::getScalarCoefficient(const std::string & name)
59 {
60  return getScalarCoefficientByName(getParam<MFEMScalarCoefficientName>(name));
61 }
62 
63 mfem::VectorCoefficient &
64 MFEMObject::getVectorCoefficient(const std::string & name)
65 {
66  return getVectorCoefficientByName(getParam<MFEMVectorCoefficientName>(name));
67 }
68 
69 mfem::MatrixCoefficient &
70 MFEMObject::getMatrixCoefficient(const std::string & name)
71 {
72  return getMatrixCoefficientByName(getParam<MFEMMatrixCoefficientName>(name));
73 }
74 
75 #endif
static InputParameters validParams()
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition: MFEMObject.h:45
static InputParameters validParams()
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Retrieve a vector MFEM coefficient using the value of an input parameter.
Definition: MFEMObject.C:64
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Return a vector coefficient with the given name or, if that doesn&#39;t exists, try interpreting the name...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
mfem::VectorCoefficient & getVectorCoefficientByName(const MFEMVectorCoefficientName &name)
Retrieve a vector MFEM coefficient by its declared name.
Definition: MFEMObject.C:46
mfem::MatrixCoefficient & getMatrixCoefficientByName(const MFEMMatrixCoefficientName &name)
Retrieve a matrix MFEM coefficient by its declared name.
Definition: MFEMObject.C:52
mfem::MatrixCoefficient & getMatrixCoefficient(const std::string &name)
Return scalar coefficient with the given name.
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:28
Interface to allow object to consume Reporter values.
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
Definition: MFEMProblem.h:257
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Return a scalar coefficient with the given name or, if that doesn&#39;t exists, try interpreting the name...
static InputParameters validParams()
mfem::MatrixCoefficient & getMatrixCoefficient(const std::string &name)
Retrieve a matrix MFEM coefficient using the value of an input parameter.
Definition: MFEMObject.C:70
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
Definition: MFEMObject.C:17
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Retrieve a scalar MFEM coefficient using the value of an input parameter.
Definition: MFEMObject.C:58
mfem::Coefficient & getScalarCoefficientByName(const MFEMScalarCoefficientName &name)
Retrieve a scalar MFEM coefficient by its declared name.
Definition: MFEMObject.C:40
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...
static InputParameters validParams()
Definition: MooseObject.C:25
Interface for objects that need to use functions.
Interface class for classes which interact with Postprocessors.
MFEMObject(const InputParameters &parameters)
Construct an MFEM object backed directly by MooseObject.
Definition: MFEMObject.C:28