MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / TEST_F

Function TEST_F

tests/tools/MeshUtils/BoundaryFacesTest.h:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15};
16
17TEST_F(BoundaryFacesTest, CubeBoundary) {
18 MeshPtr mesh = load_mesh("cube.msh");
19 const size_t vertex_per_face = mesh->get_vertex_per_face();
20 BoundaryFaces bd(*mesh.get());
21 ASSERT_EQ(12, bd.get_num_boundaries());
22
23 // Check each boudnary vertex lies on the boundary.
24 // A vertex is on the boundary of cube if it has a coordinate
25 // equals 1 or -1
26 for (size_t i=0; i<12; i++) {
27 VectorI face = bd.get_boundary(i);
28 for (size_t j=0; j<vertex_per_face; j++) {
29 VectorF vertex = mesh->get_vertex(face[j]);
30 Float max_coordinate = *std::max_element(vertex.data(), vertex.data() + vertex.size());
31 Float min_coordinate = *std::min_element(vertex.data(), vertex.data() + vertex.size());
32 ASSERT_FLOAT_EQ(1.0, std::max(fabs(min_coordinate), fabs(max_coordinate)));
33 }
34 }
35}
36
37TEST_F(BoundaryFacesTest, BoundaryElementsContainsBoundary) {
38 MeshPtr mesh = load_mesh("cube.msh");

Callers

nothing calls this directly

Calls 12

load_meshFunction · 0.85
get_voxelMethod · 0.80
findMethod · 0.80
get_vertex_per_faceMethod · 0.45
getMethod · 0.45
get_num_boundariesMethod · 0.45
get_boundaryMethod · 0.45
get_vertexMethod · 0.45
sizeMethod · 0.45
get_boundary_elementMethod · 0.45
endMethod · 0.45
get_boundary_nodesMethod · 0.45

Tested by

no test coverage detected