MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / test_identity_partitioner

Function test_identity_partitioner

python/test/unit/refinement/test_refinement.py:219–241  ·  view source on GitHub ↗
(tdim, ghost_mode)

Source from the content-addressed store, hash-verified

217@pytest.mark.parametrize("tdim", [1, 2, 3])
218@pytest.mark.parametrize("ghost_mode", [GhostMode.none, GhostMode.shared_facet])
219def test_identity_partitioner(tdim, ghost_mode):
220 n = 2
221 if tdim == 1:
222 mesh = create_unit_interval(MPI.COMM_WORLD, n)
223 elif tdim == 2:
224 mesh = create_unit_square(MPI.COMM_WORLD, n, n)
225 else:
226 mesh = create_unit_cube(MPI.COMM_WORLD, n, n, n)
227
228 cells = mesh.topology.index_map(mesh.topology.dim)
229 owning_process = np.full(cells.size_local + cells.num_ghosts, MPI.COMM_WORLD.rank)
230 owning_process[cells.size_local :] = cells.owners
231
232 mesh.topology.create_entities(1)
233 [mesh_fine, parent_cells, _] = refine(mesh)
234
235 cells_fine = mesh_fine.topology.index_map(mesh.topology.dim)
236 owning_process_fine = np.full(
237 cells_fine.size_local + cells_fine.num_ghosts, MPI.COMM_WORLD.rank
238 )
239 owning_process_fine[cells_fine.size_local :] = cells_fine.owners
240
241 assert np.all(owning_process_fine[: cells_fine.size_local] == owning_process[parent_cells])

Callers

nothing calls this directly

Calls 6

create_unit_intervalFunction · 0.90
create_unit_squareFunction · 0.90
create_unit_cubeFunction · 0.90
refineFunction · 0.90
index_mapMethod · 0.45
create_entitiesMethod · 0.45

Tested by

no test coverage detected