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.
Attempt to fix issues #177 and #170.
Summary of the issue:
The usual workflow is: You create a triangulation, that by default has no ghost. When you then want to use the triangulation to create an FESpace, the ghosts are added back. The issue is that we loose the information on ghosts when we delete them, so we actually have to reconstruct the information we used to have but threw away. On top of being expensive, this also had the side effect of changing the type of the serial triangulations.
Fix:
Both for efficiency and traceability, I think it is convenient to keep the parents if possible. I have added a new attribute
metadata
toDistributedTriangulation
, which stores the parents so that they can be used later.A couple comments:
BodyFittedTriangulations
, the parent is quite innexpensive. In the case ofBoundaryTriangulations
, the child is a view of the parent, so we were keeping the parent anyway. So memory-wise, this change has no cost whatsoever.Other:
When testing these changes, I came across the following: Calling
Boundary(with_ghost, model)
would return the local processor boundaries (which include the faces at the interface between processors) instead of returning the local part of the global boundary. This is a technical issue, but it makes a difference when trying to keep track of the parent.