FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
792 stars 182 forks source link

Refactor C++ `dolfinx::mesh::Topology` #3506

Open jorgensd opened 2 weeks ago

jorgensd commented 2 weeks ago

Describe new/missing feature

Current Topology initializer just takes in an MPI communicator and a cell type, and then all other information is passed through set_index_map or set_connectivity or original_cell_index. However, a topology isn't really valid (none of the create_entities or create_connectivity functions can be called without):

Additionally, users can make invalid connections or index maps through set_index_map and set_connectivity post initialization.

A benefit of this is that we allow for an "adaptive mesh topology". However, we do not have the same flexibility for the mesh geometry (cannot replace index map or change the size of x, or the indices of the dofmap).

Thus, I propose we refactor topology such that:

Suggested user interface

No response