| 9 | }; |
| 10 | |
| 11 | TEST_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 | |
| 26 | TEST_F(EdgeSquaredLengthAttributeTest, hex) { |
| 27 | MeshPtr mesh = load_mesh("hex.msh"); |
nothing calls this directly
no test coverage detected