10#ifdef MOOSE_MFEM_ENABLED
22 "Strongly constrains a scalar variable in the specified subdomain(s).");
23 params.
addParam<MFEMScalarCoefficientName>(
24 "coefficient",
"0.",
"The coefficient setting the constrained values");
35 mfem::Array<int> & ess_tdofs)
37 if (gridfunc.ParFESpace()->GetVectorDim() != 1)
38 paramError(
"variable",
"not scalar; use MFEMVectorEssentialConstraint instead.");
40 mfem::ParFiniteElementSpace & pfes = *gridfunc.ParFESpace();
registerMooseObject("MooseApp", MFEMScalarEssentialConstraint)
mfem::Array< int > & getSubdomainMarkers()
const mfem::Array< int > & getSubdomainTDofs(mfem::ParFiniteElementSpace &pfes)
True dofs of pfes the constraint fixes: those of the constrained subdomains, less the subdomain bound...
const mfem::Array< int > & getSubdomainLDofMarker(mfem::ParFiniteElementSpace &pfes)
Local dof marker of the dofs of pfes the constraint fixes, matching getSubdomainTDofs() and cached al...
Base class for applying essential volumetric constraints to the trial ParGridFunction of an MFEM prob...
static InputParameters validParams()
Strongly constrains a scalar variable in the specified subdomain(s) to a scalar coefficient.
mfem::Coefficient & _coef
MFEMScalarEssentialConstraint(const InputParameters ¶meters)
void ApplyConstraint(mfem::ParGridFunction &gridfunc, mfem::Array< int > &ess_tdofs) override
Apply the essential constraint, overwriting the values of gridfunc in the subdomain as desired and ap...
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
void projectCoefficientOnSubdomains(mfem::ParGridFunction &gf, mfem::Coefficient &coef, const mfem::Array< int > &subdomain_markers, const mfem::Array< int > &ldof_marker)
Overwrite the degrees of freedom of grid function gf marked in the local dof marker ldof_marker with ...