10#ifdef MOOSE_MFEM_ENABLED
21 params.
addClassDescription(
"Strongly constrains the real and imaginary parts of a complex vector "
22 "variable in the specified subdomain(s).");
23 params.
addParam<MFEMVectorCoefficientName>(
24 "vector_coefficient_real",
26 "The vector coefficient setting the real part of the constrained values");
27 params.
addParam<MFEMVectorCoefficientName>(
28 "vector_coefficient_imag",
30 "The vector coefficient setting the imaginary part of the constrained values");
37 _vec_coef_real(getVectorCoefficient(
"vector_coefficient_real")),
38 _vec_coef_imag(getVectorCoefficient(
"vector_coefficient_imag"))
44 mfem::Array<int> & ess_tdofs)
46 if (gridfunc.ParFESpace()->GetVectorDim() !=
_vec_coef_real.GetVDim())
47 paramError(
"vector_coefficient_real",
"dimension does not match the variable's.");
48 else if (gridfunc.ParFESpace()->GetVectorDim() !=
_vec_coef_imag.GetVDim())
49 paramError(
"vector_coefficient_imag",
"dimension does not match the variable's.");
53 mfem::ParFiniteElementSpace & pfes = *gridfunc.ParFESpace();
registerMooseObject("MooseApp", MFEMComplexVectorEssentialConstraint)
mfem::Array< int > & getSubdomainMarkers()
Base class for applying essential volumetric constraints to the trial ParComplexGridFunction of a com...
static InputParameters validParams()
Complex counterpart of MFEMVectorEssentialConstraint.
mfem::VectorCoefficient & _vec_coef_real
void ApplyConstraint(mfem::ParComplexGridFunction &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_imag
static InputParameters validParams()
MFEMComplexVectorEssentialConstraint(const InputParameters ¶meters)
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...
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 ...