https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMConstraint.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#ifdef MOOSE_MFEM_ENABLED
11
12#pragma once
13
14#include "MFEMObject.h"
16
31{
32public:
34
36 virtual ~MFEMConstraint() = default;
37
39 virtual const std::string & getTrialVariableName() const { return _trial_var_name; }
40
47
48protected:
53 const mfem::Array<int> & getSubdomainTDofs(mfem::ParFiniteElementSpace & pfes);
56 const mfem::Array<int> & getSubdomainLDofMarker(mfem::ParFiniteElementSpace & pfes);
57
59 const VariableName & _trial_var_name;
60
61private:
63 void updateSubdomainTDofs(mfem::ParFiniteElementSpace & pfes);
64
68 mfem::Array<int> _subdomain_tdofs;
70 mfem::Array<int> _subdomain_ldof_marker;
73};
74
75#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for construction of an object that is restricted to a subset of subdomains of the problem ...
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()
virtual ~MFEMConstraint()=default
const VariableName & _trial_var_name
Name of the trial variable the constraint is applied to.
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...
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.
Definition MFEMObject.h:30
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131