Closed nate-sime closed 8 months ago
My suggestion would be that we add a GhostMode.manifold
option to mesh creation, that is passed to the graph builder. If this mode is used all facets have to be sent to all processors for ownership determination.
this would mean that non-manifold geometries get no penalty, while 2D/3D manifolds will take longer to create (But be correct) with this option turned on. this strategy would be similar to ghostmode.shared_facet, which is almost always only required for DG problems.
If we think that the option should always be on for manifolds (Even if i think that is a bad idea, as not all manifolds has this feature), we could just determine it internally in create_mesh
.
Possible duplicate of https://github.com/FEniCS/dolfinx/issues/2374?
Duplicate of #2374
Creating a mesh of a manifold always assumes that interior (owned) facets will share more than one cell.
This is a rather confusing statement. In most meshes, we assume that interior facets are attached to exactly two cells. This is also true for non-branching manifold meshes.
In the special case of branching manifold meshes, we have several problems: firstly, the mesh partitioner may struggle, as the dual graph used for partitioning also assumes that an exterior facet is connected to just one cell, and interior facets are connected to two, which is incorrect.
Anyway, if we leave the mesh partitioner aside, it should be possible to create a topology directly with create_topology()
boundary_vertices
allows you to specify which vertices are on the process boundary - i.e. they could possibly be shared with another process. I think this might allow you to create the topology you want.Thanks for the input. I'll attempt the implementation as you've proposed and perhaps it could be contributed as a demo.
- the final argument
boundary_vertices
allows you to specify which vertices are on the process boundary - i.e. they could possibly be shared with another process. I think this might allow you to create the topology you want
I guess setting all vertices as boundary vertices will have the suggested effect. I still think this could be controlled with a ghostmode in create_mesh
Although it is not about ghosting. There are various other pathological meshes, e.g. where cells are connected only by a vertex. I think we can support some things, e.g. branching manifolds, in the future, but probably not all cases.
Summarize the issue
Possibly related to #1465.
Creating a mesh of a manifold always assumes that interior (owned) facets will share more than one cell. In the case of manifolds this may not be true as a facet on a process boundary may share more than one cell, whilst also being connected to another cell off process. See, e.g., https://github.com/FEniCS/dolfinx/blob/main/cpp/dolfinx/mesh/graphbuild.cpp#L417-L459.
The attached image shows that the facets (
tdim = 0
) which share more than one cell (tdim = 1
) are not considered for potential "sharing" between neighbouring processes. The pink coloured entities are ghosts.Thanks for @jorgensd for his help in tracking this one down.
How to reproduce the bug
Consider the following example
Minimal Example (Python)
Output (Python)
Version
main branch
DOLFINx git commit
476c61c3b7c743803ea25086ac1dad0ae9b8d7a7
Installation
From source.
Additional information
No response