Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jorgensd opened this issue Nov 11, 2024 · 0 comments
Open

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

jorgensd opened this issue Nov 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jorgensd
Copy link
Member

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):

  • A cell index map
  • A vertex index map
  • A cell_to_vertex connectivity
  • Original cell indices ( Not required for create_*, but for reading external data).

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:

  • Initializer: Takes in communicator, cell_type, cell_index_map, vertex_index_map, c_to_v and original_cell_indices
  • Destruction of connectivity: Sometimes users might want to delete a connectivity after usage. We could have a clear_connectivity(i, j) that removes the connectivity (and guards against removal of c_to_v, c_to_c or v_to_v connectivity).
  • Destruction of entities: Can currently be done with set_index_map (which is unsafe). Should be done with a clear_entities(i) with guards against clearing cells or vertices.

Suggested user interface

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant