10#ifdef MOOSE_MFEM_ENABLED
22 params.
addClassDescription(
"Base class for constraining an MFEM variable within one or more mesh "
26 params.
addParam<VariableName>(
"variable",
"Variable on which to apply the constraint");
28 "constrain_subdomain_boundary",
30 "Whether to constrain the degrees of freedom on the boundary of the subdomains given by "
31 "'block', both on interfaces with other subdomains and on the exterior boundary of the "
32 "mesh. If false, only the degrees of freedom interior to the subdomains are constrained.");
39 getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>(
"variable"))),
40 _trial_var_name(getParam<VariableName>(
"variable")),
41 _constrain_subdomain_boundary(getParam<bool>(
"constrain_subdomain_boundary"))
52 for (
const auto i : make_range(markers.Size()))
53 if (markers[i] && other_markers[i])
57 " with the constraint '",
61 "'. Essential constraints on the same variable must be restricted to disjoint "
62 "sets of subdomains.");
65const mfem::Array<int> &
72const mfem::Array<int> &
Base class for construction of an object that is restricted to a subset of subdomains of the problem ...
static InputParameters validParams()
mfem::Array< int > & getSubdomainMarkers()
Base class for objects constraining the value an MFEM variable may take within one or more mesh subdo...
mfem::Array< int > _subdomain_ldof_marker
Local dof marker matching _subdomain_tdofs.
const mfem::Array< int > & getSubdomainTDofs(mfem::ParFiniteElementSpace &pfes)
True dofs of pfes the constraint fixes: those of the constrained subdomains, less the subdomain bound...
long _subdomain_tdofs_sequence
FE space sequence number _subdomain_tdofs was built for; -1 marks "never built".
virtual const std::string & getTrialVariableName() const
Name of the trial variable (gridfunction) the constraint acts on.
mfem::Array< int > _subdomain_tdofs
Constrained true dofs of the most recent updateSubdomainTDofs() call.
static InputParameters validParams()
void checkDisjointSubdomains(MFEMConstraint &other)
Reports an error if this constraint shares a subdomain with other, a constraint on the same variable.
const mfem::Array< int > & getSubdomainLDofMarker(mfem::ParFiniteElementSpace &pfes)
Local dof marker of the dofs of pfes the constraint fixes, matching getSubdomainTDofs() and cached al...
MFEMConstraint(const InputParameters ¶meters)
void updateSubdomainTDofs(mfem::ParFiniteElementSpace &pfes)
Rebuilds the cached constrained dofs if pfes was updated since they were built.
const bool _constrain_subdomain_boundary
Whether the dofs on the boundary of the constrained subdomains are constrained.
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
const std::string & name() const
Get the name of the class.
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 subdomainTDofs(mfem::ParFiniteElementSpace &pfes, const mfem::Array< int > &subdomain_markers, bool include_boundary, mfem::Array< int > &ldof_marker, mfem::Array< int > &tdofs)
Degrees of freedom of pfes belonging to elements whose mesh attribute is set in the attribute marker ...