Add new Mapping based on agglomerates #133
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.
So far, we have been using a
MappingFEField
machinery which required the definition of an auxiliary DoFHandler and an Eulerian vector describing the vertices of boxes associated with agglomerates. After this setup, this mapping was given to FEValues-like objects with properly scaled quadrature weights and normals since our weights and normals were already in real space. This was rather unfortunate and was explained in #58 (comment)This PR depends on #132. First relevant commit is 1869db1.
It provides a new$F(\hat{x}) = J\hat{x} + c$ from reference space to the (real) bounding box. In this case $J$ is diagonal with entries $h_x,h_y,h_z$ .
MappingBox
class responsible for mappings associated with the bounding box of agglomerates and aware of the fact that we are in real space. It describes the affine transformationIt is very close to what
MappingCartesian
does but it considers the fact that quantities such as weights and normals must not be scaled in our case, as they are collected from real space.Its construction requires only the vector of local
BoundingBox<dim>
objects and a map which translates from the (master) cell index to the associated box index (which coincides with the polytope index). We can then construct FEValues-like objects with such aMappingBox
object.This approach completely removes the need for the mentioned
MappingFEField
and allows removing all the tricks with scaling factors that we had to do before. This is clear by looking at changes insource/agglomeration_handler.cc
.@luca-heltai What do you think? The performance gain with this new design is quite large:
Wall-clock time to assemble DG stiffness matrix