Skip to content

Commit

Permalink
Fix topological dimension of vertex-meshes (#3523)
Browse files Browse the repository at this point in the history
* Add fix for point mesh tdim

* Add fix in topology constructor after checking that new assertion fails in previous commit

* Apply suggestions from code review

---------

Co-authored-by: Garth N. Wells <[email protected]>
  • Loading branch information
jorgensd and garth-wells authored Nov 21, 2024
1 parent 82e2afa commit c1ac475
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/dolfinx/mesh/Topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ Topology::Topology(
// Cell Types
_entity_types.insert(_entity_types.end(), cell_types.begin(),
cell_types.end());
_entity_type_offsets.push_back(_entity_types.size());
if (tdim > 0)
_entity_type_offsets.push_back(_entity_types.size());

std::int8_t conn_size = _entity_type_offsets.back();
_index_map.resize(conn_size);
Expand Down
1 change: 1 addition & 0 deletions python/test/unit/mesh/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ def test_submesh_full(d, n, codim, marker, ghost_mode, simplex):
edim = max(mesh.topology.dim - codim, 0)
entities = locate_entities(mesh, edim, marker)
submesh, entity_map, vertex_map, geom_map = create_submesh(mesh, edim, entities)
assert submesh.topology.dim == edim
submesh_topology_test(mesh, submesh, entity_map, vertex_map, edim)
submesh_geometry_test(mesh, submesh, entity_map, geom_map, edim)

Expand Down

0 comments on commit c1ac475

Please sign in to comment.