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

Function test_local_dimension

python/test/unit/fem/test_dofmap.py:201–221  ·  view source on GitHub ↗
(mesh_factory)

Source from the content-addressed store, hash-verified

199 ],
200)
201def test_local_dimension(mesh_factory):
202 func, args = mesh_factory
203 mesh = func(*args)
204
205 v = element("Lagrange", mesh.basix_cell(), 1, dtype=default_real_type)
206 q = element(
207 "Lagrange", mesh.basix_cell(), 1, shape=(mesh.geometry.dim,), dtype=default_real_type
208 )
209 w = v * q
210
211 V = functionspace(mesh, v)
212 Q = functionspace(mesh, q)
213 W = functionspace(mesh, w)
214 for space in [V, Q, W]:
215 dofmap = space.dofmap
216 local_to_global_map = dofmap.tabulate_local_to_global_dofs()
217 ownership_range = dofmap.index_set.size_local * dofmap.index_set.block_size
218 dim1 = dofmap().index_map.size_local()
219 dim2 = dofmap().index_map.num_ghosts()
220 assert dim1 == ownership_range[1] - ownership_range[0]
221 assert dim1 + dim2 == local_to_global_map.size
222
223
224@pytest.mark.skip

Callers

nothing calls this directly

Calls 5

functionspaceFunction · 0.90
funcFunction · 0.85
basix_cellMethod · 0.80
size_localMethod · 0.80
num_ghostsMethod · 0.80

Tested by

no test coverage detected