// TetGen mesh with material array TEST(FileIO, TetGenMeshReaderWithMaterials) { std::string const node_name (BaseLib::BuildInfo::data_path + "/FileIO/twolayermdl.node"); std::string const ele_name (BaseLib::BuildInfo::data_path + "/FileIO/twolayermdl.ele"); FileIO::TetGenInterface tgi; std::unique_ptr<MeshLib::Mesh> mesh (tgi.readTetGenMesh(node_name, ele_name)); ASSERT_TRUE(mesh != nullptr); ASSERT_EQ(1378, mesh->getNumberOfNodes()); ASSERT_EQ(5114, mesh->getNumberOfElements()); std::pair<int, int> bounds (MeshLib::MeshInformation::getValueBounds<int>(*mesh, "MaterialIDs")); ASSERT_EQ(-20, bounds.first); ASSERT_EQ(-10, bounds.second); }
// TetGen mesh without additional information TEST(FileIO, TetGenMeshReaderWithoutMaterials) { std::string const node_name (BaseLib::BuildInfo::data_path + "/FileIO/tetgen_example.node"); std::string const ele_name (BaseLib::BuildInfo::data_path + "/FileIO/tetgen_example.ele"); FileIO::TetGenInterface tgi; std::unique_ptr<MeshLib::Mesh> mesh (tgi.readTetGenMesh(node_name, ele_name)); ASSERT_TRUE(mesh != nullptr); ASSERT_EQ(202, mesh->getNumberOfNodes()); ASSERT_EQ(650, mesh->getNumberOfElements()); std::pair<int, int> bounds (MeshLib::MeshInformation::getValueBounds<int>(*mesh, "MaterialIDs")); ASSERT_EQ(std::numeric_limits<int>::max(), bounds.first); ASSERT_EQ(std::numeric_limits<int>::max(), bounds.second); }