Save conformity info for ConformingFESpaces #1042
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
UnconstrainedFESpace
type has a fieldmetadata
which is mostly being unused. In the case ofCLagrangianFESpaces
we use it to store theNodeToDofGlue
, a structure that implicitly gives conformity information for the underlying FESpace. For other types of conforming FESpaces, however, the conformity information (stored in theCellConformity
structure) is thrown away.It is then impossible to retrieve conformity info from an FESpace, which is sometimes needed when we want to somehow manipulate the dofs of such space (restricting them, classifying them, adding BCs, etc...). In GridapSolvers, we have been dealing with this problem by specifically keeping track of thins kind of info within other objects, but its quite inconvenient.
The
CellConformity
structure is quite inexpensive in terms of memory, since the number of differentReferenceFEs
is quite limited. This is still true for PhysicalFEs, where cost is in the basis arrays. It also does not introduce any type instanbility that I can think of, even in the case of multipleReferenceFEs
being used (since the reffes themselves are not stored). In that regard, I would argue the aboveNodeToDofGlue
is quite worse.I also looked through (hopefully most of) the codebase, and I cannot see anyone ever using this metadata field for anything else.
Therefore I've modified the conforming FESpace constructors to save the
CellConformity
info within theirmetadata
. For now, I have not added any API to retrieve such info. I don't think it's necessary for the moment, since nothing within Gridap requires it.