https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMComplexTreeCotreeGaugeEssentialConstraint.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 a complex H(curl) (Nedelec) variable by "
23 "strongly fixing the real and imaginary parts of the edge degrees of freedom on a spanning "
24 "tree of the mesh to zero, and in a higher order space those of a selection of the degrees "
25 "of freedom of every other edge, face and element, removing the gradient null space of a "
26 "curl-curl operator. Edges carrying an essential condition on the variable "
27 "seed the spanning forest. Set 'block' to the subdomains to gauge; the complement seeds the "
28 "spanning forest but is not gauged. Leaving 'block' empty gauges the whole mesh. Above "
29 "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::ParComplexGridFunction & gridfunc, 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 in both components so the lifted
50 // right-hand side stays consistent. The real and imaginary views are brought up
51 // to date with the complex vector before being written, and hand their state
52 // back afterwards.
53 gridfunc.Sync();
54 Moose::MFEM::zeroTrueDofs(gridfunc.real(), tree_tdofs);
55 Moose::MFEM::zeroTrueDofs(gridfunc.imag(), tree_tdofs);
56 gridfunc.SyncAlias();
57
58 ess_tdofs.Append(tree_tdofs);
59}
60
61#endif
registerMooseObject("MooseApp", MFEMComplexTreeCotreeGaugeEssentialConstraint)
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 ParComplexGridFunction of a com...
Complex counterpart of MFEMTreeCotreeGaugeEssentialConstraint.
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...
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...