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

Function TEST_F

tests/src/Attributes/EdgeSquaredLengthAttributeTest.h:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9};
10
11TEST_F(EdgeSquaredLengthAttributeTest, tet) {
12 MeshPtr mesh = load_mesh("tet.msh");
13 const auto num_faces = mesh->get_num_faces();
14 const auto vertex_per_face = mesh->get_vertex_per_face();
15 mesh->add_attribute("edge_squared_length");
16 ASSERT_TRUE(mesh->has_attribute("edge_squared_length"));
17 VectorF sq_lengths = mesh->get_attribute("edge_squared_length");
18 ASSERT_EQ(num_faces * vertex_per_face, sq_lengths.rows());
19 for (size_t i=0; i<num_faces; i++) {
20 for (size_t j=0; j<vertex_per_face; j++) {
21 ASSERT_NEAR(sq_lengths[i*vertex_per_face+j], sq_lengths[0], 1e-5);
22 }
23 }
24}
25
26TEST_F(EdgeSquaredLengthAttributeTest, hex) {
27 MeshPtr mesh = load_mesh("hex.msh");

Callers

nothing calls this directly

Calls 6

load_meshFunction · 0.85
get_num_facesMethod · 0.45
get_vertex_per_faceMethod · 0.45
add_attributeMethod · 0.45
has_attributeMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected