10#ifdef MOOSE_MFEM_ENABLED
21 params.
addClassDescription(
"Strongly constrains the real and imaginary parts of a complex scalar "
22 "variable in the specified subdomain(s).");
23 params.
addParam<MFEMScalarCoefficientName>(
24 "coefficient_real",
"0.",
"The coefficient setting the real part of the constrained values");
25 params.
addParam<MFEMScalarCoefficientName>(
28 "The coefficient setting the imaginary part of the constrained values");
35 _coef_real(getScalarCoefficient(
"coefficient_real")),
36 _coef_imag(getScalarCoefficient(
"coefficient_imag"))
42 mfem::Array<int> & ess_tdofs)
44 if (gridfunc.ParFESpace()->GetVectorDim() != 1)
45 paramError(
"variable",
"not scalar; use MFEMComplexVectorEssentialConstraint instead.");
49 mfem::ParFiniteElementSpace & pfes = *gridfunc.ParFESpace();
registerMooseObject("MooseApp", MFEMComplexScalarEssentialConstraint)
mfem::Array< int > & getSubdomainMarkers()
Base class for applying essential volumetric constraints to the trial ParComplexGridFunction of a com...
static InputParameters validParams()
Complex counterpart of MFEMScalarEssentialConstraint.
static InputParameters validParams()
MFEMComplexScalarEssentialConstraint(const InputParameters ¶meters)
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::Coefficient & _coef_real
mfem::Coefficient & _coef_imag
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 ...