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

Function test_area

python/test/unit/mesh/test_face.py:29–41  ·  view source on GitHub ↗

Iterate over faces and sum area.

(cube, square)

Source from the content-addressed store, hash-verified

27@pytest.mark.skip("volume_entities needs fixing")
28@pytest.mark.skip_in_parallel
29def test_area(cube, square):
30 """Iterate over faces and sum area."""
31 # TODO: update for dim < tdim
32 # cube.topology.create_entities(2)
33 # area = dolfinx.cpp.mesh.volume_entities(cube, range(cube.num_entities(2)), 2).sum()
34 # assert area == pytest.approx(39.21320343559672494393)
35
36 map = square.topology.index_map(2)
37 num_faces = map.size_local + map.num_ghosts
38
39 cube.topology.create_entities(1)
40 area = _cpp.mesh.volume_entities(square, range(num_faces), 2).sum()
41 assert area == pytest.approx(1.0)
42
43
44def test_normals(cube, square):

Callers

nothing calls this directly

Calls 2

index_mapMethod · 0.45
create_entitiesMethod · 0.45

Tested by

no test coverage detected