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

Function test_create_unit_square

python/test/unit/mesh/test_mesh.py:267–274  ·  view source on GitHub ↗

Create mesh of unit square.

(comm, dtype)

Source from the content-addressed store, hash-verified

265@pytest.mark.parametrize("dtype", [np.float32, np.float64])
266@pytest.mark.parametrize("comm", [MPI.COMM_SELF, MPI.COMM_WORLD])
267def test_create_unit_square(comm, dtype):
268 """Create mesh of unit square."""
269 mesh = create_unit_square(comm, 5, 7, dtype=dtype)
270 assert mesh.topology.index_map(0).size_global == 48
271 assert mesh.topology.index_map(2).size_global == 70
272 assert mesh.geometry.dim == 2
273 assert mesh.comm.allreduce(mesh.topology.index_map(0).size_local, MPI.SUM) == 48
274 assert mesh.geometry.x.dtype == dtype
275
276
277@pytest.mark.parametrize("dtype", [np.float32, np.float64])

Callers

nothing calls this directly

Calls 2

create_unit_squareFunction · 0.90
index_mapMethod · 0.45

Tested by

no test coverage detected