Front-end class for creating and storing MFEM coefficients. More...
#include <CoefficientManager.h>
Public Member Functions | |
CoefficientManager ()=default | |
mfem::Coefficient & | declareScalar (const std::string &name, const std::string &existing_or_literal) |
Declare an alias to an existing scalar coefficient or, if it does not exist, try interpreting the name as a number with which to create a new constant coefficient. More... | |
template<class P , class... Args> | |
P & | declareScalar (const std::string &name, Args &&... args) |
Create a new scalar coefficient, constructed from the argument pack. More... | |
mfem::Coefficient & | declareScalarProperty (const std::string &name, const std::vector< std::string > &blocks, const std::string &existing_or_literal) |
Use an existing scalar coefficient for a property on some blocks of the mesh. More... | |
template<class P , class... Args> | |
mfem::Coefficient & | declareScalarProperty (const std::string &name, const std::vector< std::string > &blocks, Args &&... args) |
Use a new scalar coefficient, constructed from the argument pack, for a property on some blocks of the mesh. More... | |
mfem::VectorCoefficient & | declareVector (const std::string &name, const std::string &existing_or_literal) |
Declare an alias to an existing vector coefficientor or, if it does not exist, try interpreting the name as a vector of numbers with which to create a new constant vector coefficient. More... | |
template<class P , class... Args> | |
P & | declareVector (const std::string &name, Args &&... args) |
Create a new vector coefficient, constructed from the argument pack. More... | |
mfem::VectorCoefficient & | declareVectorProperty (const std::string &name, const std::vector< std::string > &blocks, const std::string &existing_or_literal) |
Use an existing vector coefficient for a property on some blocks of the mesh. More... | |
template<class P , class... Args> | |
mfem::VectorCoefficient & | declareVectorProperty (const std::string &name, const std::vector< std::string > &blocks, Args &&... args) |
Use a new vector coefficient, constructed from the argument pack, for a property on some blocks of the mesh. More... | |
mfem::MatrixCoefficient & | declareMatrix (const std::string &name, const std::string &existing_coef) |
Declare an alias to an existing matrix coefficient. More... | |
template<class P , class... Args> | |
P & | declareMatrix (const std::string &name, Args &&... args) |
Create a new matrix coefficient, constructed from the argument pack. More... | |
mfem::MatrixCoefficient & | declareMatrixProperty (const std::string &name, const std::vector< std::string > &blocks, const std::string &existing_coef) |
Use an existing matrix coefficient for a property on some blocks of the mesh. More... | |
template<class P , class... Args> | |
mfem::MatrixCoefficient & | declareMatrixProperty (const std::string &name, const std::vector< std::string > &blocks, Args &&... args) |
Use a new matrix coefficient, constructed from the argument pack, for a property on some blocks of the mesh. More... | |
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 as a number with which to build a new constant coefficient. More... | |
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 as a vector of number with which to build a new constant vector coefficient. More... | |
mfem::MatrixCoefficient & | getMatrixCoefficient (const std::string &name) |
Return scalar coefficient with the given name. More... | |
bool | scalarPropertyIsDefined (const std::string &name, const std::string &block) const |
bool | vectorPropertyIsDefined (const std::string &name, const std::string &block) const |
bool | matrixPropertyIsDefined (const std::string &name, const std::string &block) const |
void | setTime (const double time) |
Private Member Functions | |
mfem::Coefficient & | declareScalar (const std::string &name, std::shared_ptr< mfem::Coefficient > coef) |
mfem::Coefficient & | declareScalarProperty (const std::string &name, const std::vector< std::string > &blocks, std::shared_ptr< mfem::Coefficient > coef) |
mfem::VectorCoefficient & | declareVector (const std::string &name, std::shared_ptr< mfem::VectorCoefficient > coef) |
mfem::VectorCoefficient & | declareVectorProperty (const std::string &name, const std::vector< std::string > &blocks, std::shared_ptr< mfem::VectorCoefficient > coef) |
mfem::MatrixCoefficient & | declareMatrix (const std::string &name, std::shared_ptr< mfem::MatrixCoefficient > coef) |
mfem::MatrixCoefficient & | declareMatrixProperty (const std::string &name, const std::vector< std::string > &blocks, std::shared_ptr< mfem::MatrixCoefficient > coef) |
std::shared_ptr< mfem::Coefficient > | getScalarCoefficientPtr (const std::string &name) |
std::shared_ptr< mfem::VectorCoefficient > | getVectorCoefficientPtr (const std::string &name) |
std::shared_ptr< mfem::MatrixCoefficient > | getMatrixCoefficientPtr (const std::string &name) |
Private Attributes | |
ScalarMap | _scalar_coeffs |
VectorMap | _vector_coeffs |
MatrixMap | _matrix_coeffs |
Front-end class for creating and storing MFEM coefficients.
They can be created so they are global (defined across the entire domain) or as piecewise material properties.
Definition at line 35 of file CoefficientManager.h.
|
default |
mfem::MatrixCoefficient & Moose::MFEM::CoefficientManager::declareMatrix | ( | const std::string & | name, |
const std::string & | existing_coef | ||
) |
Declare an alias to an existing matrix coefficient.
Unlike for the scalar and vector counterparts, there is currently no way to try interpreting the name as numbers with which to construct a constant matrix coefficient.
Definition at line 96 of file CoefficientManager.C.
Referenced by declareMatrix().
|
inline |
Create a new matrix coefficient, constructed from the argument pack.
Definition at line 125 of file CoefficientManager.h.
|
private |
Definition at line 88 of file CoefficientManager.C.
mfem::MatrixCoefficient & Moose::MFEM::CoefficientManager::declareMatrixProperty | ( | const std::string & | name, |
const std::vector< std::string > & | blocks, | ||
const std::string & | existing_coef | ||
) |
Use an existing matrix coefficient for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of existing_coef
on these blocks. Unlike for the scalar and vector counterparts, there is currently no way to try interpreting the name as numbers with which to construct a constant matrix coefficient.
Definition at line 111 of file CoefficientManager.C.
Referenced by declareMatrixProperty().
|
inline |
Use a new matrix coefficient, constructed from the argument pack, for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of the new coefficient on these blocks.
Definition at line 150 of file CoefficientManager.h.
|
private |
Definition at line 102 of file CoefficientManager.C.
mfem::Coefficient & Moose::MFEM::CoefficientManager::declareScalar | ( | const std::string & | name, |
const std::string & | existing_or_literal | ||
) |
Declare an alias to an existing scalar coefficient or, if it does not exist, try interpreting the name as a number with which to create a new constant coefficient.
Definition at line 27 of file CoefficientManager.C.
Referenced by MFEMProblem::addFunction(), MFEMProblem::addGridFunction(), MFEMProblem::addPostprocessor(), and declareScalar().
|
inline |
Create a new scalar coefficient, constructed from the argument pack.
Definition at line 47 of file CoefficientManager.h.
|
private |
Definition at line 20 of file CoefficientManager.C.
mfem::Coefficient & Moose::MFEM::CoefficientManager::declareScalarProperty | ( | const std::string & | name, |
const std::vector< std::string > & | blocks, | ||
const std::string & | existing_or_literal | ||
) |
Use an existing scalar coefficient for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of existing_coef
on these blocks. If no such scalar coefficient exists, try interpreting the name as a number with which to create a new constant coefficient.
Definition at line 42 of file CoefficientManager.C.
Referenced by declareScalarProperty(), and MFEMGenericFunctorMaterial::MFEMGenericFunctorMaterial().
|
inline |
Use a new scalar coefficient, constructed from the argument pack, for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of the new coefficient on these blocks.
Definition at line 71 of file CoefficientManager.h.
|
private |
Definition at line 33 of file CoefficientManager.C.
mfem::VectorCoefficient & Moose::MFEM::CoefficientManager::declareVector | ( | const std::string & | name, |
const std::string & | existing_or_literal | ||
) |
Declare an alias to an existing vector coefficientor or, if it does not exist, try interpreting the name as a vector of numbers with which to create a new constant vector coefficient.
Definition at line 61 of file CoefficientManager.C.
Referenced by MFEMProblem::addFunction(), MFEMProblem::addGridFunction(), and declareVector().
|
inline |
Create a new vector coefficient, constructed from the argument pack.
Definition at line 85 of file CoefficientManager.h.
|
private |
Definition at line 53 of file CoefficientManager.C.
mfem::VectorCoefficient & Moose::MFEM::CoefficientManager::declareVectorProperty | ( | const std::string & | name, |
const std::vector< std::string > & | blocks, | ||
const std::string & | existing_or_literal | ||
) |
Use an existing vector coefficient for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of existing_coef
on these blocks. If no such vector coefficient exists, try interpreting the name as a vector of numbers with which to create a new constant vector coefficient.
Definition at line 76 of file CoefficientManager.C.
Referenced by declareVectorProperty(), and MFEMGenericFunctorVectorMaterial::MFEMGenericFunctorVectorMaterial().
|
inline |
Use a new vector coefficient, constructed from the argument pack, for a property on some blocks of the mesh.
The property will be a piecewise coefficient and it will have the value of the new coefficient on these blocks.
Definition at line 110 of file CoefficientManager.h.
|
private |
Definition at line 67 of file CoefficientManager.C.
mfem::MatrixCoefficient & Moose::MFEM::CoefficientManager::getMatrixCoefficient | ( | const std::string & | name | ) |
Return scalar coefficient with the given name.
Unlike for the scalar and vector counterparts, there is currently no way to try interpreting the name as numbers with which to construct a constant matrix coefficient.
Definition at line 173 of file CoefficientManager.C.
Referenced by declareMatrixProperty(), and MFEMGeneralUserObject::getMatrixCoefficient().
|
private |
Definition at line 154 of file CoefficientManager.C.
Referenced by declareMatrix(), declareMatrixProperty(), and getMatrixCoefficient().
mfem::Coefficient & Moose::MFEM::CoefficientManager::getScalarCoefficient | ( | const std::string & | name | ) |
Return a scalar coefficient with the given name or, if that doesn't exists, try interpreting the name as a number with which to build a new constant coefficient.
Definition at line 161 of file CoefficientManager.C.
Referenced by declareScalarProperty(), and MFEMGeneralUserObject::getScalarCoefficient().
|
private |
Definition at line 122 of file CoefficientManager.C.
Referenced by declareScalar(), declareScalarProperty(), and getScalarCoefficient().
mfem::VectorCoefficient & Moose::MFEM::CoefficientManager::getVectorCoefficient | ( | const std::string & | name | ) |
Return a vector coefficient with the given name or, if that doesn't exists, try interpreting the name as a vector of number with which to build a new constant vector coefficient.
Definition at line 167 of file CoefficientManager.C.
Referenced by declareVectorProperty(), and MFEMGeneralUserObject::getVectorCoefficient().
|
private |
Definition at line 138 of file CoefficientManager.C.
Referenced by declareVector(), declareVectorProperty(), and getVectorCoefficient().
bool Moose::MFEM::CoefficientManager::matrixPropertyIsDefined | ( | const std::string & | name, |
const std::string & | block | ||
) | const |
Definition at line 193 of file CoefficientManager.C.
bool Moose::MFEM::CoefficientManager::scalarPropertyIsDefined | ( | const std::string & | name, |
const std::string & | block | ||
) | const |
Definition at line 179 of file CoefficientManager.C.
void Moose::MFEM::CoefficientManager::setTime | ( | const double | time | ) |
Definition at line 200 of file CoefficientManager.C.
Referenced by Moose::MFEM::TimeDomainEquationSystemProblemOperator::ImplicitSolve().
bool Moose::MFEM::CoefficientManager::vectorPropertyIsDefined | ( | const std::string & | name, |
const std::string & | block | ||
) | const |
Definition at line 186 of file CoefficientManager.C.
|
private |
Definition at line 181 of file CoefficientManager.h.
Referenced by declareMatrix(), declareMatrixProperty(), getMatrixCoefficientPtr(), matrixPropertyIsDefined(), and setTime().
|
private |
Definition at line 179 of file CoefficientManager.h.
Referenced by declareScalar(), declareScalarProperty(), getScalarCoefficientPtr(), scalarPropertyIsDefined(), and setTime().
|
private |
Definition at line 180 of file CoefficientManager.h.
Referenced by declareVector(), declareVectorProperty(), getVectorCoefficientPtr(), setTime(), and vectorPropertyIsDefined().