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

Function test_block_size

python/test/unit/fem/test_dofmap.py:159–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157
158
159def test_block_size():
160 meshes = [
161 create_unit_square(MPI.COMM_WORLD, 8, 8),
162 create_unit_cube(MPI.COMM_WORLD, 4, 4, 4),
163 create_unit_square(MPI.COMM_WORLD, 8, 8, CellType.quadrilateral),
164 create_unit_cube(MPI.COMM_WORLD, 4, 4, 4, CellType.hexahedron),
165 ]
166 for mesh in meshes:
167 P2 = element("Lagrange", mesh.basix_cell(), 2, dtype=default_real_type)
168 V = functionspace(mesh, P2)
169 assert V.dofmap.bs == 1
170
171 # Only BlockedElements have index_map_bs > 1
172 V = functionspace(mesh, mixed_element([P2, P2]))
173 assert V.dofmap.index_map_bs == 1
174
175 for i in range(2, 6):
176 W = functionspace(mesh, mixed_element(i * [P2]))
177 assert W.dofmap.index_map_bs == 1
178
179 gdim = mesh.geometry.dim
180 V = functionspace(mesh, ("Lagrange", 2, (gdim,)))
181 assert V.dofmap.index_map_bs == mesh.geometry.dim
182
183
184@pytest.mark.skip

Callers

nothing calls this directly

Calls 5

create_unit_squareFunction · 0.90
create_unit_cubeFunction · 0.90
functionspaceFunction · 0.90
mixed_elementFunction · 0.85
basix_cellMethod · 0.80

Tested by

no test coverage detected