10#ifdef MOOSE_MFEM_ENABLED
22 "Strongly constrains a vector variable in the specified subdomain(s).");
23 params.
addParam<MFEMVectorCoefficientName>(
24 "vector_coefficient",
"0. 0. 0.",
"The vector coefficient setting the constrained values");
35 mfem::Array<int> & ess_tdofs)
37 if (gridfunc.ParFESpace()->GetVectorDim() !=
_vec_coef.GetVDim())
38 paramError(
"vector_coefficient",
"dimension does not match the variable's.");
40 mfem::ParFiniteElementSpace & pfes = *gridfunc.ParFESpace();
registerMooseObject("MooseApp", MFEMVectorEssentialConstraint)
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 vector variable in the specified subdomain(s) to a vector coefficient.
MFEMVectorEssentialConstraint(const InputParameters ¶meters)
static InputParameters validParams()
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...
mfem::VectorCoefficient & _vec_coef
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 ...