https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMTreeCotreeGaugeEssentialConstraint.C
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
13#include "MFEMConstraintUtils.h"
14
16
19{
22 "Applies a tree-cotree gauge to an H(curl) (Nedelec) variable by strongly fixing the "
23 "edge degrees of freedom on a spanning tree of the mesh to zero, and in a higher order "
24 "space a selection of the degrees of freedom of every other edge, face and element, "
25 "removing the gradient null space of a curl-curl operator. Edges carrying an "
26 "essential condition on the variable seed the spanning forest so the gauge stays "
27 "compatible with it. Set 'block' to the subdomains to gauge; the complement is treated as "
28 "already gauged and only seeds the spanning forest. Leaving 'block' empty gauges the "
29 "whole mesh. Above SECOND order, the mesh must have no triangular faces.");
30 // The gauge must reach the vertices on the boundary of its subdomains to remove
31 // the gradients that do not vanish there.
32 params.suppressParameter<bool>("constrain_subdomain_boundary");
33 return params;
34}
35
41
42void
44 mfem::Array<int> & ess_tdofs)
45{
46 const mfem::Array<int> & tree_tdofs =
47 _gauge.trueDofs(*this, *gridfunc.ParFESpace(), ess_tdofs, getSubdomainMarkers());
48
49 // The gauge fixes the tree dofs to zero: zero those entries of the solution
50 // gridfunction so the lifted right-hand side stays consistent.
51 Moose::MFEM::zeroTrueDofs(gridfunc, tree_tdofs);
52
53 ess_tdofs.Append(tree_tdofs);
54}
55
56#endif
registerMooseObject("MooseApp", MFEMTreeCotreeGaugeEssentialConstraint)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
mfem::Array< int > & getSubdomainMarkers()
Base class for applying essential volumetric constraints to the trial ParGridFunction of an MFEM prob...
static InputParameters validParams()
Removes the gradient null space of an H(curl) (Nedelec) variable by strongly fixing the edge degrees ...
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...
MFEMTreeCotreeGaugeEssentialConstraint(const InputParameters &parameters)
Moose::MFEM::TreeCotreeGauge _gauge
Selects and caches the gauged true dofs.
const mfem::Array< int > & trueDofs(const MFEMConstraint &constraint, mfem::ParFiniteElementSpace &pfes, const mfem::Array< int > &essential_tdofs, const mfem::Array< int > &gauge_block_markers)
This rank's ND true-dof indices that the tree-cotree gauge must strongly set to zero,...
void zeroTrueDofs(mfem::ParGridFunction &gf, const mfem::Array< int > &tdofs)
Strongly set the true dofs listed in tdofs of grid function gf to zero, leaving its local vector cons...