diff --git a/docs/meshtags.py b/docs/meshtags.py index f4e719e..8f3e2f0 100644 --- a/docs/meshtags.py +++ b/docs/meshtags.py @@ -33,6 +33,7 @@ # Compute midpoints of entities entities = np.arange(e_map.size_local, dtype=np.int32) + mesh.topology.create_connectivity(i, mesh.topology.dim) entity_midpoints[i] = dolfinx.mesh.compute_midpoints(mesh, i, entities) # Associate each local index with its global index values = np.arange(e_map.size_local, dtype=np.int32) + e_map.local_range[0] @@ -67,6 +68,7 @@ def verify_meshtags(filename: Path): meshtags = adios4dolfinx.read_meshtags(filename, read_mesh, meshtag_name=f"meshtags_{i}") # Compute midpoints for all local entities on process + read_mesh.topology.create_connectivity(i, read_mesh.topology.dim) midpoints = dolfinx.mesh.compute_midpoints(read_mesh, i, meshtags.indices) # Compare locally computed midpoint with reference data for global_pos, midpoint in zip(meshtags.values, midpoints): diff --git a/tests/test_mesh_writer.py b/tests/test_mesh_writer.py index e789ed1..f405414 100644 --- a/tests/test_mesh_writer.py +++ b/tests/test_mesh_writer.py @@ -48,11 +48,13 @@ def compute_distance_matrix(points_A, points_B, tol=1e-12): new_cell_map = mesh_adios.topology.index_map(mesh_adios.topology.dim) assert cell_map.size_local == new_cell_map.size_local assert cell_map.num_ghosts == new_cell_map.num_ghosts + mesh.topology.create_connectivity(mesh.topology.dim, mesh.topology.dim) midpoints = dolfinx.mesh.compute_midpoints( mesh, mesh.topology.dim, np.arange(cell_map.size_local + cell_map.num_ghosts, dtype=np.int32), ) + mesh_adios.topology.create_connectivity(mesh_adios.topology.dim, mesh_adios.topology.dim) new_midpoints = dolfinx.mesh.compute_midpoints( mesh_adios, mesh_adios.topology.dim, diff --git a/tests/test_meshtags.py b/tests/test_meshtags.py index e57b2a8..a5a7baf 100644 --- a/tests/test_meshtags.py +++ b/tests/test_meshtags.py @@ -80,6 +80,7 @@ def generate_reference_map( Returns: Root rank returns the map, all other ranks return None """ + mesh.topology.create_connectivity(meshtag.dim, mesh.topology.dim) midpoints = dolfinx.mesh.compute_midpoints(mesh, meshtag.dim, meshtag.indices) e_map = mesh.topology.index_map(meshtag.dim) value_to_midpoint = {}