diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 69df6ecdd1..c67c9e6505 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,10 +34,6 @@ set(TEST_SOURCES tools/TetMesh_examples.cpp tools/DEBUG_TetMesh.hpp tools/DEBUG_TetMesh.cpp - - simplicial_complex_tests/circle_mesh_tests.cpp - simplicial_complex_tests/3d_mesh_tests.cpp - ) add_executable(wmtk_tests ${TEST_SOURCES}) diff --git a/tests/simplicial_complex_tests/3d_mesh_tests.cpp b/tests/simplicial_complex_tests/3d_mesh_tests.cpp deleted file mode 100644 index 78e6aa4bb9..0000000000 --- a/tests/simplicial_complex_tests/3d_mesh_tests.cpp +++ /dev/null @@ -1,3961 +0,0 @@ -#include -#include -#include -#include "../tools/DEBUG_TetMesh.hpp" - -using namespace wmtk; -constexpr PrimitiveType PV = PrimitiveType::Vertex; -constexpr PrimitiveType PE = PrimitiveType::Edge; -constexpr PrimitiveType PF = PrimitiveType::Face; -constexpr PrimitiveType PT = PrimitiveType::Tetrahedron; - -namespace { -std::vector> get_sorted_sc( - const tests_3d::DEBUG_TetMesh& m, - const std::vector& sc) -{ - std::vector> ret; - for (auto s : sc) { - std::vector s_vec; - Tuple t = s.tuple(); - switch (s.primitive_type()) { - case PV: s_vec.push_back(m.id(t, PV)); break; - case PE: - s_vec.push_back(m.id(t, PV)); - s_vec.push_back(m.id(m.switch_vertex(t), PV)); - break; - case PF: - s_vec.push_back(m.id(t, PV)); - s_vec.push_back(m.id(m.switch_vertex(t), PV)); - s_vec.push_back(m.id(m.switch_vertex(m.switch_edge(t)), PV)); - /* code */ - break; - case PT: - // TODO: need implement for tet - s_vec.push_back(m.id(t, PV)); - s_vec.push_back(m.id(m.switch_vertex(t), PV)); - s_vec.push_back(m.id(m.switch_vertex(m.switch_edge(t)), PV)); - s_vec.push_back(m.id(m.switch_vertex(m.switch_edge(m.switch_face(t))), PV)); - /* code */ - break; - default: break; - } - std::sort(s_vec.begin(), s_vec.end()); - ret.push_back(s_vec); - } - std::sort(ret.begin(), ret.end(), [](const std::vector& a, const std::vector& b) { - if (a.size() != b.size()) { - return a.size() < b.size(); - } - return a < b; - }); - return ret; -} -} - -TEST_CASE("link_bunny_tetwild_80", "[simplicial_complex][link][3D]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - std::cout << "here1" << std::endl; - - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - std::cout << T.rows() << " x " << T.cols() << std::endl; - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - std::cout << "here2" << std::endl; - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 807); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 39); - CHECK(sc_v[0][0] == 706); - CHECK(sc_v[1][0] == 749); - CHECK(sc_v[2][0] == 791); - CHECK(sc_v[3][0] == 839); - CHECK(sc_v[4][0] == 953); - CHECK(sc_v[5][0] == 975); - CHECK(sc_v[6][0] == 983); - CHECK(sc_v[7][0] == 1028); - CHECK(sc_v[8][0] == 7790); - CHECK(sc_v[9][0] == 7887); - CHECK(sc_v[10][0] == 706); - CHECK(sc_v[10][1] == 749); - CHECK(sc_v[11][0] == 706); - CHECK(sc_v[11][1] == 791); - CHECK(sc_v[12][0] == 706); - CHECK(sc_v[12][1] == 7887); - CHECK(sc_v[13][0] == 749); - CHECK(sc_v[13][1] == 839); - CHECK(sc_v[14][0] == 749); - CHECK(sc_v[14][1] == 7887); - CHECK(sc_v[15][0] == 791); - CHECK(sc_v[15][1] == 953); - CHECK(sc_v[16][0] == 791); - CHECK(sc_v[16][1] == 7887); - CHECK(sc_v[17][0] == 839); - CHECK(sc_v[17][1] == 975); - CHECK(sc_v[18][0] == 839); - CHECK(sc_v[18][1] == 7790); - CHECK(sc_v[19][0] == 839); - CHECK(sc_v[19][1] == 7887); - CHECK(sc_v[20][0] == 953); - CHECK(sc_v[20][1] == 983); - CHECK(sc_v[21][0] == 953); - CHECK(sc_v[21][1] == 7790); - CHECK(sc_v[22][0] == 953); - CHECK(sc_v[22][1] == 7887); - CHECK(sc_v[23][0] == 975); - CHECK(sc_v[23][1] == 1028); - CHECK(sc_v[24][0] == 975); - CHECK(sc_v[24][1] == 7790); - CHECK(sc_v[25][0] == 983); - CHECK(sc_v[25][1] == 1028); - CHECK(sc_v[26][0] == 983); - CHECK(sc_v[26][1] == 7790); - CHECK(sc_v[27][0] == 1028); - CHECK(sc_v[27][1] == 7790); - CHECK(sc_v[28][0] == 7790); - CHECK(sc_v[28][1] == 7887); - CHECK(sc_v[29][0] == 706); - CHECK(sc_v[29][1] == 749); - CHECK(sc_v[29][2] == 7887); - CHECK(sc_v[30][0] == 706); - CHECK(sc_v[30][1] == 791); - CHECK(sc_v[30][2] == 7887); - CHECK(sc_v[31][0] == 749); - CHECK(sc_v[31][1] == 839); - CHECK(sc_v[31][2] == 7887); - CHECK(sc_v[32][0] == 791); - CHECK(sc_v[32][1] == 953); - CHECK(sc_v[32][2] == 7887); - CHECK(sc_v[33][0] == 839); - CHECK(sc_v[33][1] == 975); - CHECK(sc_v[33][2] == 7790); - CHECK(sc_v[34][0] == 839); - CHECK(sc_v[34][1] == 7790); - CHECK(sc_v[34][2] == 7887); - CHECK(sc_v[35][0] == 953); - CHECK(sc_v[35][1] == 983); - CHECK(sc_v[35][2] == 7790); - CHECK(sc_v[36][0] == 953); - CHECK(sc_v[36][1] == 7790); - CHECK(sc_v[36][2] == 7887); - CHECK(sc_v[37][0] == 975); - CHECK(sc_v[37][1] == 1028); - CHECK(sc_v[37][2] == 7790); - CHECK(sc_v[38][0] == 983); - CHECK(sc_v[38][1] == 1028); - CHECK(sc_v[38][2] == 7790); - - t = m.tuple_from_id(PV, 4690); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 39); - CHECK(sc_v[0][0] == 4342); - CHECK(sc_v[1][0] == 4424); - CHECK(sc_v[2][0] == 4528); - CHECK(sc_v[3][0] == 4592); - CHECK(sc_v[4][0] == 4709); - CHECK(sc_v[5][0] == 4803); - CHECK(sc_v[6][0] == 4804); - CHECK(sc_v[7][0] == 4932); - CHECK(sc_v[8][0] == 7581); - CHECK(sc_v[9][0] == 7762); - CHECK(sc_v[10][0] == 4342); - CHECK(sc_v[10][1] == 4424); - CHECK(sc_v[11][0] == 4342); - CHECK(sc_v[11][1] == 4528); - CHECK(sc_v[12][0] == 4342); - CHECK(sc_v[12][1] == 7762); - CHECK(sc_v[13][0] == 4424); - CHECK(sc_v[13][1] == 4592); - CHECK(sc_v[14][0] == 4424); - CHECK(sc_v[14][1] == 7581); - CHECK(sc_v[15][0] == 4424); - CHECK(sc_v[15][1] == 7762); - CHECK(sc_v[16][0] == 4528); - CHECK(sc_v[16][1] == 4709); - CHECK(sc_v[17][0] == 4528); - CHECK(sc_v[17][1] == 7581); - CHECK(sc_v[18][0] == 4528); - CHECK(sc_v[18][1] == 7762); - CHECK(sc_v[19][0] == 4592); - CHECK(sc_v[19][1] == 4803); - CHECK(sc_v[20][0] == 4592); - CHECK(sc_v[20][1] == 7581); - CHECK(sc_v[21][0] == 4709); - CHECK(sc_v[21][1] == 4804); - CHECK(sc_v[22][0] == 4709); - CHECK(sc_v[22][1] == 7581); - CHECK(sc_v[23][0] == 4803); - CHECK(sc_v[23][1] == 4932); - CHECK(sc_v[24][0] == 4803); - CHECK(sc_v[24][1] == 7581); - CHECK(sc_v[25][0] == 4804); - CHECK(sc_v[25][1] == 4932); - CHECK(sc_v[26][0] == 4804); - CHECK(sc_v[26][1] == 7581); - CHECK(sc_v[27][0] == 4932); - CHECK(sc_v[27][1] == 7581); - CHECK(sc_v[28][0] == 7581); - CHECK(sc_v[28][1] == 7762); - CHECK(sc_v[29][0] == 4342); - CHECK(sc_v[29][1] == 4424); - CHECK(sc_v[29][2] == 7762); - CHECK(sc_v[30][0] == 4342); - CHECK(sc_v[30][1] == 4528); - CHECK(sc_v[30][2] == 7762); - CHECK(sc_v[31][0] == 4424); - CHECK(sc_v[31][1] == 4592); - CHECK(sc_v[31][2] == 7581); - CHECK(sc_v[32][0] == 4424); - CHECK(sc_v[32][1] == 7581); - CHECK(sc_v[32][2] == 7762); - CHECK(sc_v[33][0] == 4528); - CHECK(sc_v[33][1] == 4709); - CHECK(sc_v[33][2] == 7581); - CHECK(sc_v[34][0] == 4528); - CHECK(sc_v[34][1] == 7581); - CHECK(sc_v[34][2] == 7762); - CHECK(sc_v[35][0] == 4592); - CHECK(sc_v[35][1] == 4803); - CHECK(sc_v[35][2] == 7581); - CHECK(sc_v[36][0] == 4709); - CHECK(sc_v[36][1] == 4804); - CHECK(sc_v[36][2] == 7581); - CHECK(sc_v[37][0] == 4803); - CHECK(sc_v[37][1] == 4932); - CHECK(sc_v[37][2] == 7581); - CHECK(sc_v[38][0] == 4804); - CHECK(sc_v[38][1] == 4932); - CHECK(sc_v[38][2] == 7581); - - t = m.tuple_from_id(PV, 2050); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 27); - CHECK(sc_v[0][0] == 1943); - CHECK(sc_v[1][0] == 2011); - CHECK(sc_v[2][0] == 2065); - CHECK(sc_v[3][0] == 2082); - CHECK(sc_v[4][0] == 2099); - CHECK(sc_v[5][0] == 2112); - CHECK(sc_v[6][0] == 7344); - CHECK(sc_v[7][0] == 1943); - CHECK(sc_v[7][1] == 2011); - CHECK(sc_v[8][0] == 1943); - CHECK(sc_v[8][1] == 2065); - CHECK(sc_v[9][0] == 1943); - CHECK(sc_v[9][1] == 2082); - CHECK(sc_v[10][0] == 1943); - CHECK(sc_v[10][1] == 2112); - CHECK(sc_v[11][0] == 2011); - CHECK(sc_v[11][1] == 2065); - CHECK(sc_v[12][0] == 2065); - CHECK(sc_v[12][1] == 2099); - CHECK(sc_v[13][0] == 2065); - CHECK(sc_v[13][1] == 2112); - CHECK(sc_v[14][0] == 2065); - CHECK(sc_v[14][1] == 7344); - CHECK(sc_v[15][0] == 2082); - CHECK(sc_v[15][1] == 2099); - CHECK(sc_v[16][0] == 2082); - CHECK(sc_v[16][1] == 2112); - CHECK(sc_v[17][0] == 2082); - CHECK(sc_v[17][1] == 7344); - CHECK(sc_v[18][0] == 2099); - CHECK(sc_v[18][1] == 7344); - CHECK(sc_v[19][0] == 2112); - CHECK(sc_v[19][1] == 7344); - CHECK(sc_v[20][0] == 1943); - CHECK(sc_v[20][1] == 2011); - CHECK(sc_v[20][2] == 2065); - CHECK(sc_v[21][0] == 1943); - CHECK(sc_v[21][1] == 2065); - CHECK(sc_v[21][2] == 2112); - CHECK(sc_v[22][0] == 1943); - CHECK(sc_v[22][1] == 2082); - CHECK(sc_v[22][2] == 2112); - CHECK(sc_v[23][0] == 2065); - CHECK(sc_v[23][1] == 2099); - CHECK(sc_v[23][2] == 7344); - CHECK(sc_v[24][0] == 2065); - CHECK(sc_v[24][1] == 2112); - CHECK(sc_v[24][2] == 7344); - CHECK(sc_v[25][0] == 2082); - CHECK(sc_v[25][1] == 2099); - CHECK(sc_v[25][2] == 7344); - CHECK(sc_v[26][0] == 2082); - CHECK(sc_v[26][1] == 2112); - CHECK(sc_v[26][2] == 7344); - - t = m.edge_tuple_from_vids(2950, 2989); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 7); - CHECK(sc_e[0][0] == 2946); - CHECK(sc_e[1][0] == 2978); - CHECK(sc_e[2][0] == 2985); - CHECK(sc_e[3][0] == 3084); - CHECK(sc_e[4][0] == 2946); - CHECK(sc_e[4][1] == 2985); - CHECK(sc_e[5][0] == 2978); - CHECK(sc_e[5][1] == 3084); - CHECK(sc_e[6][0] == 2985); - CHECK(sc_e[6][1] == 3084); - - t = m.edge_tuple_from_vids(7631, 7940); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 10); - CHECK(sc_e[0][0] == 4379); - CHECK(sc_e[1][0] == 7360); - CHECK(sc_e[2][0] == 7361); - CHECK(sc_e[3][0] == 7550); - CHECK(sc_e[4][0] == 7760); - CHECK(sc_e[5][0] == 4379); - CHECK(sc_e[5][1] == 7360); - CHECK(sc_e[6][0] == 4379); - CHECK(sc_e[6][1] == 7361); - CHECK(sc_e[7][0] == 7360); - CHECK(sc_e[7][1] == 7550); - CHECK(sc_e[8][0] == 7361); - CHECK(sc_e[8][1] == 7760); - CHECK(sc_e[9][0] == 7550); - CHECK(sc_e[9][1] == 7760); - - t = m.edge_tuple_from_vids(4400, 4434); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 9); - CHECK(sc_e[0][0] == 4282); - CHECK(sc_e[1][0] == 4329); - CHECK(sc_e[2][0] == 4345); - CHECK(sc_e[3][0] == 4403); - CHECK(sc_e[4][0] == 4467); - CHECK(sc_e[5][0] == 4282); - CHECK(sc_e[5][1] == 4329); - CHECK(sc_e[6][0] == 4282); - CHECK(sc_e[6][1] == 4345); - CHECK(sc_e[7][0] == 4329); - CHECK(sc_e[7][1] == 4403); - CHECK(sc_e[8][0] == 4345); - CHECK(sc_e[8][1] == 4467); - - t = m.face_tuple_from_vids(2697, 2813, 2891); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 3288); - - t = m.face_tuple_from_vids(3752, 6123, 7417); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 1742); - CHECK(sc_f[1][0] == 7483); - - t = m.face_tuple_from_vids(3786, 3788, 7367); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 3665); - CHECK(sc_f[1][0] == 3850); - - t = m.tet_tuple_from_vids(5331, 5367, 5418, 5480); - sc_t = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 0); - - t = m.tet_tuple_from_vids(4834, 4894, 4959, 7523); - sc_t = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 0); - - t = m.tet_tuple_from_vids(3389, 3491, 3583, 3636); - sc_t = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 0); -} - -TEST_CASE("open_star_bunny_tetwild_80", "[simplicial_complex][open_star][3D]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 7295); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 30); - CHECK(sc_v[0][0] == 7295); - CHECK(sc_v[1][0] == 7270); - CHECK(sc_v[1][1] == 7295); - CHECK(sc_v[2][0] == 7272); - CHECK(sc_v[2][1] == 7295); - CHECK(sc_v[3][0] == 7277); - CHECK(sc_v[3][1] == 7295); - CHECK(sc_v[4][0] == 7285); - CHECK(sc_v[4][1] == 7295); - CHECK(sc_v[5][0] == 7295); - CHECK(sc_v[5][1] == 7304); - CHECK(sc_v[6][0] == 7295); - CHECK(sc_v[6][1] == 7313); - CHECK(sc_v[7][0] == 7295); - CHECK(sc_v[7][1] == 7316); - CHECK(sc_v[8][0] == 7295); - CHECK(sc_v[8][1] == 7432); - CHECK(sc_v[9][0] == 7270); - CHECK(sc_v[9][1] == 7277); - CHECK(sc_v[9][2] == 7295); - CHECK(sc_v[10][0] == 7270); - CHECK(sc_v[10][1] == 7285); - CHECK(sc_v[10][2] == 7295); - CHECK(sc_v[11][0] == 7270); - CHECK(sc_v[11][1] == 7295); - CHECK(sc_v[11][2] == 7432); - CHECK(sc_v[12][0] == 7272); - CHECK(sc_v[12][1] == 7277); - CHECK(sc_v[12][2] == 7295); - CHECK(sc_v[13][0] == 7272); - CHECK(sc_v[13][1] == 7295); - CHECK(sc_v[13][2] == 7304); - CHECK(sc_v[14][0] == 7272); - CHECK(sc_v[14][1] == 7295); - CHECK(sc_v[14][2] == 7432); - CHECK(sc_v[15][0] == 7277); - CHECK(sc_v[15][1] == 7295); - CHECK(sc_v[15][2] == 7432); - CHECK(sc_v[16][0] == 7285); - CHECK(sc_v[16][1] == 7295); - CHECK(sc_v[16][2] == 7313); - CHECK(sc_v[17][0] == 7285); - CHECK(sc_v[17][1] == 7295); - CHECK(sc_v[17][2] == 7432); - CHECK(sc_v[18][0] == 7295); - CHECK(sc_v[18][1] == 7304); - CHECK(sc_v[18][2] == 7316); - CHECK(sc_v[19][0] == 7295); - CHECK(sc_v[19][1] == 7304); - CHECK(sc_v[19][2] == 7432); - CHECK(sc_v[20][0] == 7295); - CHECK(sc_v[20][1] == 7313); - CHECK(sc_v[20][2] == 7316); - CHECK(sc_v[21][0] == 7295); - CHECK(sc_v[21][1] == 7313); - CHECK(sc_v[21][2] == 7432); - CHECK(sc_v[22][0] == 7295); - CHECK(sc_v[22][1] == 7316); - CHECK(sc_v[22][2] == 7432); - CHECK(sc_v[23][0] == 7270); - CHECK(sc_v[23][1] == 7277); - CHECK(sc_v[23][2] == 7295); - CHECK(sc_v[23][3] == 7432); - CHECK(sc_v[24][0] == 7270); - CHECK(sc_v[24][1] == 7285); - CHECK(sc_v[24][2] == 7295); - CHECK(sc_v[24][3] == 7432); - CHECK(sc_v[25][0] == 7272); - CHECK(sc_v[25][1] == 7277); - CHECK(sc_v[25][2] == 7295); - CHECK(sc_v[25][3] == 7432); - CHECK(sc_v[26][0] == 7272); - CHECK(sc_v[26][1] == 7295); - CHECK(sc_v[26][2] == 7304); - CHECK(sc_v[26][3] == 7432); - CHECK(sc_v[27][0] == 7285); - CHECK(sc_v[27][1] == 7295); - CHECK(sc_v[27][2] == 7313); - CHECK(sc_v[27][3] == 7432); - CHECK(sc_v[28][0] == 7295); - CHECK(sc_v[28][1] == 7304); - CHECK(sc_v[28][2] == 7316); - CHECK(sc_v[28][3] == 7432); - CHECK(sc_v[29][0] == 7295); - CHECK(sc_v[29][1] == 7313); - CHECK(sc_v[29][2] == 7316); - CHECK(sc_v[29][3] == 7432); - - t = m.tuple_from_id(PV, 6844); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 54); - CHECK(sc_v[0][0] == 6844); - CHECK(sc_v[1][0] == 2267); - CHECK(sc_v[1][1] == 6844); - CHECK(sc_v[2][0] == 6779); - CHECK(sc_v[2][1] == 6844); - CHECK(sc_v[3][0] == 6798); - CHECK(sc_v[3][1] == 6844); - CHECK(sc_v[4][0] == 6838); - CHECK(sc_v[4][1] == 6844); - CHECK(sc_v[5][0] == 6841); - CHECK(sc_v[5][1] == 6844); - CHECK(sc_v[6][0] == 6844); - CHECK(sc_v[6][1] == 6871); - CHECK(sc_v[7][0] == 6844); - CHECK(sc_v[7][1] == 6893); - CHECK(sc_v[8][0] == 6844); - CHECK(sc_v[8][1] == 6897); - CHECK(sc_v[9][0] == 6844); - CHECK(sc_v[9][1] == 7426); - CHECK(sc_v[10][0] == 6844); - CHECK(sc_v[10][1] == 7524); - CHECK(sc_v[11][0] == 6844); - CHECK(sc_v[11][1] == 7791); - CHECK(sc_v[12][0] == 6844); - CHECK(sc_v[12][1] == 7845); - CHECK(sc_v[13][0] == 2267); - CHECK(sc_v[13][1] == 6844); - CHECK(sc_v[13][2] == 6871); - CHECK(sc_v[14][0] == 2267); - CHECK(sc_v[14][1] == 6844); - CHECK(sc_v[14][2] == 6893); - CHECK(sc_v[15][0] == 2267); - CHECK(sc_v[15][1] == 6844); - CHECK(sc_v[15][2] == 7426); - CHECK(sc_v[16][0] == 2267); - CHECK(sc_v[16][1] == 6844); - CHECK(sc_v[16][2] == 7524); - CHECK(sc_v[17][0] == 6779); - CHECK(sc_v[17][1] == 6798); - CHECK(sc_v[17][2] == 6844); - CHECK(sc_v[18][0] == 6779); - CHECK(sc_v[18][1] == 6841); - CHECK(sc_v[18][2] == 6844); - CHECK(sc_v[19][0] == 6779); - CHECK(sc_v[19][1] == 6844); - CHECK(sc_v[19][2] == 7524); - CHECK(sc_v[20][0] == 6779); - CHECK(sc_v[20][1] == 6844); - CHECK(sc_v[20][2] == 7791); - CHECK(sc_v[21][0] == 6798); - CHECK(sc_v[21][1] == 6838); - CHECK(sc_v[21][2] == 6844); - CHECK(sc_v[22][0] == 6798); - CHECK(sc_v[22][1] == 6844); - CHECK(sc_v[22][2] == 7524); - CHECK(sc_v[23][0] == 6838); - CHECK(sc_v[23][1] == 6844); - CHECK(sc_v[23][2] == 6871); - CHECK(sc_v[24][0] == 6838); - CHECK(sc_v[24][1] == 6844); - CHECK(sc_v[24][2] == 7524); - CHECK(sc_v[25][0] == 6841); - CHECK(sc_v[25][1] == 6844); - CHECK(sc_v[25][2] == 6897); - CHECK(sc_v[26][0] == 6841); - CHECK(sc_v[26][1] == 6844); - CHECK(sc_v[26][2] == 7791); - CHECK(sc_v[27][0] == 6844); - CHECK(sc_v[27][1] == 6871); - CHECK(sc_v[27][2] == 6893); - CHECK(sc_v[28][0] == 6844); - CHECK(sc_v[28][1] == 6871); - CHECK(sc_v[28][2] == 7524); - CHECK(sc_v[29][0] == 6844); - CHECK(sc_v[29][1] == 6893); - CHECK(sc_v[29][2] == 6897); - CHECK(sc_v[30][0] == 6844); - CHECK(sc_v[30][1] == 6893); - CHECK(sc_v[30][2] == 7426); - CHECK(sc_v[31][0] == 6844); - CHECK(sc_v[31][1] == 6893); - CHECK(sc_v[31][2] == 7845); - CHECK(sc_v[32][0] == 6844); - CHECK(sc_v[32][1] == 6897); - CHECK(sc_v[32][2] == 7791); - CHECK(sc_v[33][0] == 6844); - CHECK(sc_v[33][1] == 6897); - CHECK(sc_v[33][2] == 7845); - CHECK(sc_v[34][0] == 6844); - CHECK(sc_v[34][1] == 7426); - CHECK(sc_v[34][2] == 7524); - CHECK(sc_v[35][0] == 6844); - CHECK(sc_v[35][1] == 7426); - CHECK(sc_v[35][2] == 7791); - CHECK(sc_v[36][0] == 6844); - CHECK(sc_v[36][1] == 7426); - CHECK(sc_v[36][2] == 7845); - CHECK(sc_v[37][0] == 6844); - CHECK(sc_v[37][1] == 7524); - CHECK(sc_v[37][2] == 7791); - CHECK(sc_v[38][0] == 6844); - CHECK(sc_v[38][1] == 7791); - CHECK(sc_v[38][2] == 7845); - CHECK(sc_v[39][0] == 2267); - CHECK(sc_v[39][1] == 6844); - CHECK(sc_v[39][2] == 6871); - CHECK(sc_v[39][3] == 6893); - CHECK(sc_v[40][0] == 2267); - CHECK(sc_v[40][1] == 6844); - CHECK(sc_v[40][2] == 6871); - CHECK(sc_v[40][3] == 7524); - CHECK(sc_v[41][0] == 2267); - CHECK(sc_v[41][1] == 6844); - CHECK(sc_v[41][2] == 6893); - CHECK(sc_v[41][3] == 7426); - CHECK(sc_v[42][0] == 2267); - CHECK(sc_v[42][1] == 6844); - CHECK(sc_v[42][2] == 7426); - CHECK(sc_v[42][3] == 7524); - CHECK(sc_v[43][0] == 6779); - CHECK(sc_v[43][1] == 6798); - CHECK(sc_v[43][2] == 6844); - CHECK(sc_v[43][3] == 7524); - CHECK(sc_v[44][0] == 6779); - CHECK(sc_v[44][1] == 6841); - CHECK(sc_v[44][2] == 6844); - CHECK(sc_v[44][3] == 7791); - CHECK(sc_v[45][0] == 6779); - CHECK(sc_v[45][1] == 6844); - CHECK(sc_v[45][2] == 7524); - CHECK(sc_v[45][3] == 7791); - CHECK(sc_v[46][0] == 6798); - CHECK(sc_v[46][1] == 6838); - CHECK(sc_v[46][2] == 6844); - CHECK(sc_v[46][3] == 7524); - CHECK(sc_v[47][0] == 6838); - CHECK(sc_v[47][1] == 6844); - CHECK(sc_v[47][2] == 6871); - CHECK(sc_v[47][3] == 7524); - CHECK(sc_v[48][0] == 6841); - CHECK(sc_v[48][1] == 6844); - CHECK(sc_v[48][2] == 6897); - CHECK(sc_v[48][3] == 7791); - CHECK(sc_v[49][0] == 6844); - CHECK(sc_v[49][1] == 6893); - CHECK(sc_v[49][2] == 6897); - CHECK(sc_v[49][3] == 7845); - CHECK(sc_v[50][0] == 6844); - CHECK(sc_v[50][1] == 6893); - CHECK(sc_v[50][2] == 7426); - CHECK(sc_v[50][3] == 7845); - CHECK(sc_v[51][0] == 6844); - CHECK(sc_v[51][1] == 6897); - CHECK(sc_v[51][2] == 7791); - CHECK(sc_v[51][3] == 7845); - CHECK(sc_v[52][0] == 6844); - CHECK(sc_v[52][1] == 7426); - CHECK(sc_v[52][2] == 7524); - CHECK(sc_v[52][3] == 7791); - CHECK(sc_v[53][0] == 6844); - CHECK(sc_v[53][1] == 7426); - CHECK(sc_v[53][2] == 7791); - CHECK(sc_v[53][3] == 7845); - - t = m.tuple_from_id(PV, 2473); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 26); - CHECK(sc_v[0][0] == 2473); - CHECK(sc_v[1][0] == 2172); - CHECK(sc_v[1][1] == 2473); - CHECK(sc_v[2][0] == 2310); - CHECK(sc_v[2][1] == 2473); - CHECK(sc_v[3][0] == 2470); - CHECK(sc_v[3][1] == 2473); - CHECK(sc_v[4][0] == 2473); - CHECK(sc_v[4][1] == 2577); - CHECK(sc_v[5][0] == 2473); - CHECK(sc_v[5][1] == 2605); - CHECK(sc_v[6][0] == 2473); - CHECK(sc_v[6][1] == 2633); - CHECK(sc_v[7][0] == 2473); - CHECK(sc_v[7][1] == 7347); - CHECK(sc_v[8][0] == 2172); - CHECK(sc_v[8][1] == 2310); - CHECK(sc_v[8][2] == 2473); - CHECK(sc_v[9][0] == 2172); - CHECK(sc_v[9][1] == 2473); - CHECK(sc_v[9][2] == 2633); - CHECK(sc_v[10][0] == 2172); - CHECK(sc_v[10][1] == 2473); - CHECK(sc_v[10][2] == 7347); - CHECK(sc_v[11][0] == 2310); - CHECK(sc_v[11][1] == 2470); - CHECK(sc_v[11][2] == 2473); - CHECK(sc_v[12][0] == 2310); - CHECK(sc_v[12][1] == 2473); - CHECK(sc_v[12][2] == 7347); - CHECK(sc_v[13][0] == 2470); - CHECK(sc_v[13][1] == 2473); - CHECK(sc_v[13][2] == 2577); - CHECK(sc_v[14][0] == 2470); - CHECK(sc_v[14][1] == 2473); - CHECK(sc_v[14][2] == 2605); - CHECK(sc_v[15][0] == 2470); - CHECK(sc_v[15][1] == 2473); - CHECK(sc_v[15][2] == 7347); - CHECK(sc_v[16][0] == 2473); - CHECK(sc_v[16][1] == 2577); - CHECK(sc_v[16][2] == 2605); - CHECK(sc_v[17][0] == 2473); - CHECK(sc_v[17][1] == 2577); - CHECK(sc_v[17][2] == 2633); - CHECK(sc_v[18][0] == 2473); - CHECK(sc_v[18][1] == 2577); - CHECK(sc_v[18][2] == 7347); - CHECK(sc_v[19][0] == 2473); - CHECK(sc_v[19][1] == 2633); - CHECK(sc_v[19][2] == 7347); - CHECK(sc_v[20][0] == 2172); - CHECK(sc_v[20][1] == 2310); - CHECK(sc_v[20][2] == 2473); - CHECK(sc_v[20][3] == 7347); - CHECK(sc_v[21][0] == 2172); - CHECK(sc_v[21][1] == 2473); - CHECK(sc_v[21][2] == 2633); - CHECK(sc_v[21][3] == 7347); - CHECK(sc_v[22][0] == 2310); - CHECK(sc_v[22][1] == 2470); - CHECK(sc_v[22][2] == 2473); - CHECK(sc_v[22][3] == 7347); - CHECK(sc_v[23][0] == 2470); - CHECK(sc_v[23][1] == 2473); - CHECK(sc_v[23][2] == 2577); - CHECK(sc_v[23][3] == 2605); - CHECK(sc_v[24][0] == 2470); - CHECK(sc_v[24][1] == 2473); - CHECK(sc_v[24][2] == 2577); - CHECK(sc_v[24][3] == 7347); - CHECK(sc_v[25][0] == 2473); - CHECK(sc_v[25][1] == 2577); - CHECK(sc_v[25][2] == 2633); - CHECK(sc_v[25][3] == 7347); - - t = m.edge_tuple_from_vids(4753, 4819); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 6); - CHECK(sc_e[0][0] == 4753); - CHECK(sc_e[0][1] == 4819); - CHECK(sc_e[1][0] == 4704); - CHECK(sc_e[1][1] == 4753); - CHECK(sc_e[1][2] == 4819); - CHECK(sc_e[2][0] == 4753); - CHECK(sc_e[2][1] == 4819); - CHECK(sc_e[2][2] == 4871); - CHECK(sc_e[3][0] == 4753); - CHECK(sc_e[3][1] == 4819); - CHECK(sc_e[3][2] == 7385); - CHECK(sc_e[4][0] == 4704); - CHECK(sc_e[4][1] == 4753); - CHECK(sc_e[4][2] == 4819); - CHECK(sc_e[4][3] == 7385); - CHECK(sc_e[5][0] == 4753); - CHECK(sc_e[5][1] == 4819); - CHECK(sc_e[5][2] == 4871); - CHECK(sc_e[5][3] == 7385); - - t = m.edge_tuple_from_vids(6925, 7845); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 6925); - CHECK(sc_e[0][1] == 7845); - CHECK(sc_e[1][0] == 6893); - CHECK(sc_e[1][1] == 6925); - CHECK(sc_e[1][2] == 7845); - CHECK(sc_e[2][0] == 6925); - CHECK(sc_e[2][1] == 6961); - CHECK(sc_e[2][2] == 7845); - CHECK(sc_e[3][0] == 6925); - CHECK(sc_e[3][1] == 6979); - CHECK(sc_e[3][2] == 7845); - CHECK(sc_e[4][0] == 6925); - CHECK(sc_e[4][1] == 6994); - CHECK(sc_e[4][2] == 7845); - CHECK(sc_e[5][0] == 6925); - CHECK(sc_e[5][1] == 7426); - CHECK(sc_e[5][2] == 7845); - CHECK(sc_e[6][0] == 6893); - CHECK(sc_e[6][1] == 6925); - CHECK(sc_e[6][2] == 6994); - CHECK(sc_e[6][3] == 7845); - CHECK(sc_e[7][0] == 6893); - CHECK(sc_e[7][1] == 6925); - CHECK(sc_e[7][2] == 7426); - CHECK(sc_e[7][3] == 7845); - CHECK(sc_e[8][0] == 6925); - CHECK(sc_e[8][1] == 6961); - CHECK(sc_e[8][2] == 6979); - CHECK(sc_e[8][3] == 7845); - CHECK(sc_e[9][0] == 6925); - CHECK(sc_e[9][1] == 6961); - CHECK(sc_e[9][2] == 7426); - CHECK(sc_e[9][3] == 7845); - CHECK(sc_e[10][0] == 6925); - CHECK(sc_e[10][1] == 6979); - CHECK(sc_e[10][2] == 6994); - CHECK(sc_e[10][3] == 7845); - - t = m.edge_tuple_from_vids(2310, 7347); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 2310); - CHECK(sc_e[0][1] == 7347); - CHECK(sc_e[1][0] == 1780); - CHECK(sc_e[1][1] == 2310); - CHECK(sc_e[1][2] == 7347); - CHECK(sc_e[2][0] == 2172); - CHECK(sc_e[2][1] == 2310); - CHECK(sc_e[2][2] == 7347); - CHECK(sc_e[3][0] == 2310); - CHECK(sc_e[3][1] == 2470); - CHECK(sc_e[3][2] == 7347); - CHECK(sc_e[4][0] == 2310); - CHECK(sc_e[4][1] == 2473); - CHECK(sc_e[4][2] == 7347); - CHECK(sc_e[5][0] == 2310); - CHECK(sc_e[5][1] == 7347); - CHECK(sc_e[5][2] == 7880); - CHECK(sc_e[6][0] == 1780); - CHECK(sc_e[6][1] == 2172); - CHECK(sc_e[6][2] == 2310); - CHECK(sc_e[6][3] == 7347); - CHECK(sc_e[7][0] == 1780); - CHECK(sc_e[7][1] == 2310); - CHECK(sc_e[7][2] == 7347); - CHECK(sc_e[7][3] == 7880); - CHECK(sc_e[8][0] == 2172); - CHECK(sc_e[8][1] == 2310); - CHECK(sc_e[8][2] == 2473); - CHECK(sc_e[8][3] == 7347); - CHECK(sc_e[9][0] == 2310); - CHECK(sc_e[9][1] == 2470); - CHECK(sc_e[9][2] == 2473); - CHECK(sc_e[9][3] == 7347); - CHECK(sc_e[10][0] == 2310); - CHECK(sc_e[10][1] == 2470); - CHECK(sc_e[10][2] == 7347); - CHECK(sc_e[10][3] == 7880); - - t = m.face_tuple_from_vids(2497, 2648, 7354); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 2497); - CHECK(sc_f[0][1] == 2648); - CHECK(sc_f[0][2] == 7354); - CHECK(sc_f[1][0] == 2497); - CHECK(sc_f[1][1] == 2563); - CHECK(sc_f[1][2] == 2648); - CHECK(sc_f[1][3] == 7354); - CHECK(sc_f[2][0] == 2497); - CHECK(sc_f[2][1] == 2579); - CHECK(sc_f[2][2] == 2648); - CHECK(sc_f[2][3] == 7354); - - t = m.face_tuple_from_vids(4908, 5048, 7943); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 4908); - CHECK(sc_f[0][1] == 5048); - CHECK(sc_f[0][2] == 7943); - CHECK(sc_f[1][0] == 4908); - CHECK(sc_f[1][1] == 5048); - CHECK(sc_f[1][2] == 5077); - CHECK(sc_f[1][3] == 7943); - CHECK(sc_f[2][0] == 4908); - CHECK(sc_f[2][1] == 5048); - CHECK(sc_f[2][2] == 5180); - CHECK(sc_f[2][3] == 7943); - - t = m.face_tuple_from_vids(5400, 5721, 7706); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 5400); - CHECK(sc_f[0][1] == 5721); - CHECK(sc_f[0][2] == 7706); - CHECK(sc_f[1][0] == 5400); - CHECK(sc_f[1][1] == 5506); - CHECK(sc_f[1][2] == 5721); - CHECK(sc_f[1][3] == 7706); - CHECK(sc_f[2][0] == 5400); - CHECK(sc_f[2][1] == 5721); - CHECK(sc_f[2][2] == 5802); - CHECK(sc_f[2][3] == 7706); - - t = m.tet_tuple_from_vids(6848, 7442, 7519, 7622); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 6848); - CHECK(sc_t[0][1] == 7442); - CHECK(sc_t[0][2] == 7519); - CHECK(sc_t[0][3] == 7622); - - t = m.tet_tuple_from_vids(5135, 7611, 7881, 7912); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 5135); - CHECK(sc_t[0][1] == 7611); - CHECK(sc_t[0][2] == 7881); - CHECK(sc_t[0][3] == 7912); - - t = m.tet_tuple_from_vids(1272, 1383, 7329, 7790); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 1272); - CHECK(sc_t[0][1] == 1383); - CHECK(sc_t[0][2] == 7329); - CHECK(sc_t[0][3] == 7790); -} - -TEST_CASE("closed_star_bunny_tetwild_80", "[simplicial_complex][closed_star][3D]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 4869); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - for (int i = 0; i < sc_v.size(); i++) { - std::cout << i << ": "; - for (int j = 0; j < sc_v[i].size(); j++) { - std::cout << sc_v[i][j] << " "; - } - std::cout << std::endl; - } - REQUIRE(sc_v.size() == 39); - CHECK(sc_v[0][0] == 4830); - CHECK(sc_v[1][0] == 4839); - CHECK(sc_v[2][0] == 4844); - CHECK(sc_v[3][0] == 4845); - CHECK(sc_v[4][0] == 4869); - CHECK(sc_v[5][0] == 4911); - CHECK(sc_v[6][0] == 4937); - CHECK(sc_v[7][0] == 4830); - CHECK(sc_v[7][1] == 4844); - CHECK(sc_v[8][0] == 4830); - CHECK(sc_v[8][1] == 4845); - CHECK(sc_v[9][0] == 4830); - CHECK(sc_v[9][1] == 4869); - CHECK(sc_v[10][0] == 4830); - CHECK(sc_v[10][1] == 4911); - CHECK(sc_v[11][0] == 4839); - CHECK(sc_v[11][1] == 4844); - CHECK(sc_v[12][0] == 4839); - CHECK(sc_v[12][1] == 4845); - CHECK(sc_v[13][0] == 4839); - CHECK(sc_v[13][1] == 4869); - CHECK(sc_v[14][0] == 4844); - CHECK(sc_v[14][1] == 4845); - CHECK(sc_v[15][0] == 4844); - CHECK(sc_v[15][1] == 4869); - CHECK(sc_v[16][0] == 4845); - CHECK(sc_v[16][1] == 4869); - CHECK(sc_v[17][0] == 4845); - CHECK(sc_v[17][1] == 4911); - CHECK(sc_v[18][0] == 4845); - CHECK(sc_v[18][1] == 4937); - CHECK(sc_v[19][0] == 4869); - CHECK(sc_v[19][1] == 4911); - CHECK(sc_v[20][0] == 4869); - CHECK(sc_v[20][1] == 4937); - CHECK(sc_v[21][0] == 4911); - CHECK(sc_v[21][1] == 4937); - CHECK(sc_v[22][0] == 4830); - CHECK(sc_v[22][1] == 4844); - CHECK(sc_v[22][2] == 4845); - CHECK(sc_v[23][0] == 4830); - CHECK(sc_v[23][1] == 4844); - CHECK(sc_v[23][2] == 4869); - CHECK(sc_v[24][0] == 4830); - CHECK(sc_v[24][1] == 4845); - CHECK(sc_v[24][2] == 4869); - CHECK(sc_v[25][0] == 4830); - CHECK(sc_v[25][1] == 4845); - CHECK(sc_v[25][2] == 4911); - CHECK(sc_v[26][0] == 4830); - CHECK(sc_v[26][1] == 4869); - CHECK(sc_v[26][2] == 4911); - CHECK(sc_v[27][0] == 4839); - CHECK(sc_v[27][1] == 4844); - CHECK(sc_v[27][2] == 4845); - CHECK(sc_v[28][0] == 4839); - CHECK(sc_v[28][1] == 4844); - CHECK(sc_v[28][2] == 4869); - CHECK(sc_v[29][0] == 4839); - CHECK(sc_v[29][1] == 4845); - CHECK(sc_v[29][2] == 4869); - CHECK(sc_v[30][0] == 4844); - CHECK(sc_v[30][1] == 4845); - CHECK(sc_v[30][2] == 4869); - CHECK(sc_v[31][0] == 4845); - CHECK(sc_v[31][1] == 4869); - CHECK(sc_v[31][2] == 4911); - CHECK(sc_v[32][0] == 4845); - CHECK(sc_v[32][1] == 4869); - CHECK(sc_v[32][2] == 4937); - CHECK(sc_v[33][0] == 4845); - CHECK(sc_v[33][1] == 4911); - CHECK(sc_v[33][2] == 4937); - CHECK(sc_v[34][0] == 4869); - CHECK(sc_v[34][1] == 4911); - CHECK(sc_v[34][2] == 4937); - CHECK(sc_v[35][0] == 4830); - CHECK(sc_v[35][1] == 4844); - CHECK(sc_v[35][2] == 4845); - CHECK(sc_v[35][3] == 4869); - CHECK(sc_v[36][0] == 4830); - CHECK(sc_v[36][1] == 4845); - CHECK(sc_v[36][2] == 4869); - CHECK(sc_v[36][3] == 4911); - CHECK(sc_v[37][0] == 4839); - CHECK(sc_v[37][1] == 4844); - CHECK(sc_v[37][2] == 4845); - CHECK(sc_v[37][3] == 4869); - CHECK(sc_v[38][0] == 4845); - CHECK(sc_v[38][1] == 4869); - CHECK(sc_v[38][2] == 4911); - CHECK(sc_v[38][3] == 4937); - - t = m.tuple_from_id(PV, 4940); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 107); - CHECK(sc_v[0][0] == 2480); - CHECK(sc_v[1][0] == 4840); - CHECK(sc_v[2][0] == 4855); - CHECK(sc_v[3][0] == 4872); - CHECK(sc_v[4][0] == 4900); - CHECK(sc_v[5][0] == 4940); - CHECK(sc_v[6][0] == 4965); - CHECK(sc_v[7][0] == 5014); - CHECK(sc_v[8][0] == 5016); - CHECK(sc_v[9][0] == 5018); - CHECK(sc_v[10][0] == 5095); - CHECK(sc_v[11][0] == 7552); - CHECK(sc_v[12][0] == 7722); - CHECK(sc_v[13][0] == 2480); - CHECK(sc_v[13][1] == 4855); - CHECK(sc_v[14][0] == 2480); - CHECK(sc_v[14][1] == 4940); - CHECK(sc_v[15][0] == 2480); - CHECK(sc_v[15][1] == 4965); - CHECK(sc_v[16][0] == 2480); - CHECK(sc_v[16][1] == 5014); - CHECK(sc_v[17][0] == 2480); - CHECK(sc_v[17][1] == 5016); - CHECK(sc_v[18][0] == 2480); - CHECK(sc_v[18][1] == 5095); - CHECK(sc_v[19][0] == 2480); - CHECK(sc_v[19][1] == 7552); - CHECK(sc_v[20][0] == 2480); - CHECK(sc_v[20][1] == 7722); - CHECK(sc_v[21][0] == 4840); - CHECK(sc_v[21][1] == 4855); - CHECK(sc_v[22][0] == 4840); - CHECK(sc_v[22][1] == 4872); - CHECK(sc_v[23][0] == 4840); - CHECK(sc_v[23][1] == 4900); - CHECK(sc_v[24][0] == 4840); - CHECK(sc_v[24][1] == 4940); - CHECK(sc_v[25][0] == 4840); - CHECK(sc_v[25][1] == 7552); - CHECK(sc_v[26][0] == 4855); - CHECK(sc_v[26][1] == 4900); - CHECK(sc_v[27][0] == 4855); - CHECK(sc_v[27][1] == 4940); - CHECK(sc_v[28][0] == 4855); - CHECK(sc_v[28][1] == 5014); - CHECK(sc_v[29][0] == 4855); - CHECK(sc_v[29][1] == 7552); - CHECK(sc_v[30][0] == 4872); - CHECK(sc_v[30][1] == 4940); - CHECK(sc_v[31][0] == 4872); - CHECK(sc_v[31][1] == 4965); - CHECK(sc_v[32][0] == 4872); - CHECK(sc_v[32][1] == 7552); - CHECK(sc_v[33][0] == 4900); - CHECK(sc_v[33][1] == 4940); - CHECK(sc_v[34][0] == 4900); - CHECK(sc_v[34][1] == 5014); - CHECK(sc_v[35][0] == 4900); - CHECK(sc_v[35][1] == 5018); - CHECK(sc_v[36][0] == 4900); - CHECK(sc_v[36][1] == 5095); - CHECK(sc_v[37][0] == 4940); - CHECK(sc_v[37][1] == 4965); - CHECK(sc_v[38][0] == 4940); - CHECK(sc_v[38][1] == 5014); - CHECK(sc_v[39][0] == 4940); - CHECK(sc_v[39][1] == 5016); - CHECK(sc_v[40][0] == 4940); - CHECK(sc_v[40][1] == 5018); - CHECK(sc_v[41][0] == 4940); - CHECK(sc_v[41][1] == 5095); - CHECK(sc_v[42][0] == 4940); - CHECK(sc_v[42][1] == 7552); - CHECK(sc_v[43][0] == 4940); - CHECK(sc_v[43][1] == 7722); - CHECK(sc_v[44][0] == 4965); - CHECK(sc_v[44][1] == 7552); - CHECK(sc_v[45][0] == 4965); - CHECK(sc_v[45][1] == 7722); - CHECK(sc_v[46][0] == 5014); - CHECK(sc_v[46][1] == 5095); - CHECK(sc_v[47][0] == 5016); - CHECK(sc_v[47][1] == 5018); - CHECK(sc_v[48][0] == 5016); - CHECK(sc_v[48][1] == 5095); - CHECK(sc_v[49][0] == 5016); - CHECK(sc_v[49][1] == 7722); - CHECK(sc_v[50][0] == 5018); - CHECK(sc_v[50][1] == 5095); - CHECK(sc_v[51][0] == 2480); - CHECK(sc_v[51][1] == 4855); - CHECK(sc_v[51][2] == 4940); - CHECK(sc_v[52][0] == 2480); - CHECK(sc_v[52][1] == 4855); - CHECK(sc_v[52][2] == 5014); - CHECK(sc_v[53][0] == 2480); - CHECK(sc_v[53][1] == 4855); - CHECK(sc_v[53][2] == 7552); - CHECK(sc_v[54][0] == 2480); - CHECK(sc_v[54][1] == 4940); - CHECK(sc_v[54][2] == 4965); - CHECK(sc_v[55][0] == 2480); - CHECK(sc_v[55][1] == 4940); - CHECK(sc_v[55][2] == 5014); - CHECK(sc_v[56][0] == 2480); - CHECK(sc_v[56][1] == 4940); - CHECK(sc_v[56][2] == 5016); - CHECK(sc_v[57][0] == 2480); - CHECK(sc_v[57][1] == 4940); - CHECK(sc_v[57][2] == 5095); - CHECK(sc_v[58][0] == 2480); - CHECK(sc_v[58][1] == 4940); - CHECK(sc_v[58][2] == 7552); - CHECK(sc_v[59][0] == 2480); - CHECK(sc_v[59][1] == 4940); - CHECK(sc_v[59][2] == 7722); - CHECK(sc_v[60][0] == 2480); - CHECK(sc_v[60][1] == 4965); - CHECK(sc_v[60][2] == 7552); - CHECK(sc_v[61][0] == 2480); - CHECK(sc_v[61][1] == 4965); - CHECK(sc_v[61][2] == 7722); - CHECK(sc_v[62][0] == 2480); - CHECK(sc_v[62][1] == 5014); - CHECK(sc_v[62][2] == 5095); - CHECK(sc_v[63][0] == 2480); - CHECK(sc_v[63][1] == 5016); - CHECK(sc_v[63][2] == 5095); - CHECK(sc_v[64][0] == 2480); - CHECK(sc_v[64][1] == 5016); - CHECK(sc_v[64][2] == 7722); - CHECK(sc_v[65][0] == 4840); - CHECK(sc_v[65][1] == 4855); - CHECK(sc_v[65][2] == 4900); - CHECK(sc_v[66][0] == 4840); - CHECK(sc_v[66][1] == 4855); - CHECK(sc_v[66][2] == 4940); - CHECK(sc_v[67][0] == 4840); - CHECK(sc_v[67][1] == 4855); - CHECK(sc_v[67][2] == 7552); - CHECK(sc_v[68][0] == 4840); - CHECK(sc_v[68][1] == 4872); - CHECK(sc_v[68][2] == 4940); - CHECK(sc_v[69][0] == 4840); - CHECK(sc_v[69][1] == 4872); - CHECK(sc_v[69][2] == 7552); - CHECK(sc_v[70][0] == 4840); - CHECK(sc_v[70][1] == 4900); - CHECK(sc_v[70][2] == 4940); - CHECK(sc_v[71][0] == 4840); - CHECK(sc_v[71][1] == 4940); - CHECK(sc_v[71][2] == 7552); - CHECK(sc_v[72][0] == 4855); - CHECK(sc_v[72][1] == 4900); - CHECK(sc_v[72][2] == 4940); - CHECK(sc_v[73][0] == 4855); - CHECK(sc_v[73][1] == 4900); - CHECK(sc_v[73][2] == 5014); - CHECK(sc_v[74][0] == 4855); - CHECK(sc_v[74][1] == 4940); - CHECK(sc_v[74][2] == 5014); - CHECK(sc_v[75][0] == 4855); - CHECK(sc_v[75][1] == 4940); - CHECK(sc_v[75][2] == 7552); - CHECK(sc_v[76][0] == 4872); - CHECK(sc_v[76][1] == 4940); - CHECK(sc_v[76][2] == 4965); - CHECK(sc_v[77][0] == 4872); - CHECK(sc_v[77][1] == 4940); - CHECK(sc_v[77][2] == 7552); - CHECK(sc_v[78][0] == 4872); - CHECK(sc_v[78][1] == 4965); - CHECK(sc_v[78][2] == 7552); - CHECK(sc_v[79][0] == 4900); - CHECK(sc_v[79][1] == 4940); - CHECK(sc_v[79][2] == 5014); - CHECK(sc_v[80][0] == 4900); - CHECK(sc_v[80][1] == 4940); - CHECK(sc_v[80][2] == 5018); - CHECK(sc_v[81][0] == 4900); - CHECK(sc_v[81][1] == 4940); - CHECK(sc_v[81][2] == 5095); - CHECK(sc_v[82][0] == 4900); - CHECK(sc_v[82][1] == 5014); - CHECK(sc_v[82][2] == 5095); - CHECK(sc_v[83][0] == 4900); - CHECK(sc_v[83][1] == 5018); - CHECK(sc_v[83][2] == 5095); - CHECK(sc_v[84][0] == 4940); - CHECK(sc_v[84][1] == 4965); - CHECK(sc_v[84][2] == 7552); - CHECK(sc_v[85][0] == 4940); - CHECK(sc_v[85][1] == 4965); - CHECK(sc_v[85][2] == 7722); - CHECK(sc_v[86][0] == 4940); - CHECK(sc_v[86][1] == 5014); - CHECK(sc_v[86][2] == 5095); - CHECK(sc_v[87][0] == 4940); - CHECK(sc_v[87][1] == 5016); - CHECK(sc_v[87][2] == 5018); - CHECK(sc_v[88][0] == 4940); - CHECK(sc_v[88][1] == 5016); - CHECK(sc_v[88][2] == 5095); - CHECK(sc_v[89][0] == 4940); - CHECK(sc_v[89][1] == 5016); - CHECK(sc_v[89][2] == 7722); - CHECK(sc_v[90][0] == 4940); - CHECK(sc_v[90][1] == 5018); - CHECK(sc_v[90][2] == 5095); - CHECK(sc_v[91][0] == 5016); - CHECK(sc_v[91][1] == 5018); - CHECK(sc_v[91][2] == 5095); - CHECK(sc_v[92][0] == 2480); - CHECK(sc_v[92][1] == 4855); - CHECK(sc_v[92][2] == 4940); - CHECK(sc_v[92][3] == 5014); - CHECK(sc_v[93][0] == 2480); - CHECK(sc_v[93][1] == 4855); - CHECK(sc_v[93][2] == 4940); - CHECK(sc_v[93][3] == 7552); - CHECK(sc_v[94][0] == 2480); - CHECK(sc_v[94][1] == 4940); - CHECK(sc_v[94][2] == 4965); - CHECK(sc_v[94][3] == 7552); - CHECK(sc_v[95][0] == 2480); - CHECK(sc_v[95][1] == 4940); - CHECK(sc_v[95][2] == 4965); - CHECK(sc_v[95][3] == 7722); - CHECK(sc_v[96][0] == 2480); - CHECK(sc_v[96][1] == 4940); - CHECK(sc_v[96][2] == 5014); - CHECK(sc_v[96][3] == 5095); - CHECK(sc_v[97][0] == 2480); - CHECK(sc_v[97][1] == 4940); - CHECK(sc_v[97][2] == 5016); - CHECK(sc_v[97][3] == 5095); - CHECK(sc_v[98][0] == 2480); - CHECK(sc_v[98][1] == 4940); - CHECK(sc_v[98][2] == 5016); - CHECK(sc_v[98][3] == 7722); - CHECK(sc_v[99][0] == 4840); - CHECK(sc_v[99][1] == 4855); - CHECK(sc_v[99][2] == 4900); - CHECK(sc_v[99][3] == 4940); - CHECK(sc_v[100][0] == 4840); - CHECK(sc_v[100][1] == 4855); - CHECK(sc_v[100][2] == 4940); - CHECK(sc_v[100][3] == 7552); - CHECK(sc_v[101][0] == 4840); - CHECK(sc_v[101][1] == 4872); - CHECK(sc_v[101][2] == 4940); - CHECK(sc_v[101][3] == 7552); - CHECK(sc_v[102][0] == 4855); - CHECK(sc_v[102][1] == 4900); - CHECK(sc_v[102][2] == 4940); - CHECK(sc_v[102][3] == 5014); - CHECK(sc_v[103][0] == 4872); - CHECK(sc_v[103][1] == 4940); - CHECK(sc_v[103][2] == 4965); - CHECK(sc_v[103][3] == 7552); - CHECK(sc_v[104][0] == 4900); - CHECK(sc_v[104][1] == 4940); - CHECK(sc_v[104][2] == 5014); - CHECK(sc_v[104][3] == 5095); - CHECK(sc_v[105][0] == 4900); - CHECK(sc_v[105][1] == 4940); - CHECK(sc_v[105][2] == 5018); - CHECK(sc_v[105][3] == 5095); - CHECK(sc_v[106][0] == 4940); - CHECK(sc_v[106][1] == 5016); - CHECK(sc_v[106][2] == 5018); - CHECK(sc_v[106][3] == 5095); - - t = m.tuple_from_id(PV, 4526); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 63); - CHECK(sc_v[0][0] == 2592); - CHECK(sc_v[1][0] == 4425); - CHECK(sc_v[2][0] == 4470); - CHECK(sc_v[3][0] == 4506); - CHECK(sc_v[4][0] == 4526); - CHECK(sc_v[5][0] == 4610); - CHECK(sc_v[6][0] == 4627); - CHECK(sc_v[7][0] == 4687); - CHECK(sc_v[8][0] == 7385); - CHECK(sc_v[9][0] == 2592); - CHECK(sc_v[9][1] == 4425); - CHECK(sc_v[10][0] == 2592); - CHECK(sc_v[10][1] == 4470); - CHECK(sc_v[11][0] == 2592); - CHECK(sc_v[11][1] == 4506); - CHECK(sc_v[12][0] == 2592); - CHECK(sc_v[12][1] == 4526); - CHECK(sc_v[13][0] == 2592); - CHECK(sc_v[13][1] == 4610); - CHECK(sc_v[14][0] == 2592); - CHECK(sc_v[14][1] == 4687); - CHECK(sc_v[15][0] == 2592); - CHECK(sc_v[15][1] == 7385); - CHECK(sc_v[16][0] == 4425); - CHECK(sc_v[16][1] == 4470); - CHECK(sc_v[17][0] == 4425); - CHECK(sc_v[17][1] == 4506); - CHECK(sc_v[18][0] == 4425); - CHECK(sc_v[18][1] == 4526); - CHECK(sc_v[19][0] == 4470); - CHECK(sc_v[19][1] == 4526); - CHECK(sc_v[20][0] == 4470); - CHECK(sc_v[20][1] == 4627); - CHECK(sc_v[21][0] == 4470); - CHECK(sc_v[21][1] == 7385); - CHECK(sc_v[22][0] == 4506); - CHECK(sc_v[22][1] == 4526); - CHECK(sc_v[23][0] == 4506); - CHECK(sc_v[23][1] == 4610); - CHECK(sc_v[24][0] == 4526); - CHECK(sc_v[24][1] == 4610); - CHECK(sc_v[25][0] == 4526); - CHECK(sc_v[25][1] == 4627); - CHECK(sc_v[26][0] == 4526); - CHECK(sc_v[26][1] == 4687); - CHECK(sc_v[27][0] == 4526); - CHECK(sc_v[27][1] == 7385); - CHECK(sc_v[28][0] == 4610); - CHECK(sc_v[28][1] == 4687); - CHECK(sc_v[29][0] == 4627); - CHECK(sc_v[29][1] == 4687); - CHECK(sc_v[30][0] == 4627); - CHECK(sc_v[30][1] == 7385); - CHECK(sc_v[31][0] == 4687); - CHECK(sc_v[31][1] == 7385); - CHECK(sc_v[32][0] == 2592); - CHECK(sc_v[32][1] == 4425); - CHECK(sc_v[32][2] == 4470); - CHECK(sc_v[33][0] == 2592); - CHECK(sc_v[33][1] == 4425); - CHECK(sc_v[33][2] == 4506); - CHECK(sc_v[34][0] == 2592); - CHECK(sc_v[34][1] == 4425); - CHECK(sc_v[34][2] == 4526); - CHECK(sc_v[35][0] == 2592); - CHECK(sc_v[35][1] == 4470); - CHECK(sc_v[35][2] == 4526); - CHECK(sc_v[36][0] == 2592); - CHECK(sc_v[36][1] == 4470); - CHECK(sc_v[36][2] == 7385); - CHECK(sc_v[37][0] == 2592); - CHECK(sc_v[37][1] == 4506); - CHECK(sc_v[37][2] == 4526); - CHECK(sc_v[38][0] == 2592); - CHECK(sc_v[38][1] == 4506); - CHECK(sc_v[38][2] == 4610); - CHECK(sc_v[39][0] == 2592); - CHECK(sc_v[39][1] == 4526); - CHECK(sc_v[39][2] == 4610); - CHECK(sc_v[40][0] == 2592); - CHECK(sc_v[40][1] == 4526); - CHECK(sc_v[40][2] == 4687); - CHECK(sc_v[41][0] == 2592); - CHECK(sc_v[41][1] == 4526); - CHECK(sc_v[41][2] == 7385); - CHECK(sc_v[42][0] == 2592); - CHECK(sc_v[42][1] == 4610); - CHECK(sc_v[42][2] == 4687); - CHECK(sc_v[43][0] == 2592); - CHECK(sc_v[43][1] == 4687); - CHECK(sc_v[43][2] == 7385); - CHECK(sc_v[44][0] == 4425); - CHECK(sc_v[44][1] == 4470); - CHECK(sc_v[44][2] == 4526); - CHECK(sc_v[45][0] == 4425); - CHECK(sc_v[45][1] == 4506); - CHECK(sc_v[45][2] == 4526); - CHECK(sc_v[46][0] == 4470); - CHECK(sc_v[46][1] == 4526); - CHECK(sc_v[46][2] == 4627); - CHECK(sc_v[47][0] == 4470); - CHECK(sc_v[47][1] == 4526); - CHECK(sc_v[47][2] == 7385); - CHECK(sc_v[48][0] == 4470); - CHECK(sc_v[48][1] == 4627); - CHECK(sc_v[48][2] == 7385); - CHECK(sc_v[49][0] == 4506); - CHECK(sc_v[49][1] == 4526); - CHECK(sc_v[49][2] == 4610); - CHECK(sc_v[50][0] == 4526); - CHECK(sc_v[50][1] == 4610); - CHECK(sc_v[50][2] == 4687); - CHECK(sc_v[51][0] == 4526); - CHECK(sc_v[51][1] == 4627); - CHECK(sc_v[51][2] == 4687); - CHECK(sc_v[52][0] == 4526); - CHECK(sc_v[52][1] == 4627); - CHECK(sc_v[52][2] == 7385); - CHECK(sc_v[53][0] == 4526); - CHECK(sc_v[53][1] == 4687); - CHECK(sc_v[53][2] == 7385); - CHECK(sc_v[54][0] == 4627); - CHECK(sc_v[54][1] == 4687); - CHECK(sc_v[54][2] == 7385); - CHECK(sc_v[55][0] == 2592); - CHECK(sc_v[55][1] == 4425); - CHECK(sc_v[55][2] == 4470); - CHECK(sc_v[55][3] == 4526); - CHECK(sc_v[56][0] == 2592); - CHECK(sc_v[56][1] == 4425); - CHECK(sc_v[56][2] == 4506); - CHECK(sc_v[56][3] == 4526); - CHECK(sc_v[57][0] == 2592); - CHECK(sc_v[57][1] == 4470); - CHECK(sc_v[57][2] == 4526); - CHECK(sc_v[57][3] == 7385); - CHECK(sc_v[58][0] == 2592); - CHECK(sc_v[58][1] == 4506); - CHECK(sc_v[58][2] == 4526); - CHECK(sc_v[58][3] == 4610); - CHECK(sc_v[59][0] == 2592); - CHECK(sc_v[59][1] == 4526); - CHECK(sc_v[59][2] == 4610); - CHECK(sc_v[59][3] == 4687); - CHECK(sc_v[60][0] == 2592); - CHECK(sc_v[60][1] == 4526); - CHECK(sc_v[60][2] == 4687); - CHECK(sc_v[60][3] == 7385); - CHECK(sc_v[61][0] == 4470); - CHECK(sc_v[61][1] == 4526); - CHECK(sc_v[61][2] == 4627); - CHECK(sc_v[61][3] == 7385); - CHECK(sc_v[62][0] == 4526); - CHECK(sc_v[62][1] == 4627); - CHECK(sc_v[62][2] == 4687); - CHECK(sc_v[62][3] == 7385); - - t = m.edge_tuple_from_vids(2697, 2891); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 23); - CHECK(sc_e[0][0] == 2697); - CHECK(sc_e[1][0] == 2728); - CHECK(sc_e[2][0] == 2813); - CHECK(sc_e[3][0] == 2891); - CHECK(sc_e[4][0] == 3288); - CHECK(sc_e[5][0] == 2697); - CHECK(sc_e[5][1] == 2728); - CHECK(sc_e[6][0] == 2697); - CHECK(sc_e[6][1] == 2813); - CHECK(sc_e[7][0] == 2697); - CHECK(sc_e[7][1] == 2891); - CHECK(sc_e[8][0] == 2697); - CHECK(sc_e[8][1] == 3288); - CHECK(sc_e[9][0] == 2728); - CHECK(sc_e[9][1] == 2891); - CHECK(sc_e[10][0] == 2728); - CHECK(sc_e[10][1] == 3288); - CHECK(sc_e[11][0] == 2813); - CHECK(sc_e[11][1] == 2891); - CHECK(sc_e[12][0] == 2813); - CHECK(sc_e[12][1] == 3288); - CHECK(sc_e[13][0] == 2891); - CHECK(sc_e[13][1] == 3288); - CHECK(sc_e[14][0] == 2697); - CHECK(sc_e[14][1] == 2728); - CHECK(sc_e[14][2] == 2891); - CHECK(sc_e[15][0] == 2697); - CHECK(sc_e[15][1] == 2728); - CHECK(sc_e[15][2] == 3288); - CHECK(sc_e[16][0] == 2697); - CHECK(sc_e[16][1] == 2813); - CHECK(sc_e[16][2] == 2891); - CHECK(sc_e[17][0] == 2697); - CHECK(sc_e[17][1] == 2813); - CHECK(sc_e[17][2] == 3288); - CHECK(sc_e[18][0] == 2697); - CHECK(sc_e[18][1] == 2891); - CHECK(sc_e[18][2] == 3288); - CHECK(sc_e[19][0] == 2728); - CHECK(sc_e[19][1] == 2891); - CHECK(sc_e[19][2] == 3288); - CHECK(sc_e[20][0] == 2813); - CHECK(sc_e[20][1] == 2891); - CHECK(sc_e[20][2] == 3288); - CHECK(sc_e[21][0] == 2697); - CHECK(sc_e[21][1] == 2728); - CHECK(sc_e[21][2] == 2891); - CHECK(sc_e[21][3] == 3288); - CHECK(sc_e[22][0] == 2697); - CHECK(sc_e[22][1] == 2813); - CHECK(sc_e[22][2] == 2891); - CHECK(sc_e[22][3] == 3288); - - t = m.edge_tuple_from_vids(785, 920); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 23); - CHECK(sc_e[0][0] == 757); - CHECK(sc_e[1][0] == 785); - CHECK(sc_e[2][0] == 920); - CHECK(sc_e[3][0] == 930); - CHECK(sc_e[4][0] == 7328); - CHECK(sc_e[5][0] == 757); - CHECK(sc_e[5][1] == 785); - CHECK(sc_e[6][0] == 757); - CHECK(sc_e[6][1] == 920); - CHECK(sc_e[7][0] == 757); - CHECK(sc_e[7][1] == 7328); - CHECK(sc_e[8][0] == 785); - CHECK(sc_e[8][1] == 920); - CHECK(sc_e[9][0] == 785); - CHECK(sc_e[9][1] == 930); - CHECK(sc_e[10][0] == 785); - CHECK(sc_e[10][1] == 7328); - CHECK(sc_e[11][0] == 920); - CHECK(sc_e[11][1] == 930); - CHECK(sc_e[12][0] == 920); - CHECK(sc_e[12][1] == 7328); - CHECK(sc_e[13][0] == 930); - CHECK(sc_e[13][1] == 7328); - CHECK(sc_e[14][0] == 757); - CHECK(sc_e[14][1] == 785); - CHECK(sc_e[14][2] == 920); - CHECK(sc_e[15][0] == 757); - CHECK(sc_e[15][1] == 785); - CHECK(sc_e[15][2] == 7328); - CHECK(sc_e[16][0] == 757); - CHECK(sc_e[16][1] == 920); - CHECK(sc_e[16][2] == 7328); - CHECK(sc_e[17][0] == 785); - CHECK(sc_e[17][1] == 920); - CHECK(sc_e[17][2] == 930); - CHECK(sc_e[18][0] == 785); - CHECK(sc_e[18][1] == 920); - CHECK(sc_e[18][2] == 7328); - CHECK(sc_e[19][0] == 785); - CHECK(sc_e[19][1] == 930); - CHECK(sc_e[19][2] == 7328); - CHECK(sc_e[20][0] == 920); - CHECK(sc_e[20][1] == 930); - CHECK(sc_e[20][2] == 7328); - CHECK(sc_e[21][0] == 757); - CHECK(sc_e[21][1] == 785); - CHECK(sc_e[21][2] == 920); - CHECK(sc_e[21][3] == 7328); - CHECK(sc_e[22][0] == 785); - CHECK(sc_e[22][1] == 920); - CHECK(sc_e[22][2] == 930); - CHECK(sc_e[22][3] == 7328); - - t = m.edge_tuple_from_vids(5640, 7875); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 43); - CHECK(sc_e[0][0] == 5610); - CHECK(sc_e[1][0] == 5631); - CHECK(sc_e[2][0] == 5640); - CHECK(sc_e[3][0] == 5668); - CHECK(sc_e[4][0] == 5681); - CHECK(sc_e[5][0] == 7390); - CHECK(sc_e[6][0] == 7875); - CHECK(sc_e[7][0] == 5610); - CHECK(sc_e[7][1] == 5640); - CHECK(sc_e[8][0] == 5610); - CHECK(sc_e[8][1] == 5681); - CHECK(sc_e[9][0] == 5610); - CHECK(sc_e[9][1] == 7390); - CHECK(sc_e[10][0] == 5610); - CHECK(sc_e[10][1] == 7875); - CHECK(sc_e[11][0] == 5631); - CHECK(sc_e[11][1] == 5640); - CHECK(sc_e[12][0] == 5631); - CHECK(sc_e[12][1] == 5668); - CHECK(sc_e[13][0] == 5631); - CHECK(sc_e[13][1] == 7390); - CHECK(sc_e[14][0] == 5631); - CHECK(sc_e[14][1] == 7875); - CHECK(sc_e[15][0] == 5640); - CHECK(sc_e[15][1] == 5668); - CHECK(sc_e[16][0] == 5640); - CHECK(sc_e[16][1] == 5681); - CHECK(sc_e[17][0] == 5640); - CHECK(sc_e[17][1] == 7390); - CHECK(sc_e[18][0] == 5640); - CHECK(sc_e[18][1] == 7875); - CHECK(sc_e[19][0] == 5668); - CHECK(sc_e[19][1] == 5681); - CHECK(sc_e[20][0] == 5668); - CHECK(sc_e[20][1] == 7875); - CHECK(sc_e[21][0] == 5681); - CHECK(sc_e[21][1] == 7875); - CHECK(sc_e[22][0] == 7390); - CHECK(sc_e[22][1] == 7875); - CHECK(sc_e[23][0] == 5610); - CHECK(sc_e[23][1] == 5640); - CHECK(sc_e[23][2] == 5681); - CHECK(sc_e[24][0] == 5610); - CHECK(sc_e[24][1] == 5640); - CHECK(sc_e[24][2] == 7390); - CHECK(sc_e[25][0] == 5610); - CHECK(sc_e[25][1] == 5640); - CHECK(sc_e[25][2] == 7875); - CHECK(sc_e[26][0] == 5610); - CHECK(sc_e[26][1] == 5681); - CHECK(sc_e[26][2] == 7875); - CHECK(sc_e[27][0] == 5610); - CHECK(sc_e[27][1] == 7390); - CHECK(sc_e[27][2] == 7875); - CHECK(sc_e[28][0] == 5631); - CHECK(sc_e[28][1] == 5640); - CHECK(sc_e[28][2] == 5668); - CHECK(sc_e[29][0] == 5631); - CHECK(sc_e[29][1] == 5640); - CHECK(sc_e[29][2] == 7390); - CHECK(sc_e[30][0] == 5631); - CHECK(sc_e[30][1] == 5640); - CHECK(sc_e[30][2] == 7875); - CHECK(sc_e[31][0] == 5631); - CHECK(sc_e[31][1] == 5668); - CHECK(sc_e[31][2] == 7875); - CHECK(sc_e[32][0] == 5631); - CHECK(sc_e[32][1] == 7390); - CHECK(sc_e[32][2] == 7875); - CHECK(sc_e[33][0] == 5640); - CHECK(sc_e[33][1] == 5668); - CHECK(sc_e[33][2] == 5681); - CHECK(sc_e[34][0] == 5640); - CHECK(sc_e[34][1] == 5668); - CHECK(sc_e[34][2] == 7875); - CHECK(sc_e[35][0] == 5640); - CHECK(sc_e[35][1] == 5681); - CHECK(sc_e[35][2] == 7875); - CHECK(sc_e[36][0] == 5640); - CHECK(sc_e[36][1] == 7390); - CHECK(sc_e[36][2] == 7875); - CHECK(sc_e[37][0] == 5668); - CHECK(sc_e[37][1] == 5681); - CHECK(sc_e[37][2] == 7875); - CHECK(sc_e[38][0] == 5610); - CHECK(sc_e[38][1] == 5640); - CHECK(sc_e[38][2] == 5681); - CHECK(sc_e[38][3] == 7875); - CHECK(sc_e[39][0] == 5610); - CHECK(sc_e[39][1] == 5640); - CHECK(sc_e[39][2] == 7390); - CHECK(sc_e[39][3] == 7875); - CHECK(sc_e[40][0] == 5631); - CHECK(sc_e[40][1] == 5640); - CHECK(sc_e[40][2] == 5668); - CHECK(sc_e[40][3] == 7875); - CHECK(sc_e[41][0] == 5631); - CHECK(sc_e[41][1] == 5640); - CHECK(sc_e[41][2] == 7390); - CHECK(sc_e[41][3] == 7875); - CHECK(sc_e[42][0] == 5640); - CHECK(sc_e[42][1] == 5668); - CHECK(sc_e[42][2] == 5681); - CHECK(sc_e[42][3] == 7875); - - t = m.face_tuple_from_vids(4027, 4161, 7356); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 23); - CHECK(sc_f[0][0] == 3906); - CHECK(sc_f[1][0] == 4027); - CHECK(sc_f[2][0] == 4159); - CHECK(sc_f[3][0] == 4161); - CHECK(sc_f[4][0] == 7356); - CHECK(sc_f[5][0] == 3906); - CHECK(sc_f[5][1] == 4027); - CHECK(sc_f[6][0] == 3906); - CHECK(sc_f[6][1] == 4161); - CHECK(sc_f[7][0] == 3906); - CHECK(sc_f[7][1] == 7356); - CHECK(sc_f[8][0] == 4027); - CHECK(sc_f[8][1] == 4159); - CHECK(sc_f[9][0] == 4027); - CHECK(sc_f[9][1] == 4161); - CHECK(sc_f[10][0] == 4027); - CHECK(sc_f[10][1] == 7356); - CHECK(sc_f[11][0] == 4159); - CHECK(sc_f[11][1] == 4161); - CHECK(sc_f[12][0] == 4159); - CHECK(sc_f[12][1] == 7356); - CHECK(sc_f[13][0] == 4161); - CHECK(sc_f[13][1] == 7356); - CHECK(sc_f[14][0] == 3906); - CHECK(sc_f[14][1] == 4027); - CHECK(sc_f[14][2] == 4161); - CHECK(sc_f[15][0] == 3906); - CHECK(sc_f[15][1] == 4027); - CHECK(sc_f[15][2] == 7356); - CHECK(sc_f[16][0] == 3906); - CHECK(sc_f[16][1] == 4161); - CHECK(sc_f[16][2] == 7356); - CHECK(sc_f[17][0] == 4027); - CHECK(sc_f[17][1] == 4159); - CHECK(sc_f[17][2] == 4161); - CHECK(sc_f[18][0] == 4027); - CHECK(sc_f[18][1] == 4159); - CHECK(sc_f[18][2] == 7356); - CHECK(sc_f[19][0] == 4027); - CHECK(sc_f[19][1] == 4161); - CHECK(sc_f[19][2] == 7356); - CHECK(sc_f[20][0] == 4159); - CHECK(sc_f[20][1] == 4161); - CHECK(sc_f[20][2] == 7356); - CHECK(sc_f[21][0] == 3906); - CHECK(sc_f[21][1] == 4027); - CHECK(sc_f[21][2] == 4161); - CHECK(sc_f[21][3] == 7356); - CHECK(sc_f[22][0] == 4027); - CHECK(sc_f[22][1] == 4159); - CHECK(sc_f[22][2] == 4161); - CHECK(sc_f[22][3] == 7356); - - t = m.face_tuple_from_vids(3007, 3336, 3577); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 23); - CHECK(sc_f[0][0] == 3007); - CHECK(sc_f[1][0] == 3037); - CHECK(sc_f[2][0] == 3336); - CHECK(sc_f[3][0] == 3445); - CHECK(sc_f[4][0] == 3577); - CHECK(sc_f[5][0] == 3007); - CHECK(sc_f[5][1] == 3037); - CHECK(sc_f[6][0] == 3007); - CHECK(sc_f[6][1] == 3336); - CHECK(sc_f[7][0] == 3007); - CHECK(sc_f[7][1] == 3445); - CHECK(sc_f[8][0] == 3007); - CHECK(sc_f[8][1] == 3577); - CHECK(sc_f[9][0] == 3037); - CHECK(sc_f[9][1] == 3336); - CHECK(sc_f[10][0] == 3037); - CHECK(sc_f[10][1] == 3577); - CHECK(sc_f[11][0] == 3336); - CHECK(sc_f[11][1] == 3445); - CHECK(sc_f[12][0] == 3336); - CHECK(sc_f[12][1] == 3577); - CHECK(sc_f[13][0] == 3445); - CHECK(sc_f[13][1] == 3577); - CHECK(sc_f[14][0] == 3007); - CHECK(sc_f[14][1] == 3037); - CHECK(sc_f[14][2] == 3336); - CHECK(sc_f[15][0] == 3007); - CHECK(sc_f[15][1] == 3037); - CHECK(sc_f[15][2] == 3577); - CHECK(sc_f[16][0] == 3007); - CHECK(sc_f[16][1] == 3336); - CHECK(sc_f[16][2] == 3445); - CHECK(sc_f[17][0] == 3007); - CHECK(sc_f[17][1] == 3336); - CHECK(sc_f[17][2] == 3577); - CHECK(sc_f[18][0] == 3007); - CHECK(sc_f[18][1] == 3445); - CHECK(sc_f[18][2] == 3577); - CHECK(sc_f[19][0] == 3037); - CHECK(sc_f[19][1] == 3336); - CHECK(sc_f[19][2] == 3577); - CHECK(sc_f[20][0] == 3336); - CHECK(sc_f[20][1] == 3445); - CHECK(sc_f[20][2] == 3577); - CHECK(sc_f[21][0] == 3007); - CHECK(sc_f[21][1] == 3037); - CHECK(sc_f[21][2] == 3336); - CHECK(sc_f[21][3] == 3577); - CHECK(sc_f[22][0] == 3007); - CHECK(sc_f[22][1] == 3336); - CHECK(sc_f[22][2] == 3445); - CHECK(sc_f[22][3] == 3577); - - t = m.face_tuple_from_vids(5176, 5254, 7472); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 23); - CHECK(sc_f[0][0] == 5176); - CHECK(sc_f[1][0] == 5178); - CHECK(sc_f[2][0] == 5214); - CHECK(sc_f[3][0] == 5254); - CHECK(sc_f[4][0] == 7472); - CHECK(sc_f[5][0] == 5176); - CHECK(sc_f[5][1] == 5178); - CHECK(sc_f[6][0] == 5176); - CHECK(sc_f[6][1] == 5214); - CHECK(sc_f[7][0] == 5176); - CHECK(sc_f[7][1] == 5254); - CHECK(sc_f[8][0] == 5176); - CHECK(sc_f[8][1] == 7472); - CHECK(sc_f[9][0] == 5178); - CHECK(sc_f[9][1] == 5254); - CHECK(sc_f[10][0] == 5178); - CHECK(sc_f[10][1] == 7472); - CHECK(sc_f[11][0] == 5214); - CHECK(sc_f[11][1] == 5254); - CHECK(sc_f[12][0] == 5214); - CHECK(sc_f[12][1] == 7472); - CHECK(sc_f[13][0] == 5254); - CHECK(sc_f[13][1] == 7472); - CHECK(sc_f[14][0] == 5176); - CHECK(sc_f[14][1] == 5178); - CHECK(sc_f[14][2] == 5254); - CHECK(sc_f[15][0] == 5176); - CHECK(sc_f[15][1] == 5178); - CHECK(sc_f[15][2] == 7472); - CHECK(sc_f[16][0] == 5176); - CHECK(sc_f[16][1] == 5214); - CHECK(sc_f[16][2] == 5254); - CHECK(sc_f[17][0] == 5176); - CHECK(sc_f[17][1] == 5214); - CHECK(sc_f[17][2] == 7472); - CHECK(sc_f[18][0] == 5176); - CHECK(sc_f[18][1] == 5254); - CHECK(sc_f[18][2] == 7472); - CHECK(sc_f[19][0] == 5178); - CHECK(sc_f[19][1] == 5254); - CHECK(sc_f[19][2] == 7472); - CHECK(sc_f[20][0] == 5214); - CHECK(sc_f[20][1] == 5254); - CHECK(sc_f[20][2] == 7472); - CHECK(sc_f[21][0] == 5176); - CHECK(sc_f[21][1] == 5178); - CHECK(sc_f[21][2] == 5254); - CHECK(sc_f[21][3] == 7472); - CHECK(sc_f[22][0] == 5176); - CHECK(sc_f[22][1] == 5214); - CHECK(sc_f[22][2] == 5254); - CHECK(sc_f[22][3] == 7472); - - t = m.tet_tuple_from_vids(2321, 2481, 7747, 7933); - sc_t = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 2321); - CHECK(sc_t[1][0] == 2481); - CHECK(sc_t[2][0] == 7747); - CHECK(sc_t[3][0] == 7933); - CHECK(sc_t[4][0] == 2321); - CHECK(sc_t[4][1] == 2481); - CHECK(sc_t[5][0] == 2321); - CHECK(sc_t[5][1] == 7747); - CHECK(sc_t[6][0] == 2321); - CHECK(sc_t[6][1] == 7933); - CHECK(sc_t[7][0] == 2481); - CHECK(sc_t[7][1] == 7747); - CHECK(sc_t[8][0] == 2481); - CHECK(sc_t[8][1] == 7933); - CHECK(sc_t[9][0] == 7747); - CHECK(sc_t[9][1] == 7933); - CHECK(sc_t[10][0] == 2321); - CHECK(sc_t[10][1] == 2481); - CHECK(sc_t[10][2] == 7747); - CHECK(sc_t[11][0] == 2321); - CHECK(sc_t[11][1] == 2481); - CHECK(sc_t[11][2] == 7933); - CHECK(sc_t[12][0] == 2321); - CHECK(sc_t[12][1] == 7747); - CHECK(sc_t[12][2] == 7933); - CHECK(sc_t[13][0] == 2481); - CHECK(sc_t[13][1] == 7747); - CHECK(sc_t[13][2] == 7933); - CHECK(sc_t[14][0] == 2321); - CHECK(sc_t[14][1] == 2481); - CHECK(sc_t[14][2] == 7747); - CHECK(sc_t[14][3] == 7933); - - t = m.tet_tuple_from_vids(2798, 3076, 7527, 7747); - sc_t = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 2798); - CHECK(sc_t[1][0] == 3076); - CHECK(sc_t[2][0] == 7527); - CHECK(sc_t[3][0] == 7747); - CHECK(sc_t[4][0] == 2798); - CHECK(sc_t[4][1] == 3076); - CHECK(sc_t[5][0] == 2798); - CHECK(sc_t[5][1] == 7527); - CHECK(sc_t[6][0] == 2798); - CHECK(sc_t[6][1] == 7747); - CHECK(sc_t[7][0] == 3076); - CHECK(sc_t[7][1] == 7527); - CHECK(sc_t[8][0] == 3076); - CHECK(sc_t[8][1] == 7747); - CHECK(sc_t[9][0] == 7527); - CHECK(sc_t[9][1] == 7747); - CHECK(sc_t[10][0] == 2798); - CHECK(sc_t[10][1] == 3076); - CHECK(sc_t[10][2] == 7527); - CHECK(sc_t[11][0] == 2798); - CHECK(sc_t[11][1] == 3076); - CHECK(sc_t[11][2] == 7747); - CHECK(sc_t[12][0] == 2798); - CHECK(sc_t[12][1] == 7527); - CHECK(sc_t[12][2] == 7747); - CHECK(sc_t[13][0] == 3076); - CHECK(sc_t[13][1] == 7527); - CHECK(sc_t[13][2] == 7747); - CHECK(sc_t[14][0] == 2798); - CHECK(sc_t[14][1] == 3076); - CHECK(sc_t[14][2] == 7527); - CHECK(sc_t[14][3] == 7747); - - t = m.tet_tuple_from_vids(4950, 4979, 5020, 5088); - sc_t = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 4950); - CHECK(sc_t[1][0] == 4979); - CHECK(sc_t[2][0] == 5020); - CHECK(sc_t[3][0] == 5088); - CHECK(sc_t[4][0] == 4950); - CHECK(sc_t[4][1] == 4979); - CHECK(sc_t[5][0] == 4950); - CHECK(sc_t[5][1] == 5020); - CHECK(sc_t[6][0] == 4950); - CHECK(sc_t[6][1] == 5088); - CHECK(sc_t[7][0] == 4979); - CHECK(sc_t[7][1] == 5020); - CHECK(sc_t[8][0] == 4979); - CHECK(sc_t[8][1] == 5088); - CHECK(sc_t[9][0] == 5020); - CHECK(sc_t[9][1] == 5088); - CHECK(sc_t[10][0] == 4950); - CHECK(sc_t[10][1] == 4979); - CHECK(sc_t[10][2] == 5020); - CHECK(sc_t[11][0] == 4950); - CHECK(sc_t[11][1] == 4979); - CHECK(sc_t[11][2] == 5088); - CHECK(sc_t[12][0] == 4950); - CHECK(sc_t[12][1] == 5020); - CHECK(sc_t[12][2] == 5088); - CHECK(sc_t[13][0] == 4979); - CHECK(sc_t[13][1] == 5020); - CHECK(sc_t[13][2] == 5088); - CHECK(sc_t[14][0] == 4950); - CHECK(sc_t[14][1] == 4979); - CHECK(sc_t[14][2] == 5020); - CHECK(sc_t[14][3] == 5088); -} - -TEST_CASE("open_star_bunny_tetwild_80_2", "[simplicial_complex][open_star][3D][xxx]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 3183); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 22); - CHECK(sc_v[0][0] == 3183); - CHECK(sc_v[1][0] == 2984); - CHECK(sc_v[1][1] == 3183); - CHECK(sc_v[2][0] == 3076); - CHECK(sc_v[2][1] == 3183); - CHECK(sc_v[3][0] == 3108); - CHECK(sc_v[3][1] == 3183); - CHECK(sc_v[4][0] == 3183); - CHECK(sc_v[4][1] == 3239); - CHECK(sc_v[5][0] == 3183); - CHECK(sc_v[5][1] == 3279); - CHECK(sc_v[6][0] == 3183); - CHECK(sc_v[6][1] == 7907); - CHECK(sc_v[7][0] == 2984); - CHECK(sc_v[7][1] == 3076); - CHECK(sc_v[7][2] == 3183); - CHECK(sc_v[8][0] == 2984); - CHECK(sc_v[8][1] == 3108); - CHECK(sc_v[8][2] == 3183); - CHECK(sc_v[9][0] == 2984); - CHECK(sc_v[9][1] == 3183); - CHECK(sc_v[9][2] == 7907); - CHECK(sc_v[10][0] == 3076); - CHECK(sc_v[10][1] == 3183); - CHECK(sc_v[10][2] == 3239); - CHECK(sc_v[11][0] == 3076); - CHECK(sc_v[11][1] == 3183); - CHECK(sc_v[11][2] == 7907); - CHECK(sc_v[12][0] == 3108); - CHECK(sc_v[12][1] == 3183); - CHECK(sc_v[12][2] == 3279); - CHECK(sc_v[13][0] == 3108); - CHECK(sc_v[13][1] == 3183); - CHECK(sc_v[13][2] == 7907); - CHECK(sc_v[14][0] == 3183); - CHECK(sc_v[14][1] == 3239); - CHECK(sc_v[14][2] == 3279); - CHECK(sc_v[15][0] == 3183); - CHECK(sc_v[15][1] == 3239); - CHECK(sc_v[15][2] == 7907); - CHECK(sc_v[16][0] == 3183); - CHECK(sc_v[16][1] == 3279); - CHECK(sc_v[16][2] == 7907); - CHECK(sc_v[17][0] == 2984); - CHECK(sc_v[17][1] == 3076); - CHECK(sc_v[17][2] == 3183); - CHECK(sc_v[17][3] == 7907); - CHECK(sc_v[18][0] == 2984); - CHECK(sc_v[18][1] == 3108); - CHECK(sc_v[18][2] == 3183); - CHECK(sc_v[18][3] == 7907); - CHECK(sc_v[19][0] == 3076); - CHECK(sc_v[19][1] == 3183); - CHECK(sc_v[19][2] == 3239); - CHECK(sc_v[19][3] == 7907); - CHECK(sc_v[20][0] == 3108); - CHECK(sc_v[20][1] == 3183); - CHECK(sc_v[20][2] == 3279); - CHECK(sc_v[20][3] == 7907); - CHECK(sc_v[21][0] == 3183); - CHECK(sc_v[21][1] == 3239); - CHECK(sc_v[21][2] == 3279); - CHECK(sc_v[21][3] == 7907); - - t = m.tuple_from_id(PV, 39); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 26); - CHECK(sc_v[0][0] == 39); - CHECK(sc_v[1][0] == 13); - CHECK(sc_v[1][1] == 39); - CHECK(sc_v[2][0] == 16); - CHECK(sc_v[2][1] == 39); - CHECK(sc_v[3][0] == 19); - CHECK(sc_v[3][1] == 39); - CHECK(sc_v[4][0] == 37); - CHECK(sc_v[4][1] == 39); - CHECK(sc_v[5][0] == 39); - CHECK(sc_v[5][1] == 58); - CHECK(sc_v[6][0] == 39); - CHECK(sc_v[6][1] == 108); - CHECK(sc_v[7][0] == 39); - CHECK(sc_v[7][1] == 7324); - CHECK(sc_v[8][0] == 13); - CHECK(sc_v[8][1] == 16); - CHECK(sc_v[8][2] == 39); - CHECK(sc_v[9][0] == 13); - CHECK(sc_v[9][1] == 19); - CHECK(sc_v[9][2] == 39); - CHECK(sc_v[10][0] == 13); - CHECK(sc_v[10][1] == 39); - CHECK(sc_v[10][2] == 7324); - CHECK(sc_v[11][0] == 16); - CHECK(sc_v[11][1] == 37); - CHECK(sc_v[11][2] == 39); - CHECK(sc_v[12][0] == 16); - CHECK(sc_v[12][1] == 39); - CHECK(sc_v[12][2] == 7324); - CHECK(sc_v[13][0] == 19); - CHECK(sc_v[13][1] == 39); - CHECK(sc_v[13][2] == 58); - CHECK(sc_v[14][0] == 19); - CHECK(sc_v[14][1] == 39); - CHECK(sc_v[14][2] == 7324); - CHECK(sc_v[15][0] == 37); - CHECK(sc_v[15][1] == 39); - CHECK(sc_v[15][2] == 108); - CHECK(sc_v[16][0] == 37); - CHECK(sc_v[16][1] == 39); - CHECK(sc_v[16][2] == 7324); - CHECK(sc_v[17][0] == 39); - CHECK(sc_v[17][1] == 58); - CHECK(sc_v[17][2] == 108); - CHECK(sc_v[18][0] == 39); - CHECK(sc_v[18][1] == 58); - CHECK(sc_v[18][2] == 7324); - CHECK(sc_v[19][0] == 39); - CHECK(sc_v[19][1] == 108); - CHECK(sc_v[19][2] == 7324); - CHECK(sc_v[20][0] == 13); - CHECK(sc_v[20][1] == 16); - CHECK(sc_v[20][2] == 39); - CHECK(sc_v[20][3] == 7324); - CHECK(sc_v[21][0] == 13); - CHECK(sc_v[21][1] == 19); - CHECK(sc_v[21][2] == 39); - CHECK(sc_v[21][3] == 7324); - CHECK(sc_v[22][0] == 16); - CHECK(sc_v[22][1] == 37); - CHECK(sc_v[22][2] == 39); - CHECK(sc_v[22][3] == 7324); - CHECK(sc_v[23][0] == 19); - CHECK(sc_v[23][1] == 39); - CHECK(sc_v[23][2] == 58); - CHECK(sc_v[23][3] == 7324); - CHECK(sc_v[24][0] == 37); - CHECK(sc_v[24][1] == 39); - CHECK(sc_v[24][2] == 108); - CHECK(sc_v[24][3] == 7324); - CHECK(sc_v[25][0] == 39); - CHECK(sc_v[25][1] == 58); - CHECK(sc_v[25][2] == 108); - CHECK(sc_v[25][3] == 7324); - - t = m.tuple_from_id(PV, 1383); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 38); - CHECK(sc_v[0][0] == 1383); - CHECK(sc_v[1][0] == 1272); - CHECK(sc_v[1][1] == 1383); - CHECK(sc_v[2][0] == 1364); - CHECK(sc_v[2][1] == 1383); - CHECK(sc_v[3][0] == 1383); - CHECK(sc_v[3][1] == 1423); - CHECK(sc_v[4][0] == 1383); - CHECK(sc_v[4][1] == 1463); - CHECK(sc_v[5][0] == 1383); - CHECK(sc_v[5][1] == 1566); - CHECK(sc_v[6][0] == 1383); - CHECK(sc_v[6][1] == 1602); - CHECK(sc_v[7][0] == 1383); - CHECK(sc_v[7][1] == 7329); - CHECK(sc_v[8][0] == 1383); - CHECK(sc_v[8][1] == 7562); - CHECK(sc_v[9][0] == 1383); - CHECK(sc_v[9][1] == 7790); - CHECK(sc_v[10][0] == 1272); - CHECK(sc_v[10][1] == 1364); - CHECK(sc_v[10][2] == 1383); - CHECK(sc_v[11][0] == 1272); - CHECK(sc_v[11][1] == 1383); - CHECK(sc_v[11][2] == 1423); - CHECK(sc_v[12][0] == 1272); - CHECK(sc_v[12][1] == 1383); - CHECK(sc_v[12][2] == 7329); - CHECK(sc_v[13][0] == 1272); - CHECK(sc_v[13][1] == 1383); - CHECK(sc_v[13][2] == 7562); - CHECK(sc_v[14][0] == 1272); - CHECK(sc_v[14][1] == 1383); - CHECK(sc_v[14][2] == 7790); - CHECK(sc_v[15][0] == 1364); - CHECK(sc_v[15][1] == 1383); - CHECK(sc_v[15][2] == 1463); - CHECK(sc_v[16][0] == 1364); - CHECK(sc_v[16][1] == 1383); - CHECK(sc_v[16][2] == 7562); - CHECK(sc_v[17][0] == 1364); - CHECK(sc_v[17][1] == 1383); - CHECK(sc_v[17][2] == 7790); - CHECK(sc_v[18][0] == 1383); - CHECK(sc_v[18][1] == 1423); - CHECK(sc_v[18][2] == 1566); - CHECK(sc_v[19][0] == 1383); - CHECK(sc_v[19][1] == 1423); - CHECK(sc_v[19][2] == 7562); - CHECK(sc_v[20][0] == 1383); - CHECK(sc_v[20][1] == 1463); - CHECK(sc_v[20][2] == 1602); - CHECK(sc_v[21][0] == 1383); - CHECK(sc_v[21][1] == 1463); - CHECK(sc_v[21][2] == 7562); - CHECK(sc_v[22][0] == 1383); - CHECK(sc_v[22][1] == 1566); - CHECK(sc_v[22][2] == 1602); - CHECK(sc_v[23][0] == 1383); - CHECK(sc_v[23][1] == 1566); - CHECK(sc_v[23][2] == 7562); - CHECK(sc_v[24][0] == 1383); - CHECK(sc_v[24][1] == 1602); - CHECK(sc_v[24][2] == 7562); - CHECK(sc_v[25][0] == 1383); - CHECK(sc_v[25][1] == 7329); - CHECK(sc_v[25][2] == 7562); - CHECK(sc_v[26][0] == 1383); - CHECK(sc_v[26][1] == 7329); - CHECK(sc_v[26][2] == 7790); - CHECK(sc_v[27][0] == 1383); - CHECK(sc_v[27][1] == 7562); - CHECK(sc_v[27][2] == 7790); - CHECK(sc_v[28][0] == 1272); - CHECK(sc_v[28][1] == 1364); - CHECK(sc_v[28][2] == 1383); - CHECK(sc_v[28][3] == 7790); - CHECK(sc_v[29][0] == 1272); - CHECK(sc_v[29][1] == 1383); - CHECK(sc_v[29][2] == 1423); - CHECK(sc_v[29][3] == 7562); - CHECK(sc_v[30][0] == 1272); - CHECK(sc_v[30][1] == 1383); - CHECK(sc_v[30][2] == 7329); - CHECK(sc_v[30][3] == 7562); - CHECK(sc_v[31][0] == 1272); - CHECK(sc_v[31][1] == 1383); - CHECK(sc_v[31][2] == 7329); - CHECK(sc_v[31][3] == 7790); - CHECK(sc_v[32][0] == 1364); - CHECK(sc_v[32][1] == 1383); - CHECK(sc_v[32][2] == 1463); - CHECK(sc_v[32][3] == 7562); - CHECK(sc_v[33][0] == 1364); - CHECK(sc_v[33][1] == 1383); - CHECK(sc_v[33][2] == 7562); - CHECK(sc_v[33][3] == 7790); - CHECK(sc_v[34][0] == 1383); - CHECK(sc_v[34][1] == 1423); - CHECK(sc_v[34][2] == 1566); - CHECK(sc_v[34][3] == 7562); - CHECK(sc_v[35][0] == 1383); - CHECK(sc_v[35][1] == 1463); - CHECK(sc_v[35][2] == 1602); - CHECK(sc_v[35][3] == 7562); - CHECK(sc_v[36][0] == 1383); - CHECK(sc_v[36][1] == 1566); - CHECK(sc_v[36][2] == 1602); - CHECK(sc_v[36][3] == 7562); - CHECK(sc_v[37][0] == 1383); - CHECK(sc_v[37][1] == 7329); - CHECK(sc_v[37][2] == 7562); - CHECK(sc_v[37][3] == 7790); - - t = m.tuple_from_id(PV, 6826); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 30); - CHECK(sc_v[0][0] == 6826); - CHECK(sc_v[1][0] == 2404); - CHECK(sc_v[1][1] == 6826); - CHECK(sc_v[2][0] == 6695); - CHECK(sc_v[2][1] == 6826); - CHECK(sc_v[3][0] == 6729); - CHECK(sc_v[3][1] == 6826); - CHECK(sc_v[4][0] == 6780); - CHECK(sc_v[4][1] == 6826); - CHECK(sc_v[5][0] == 6804); - CHECK(sc_v[5][1] == 6826); - CHECK(sc_v[6][0] == 6826); - CHECK(sc_v[6][1] == 6869); - CHECK(sc_v[7][0] == 6826); - CHECK(sc_v[7][1] == 6873); - CHECK(sc_v[8][0] == 6826); - CHECK(sc_v[8][1] == 6953); - CHECK(sc_v[9][0] == 2404); - CHECK(sc_v[9][1] == 6695); - CHECK(sc_v[9][2] == 6826); - CHECK(sc_v[10][0] == 2404); - CHECK(sc_v[10][1] == 6729); - CHECK(sc_v[10][2] == 6826); - CHECK(sc_v[11][0] == 2404); - CHECK(sc_v[11][1] == 6780); - CHECK(sc_v[11][2] == 6826); - CHECK(sc_v[12][0] == 2404); - CHECK(sc_v[12][1] == 6804); - CHECK(sc_v[12][2] == 6826); - CHECK(sc_v[13][0] == 2404); - CHECK(sc_v[13][1] == 6826); - CHECK(sc_v[13][2] == 6869); - CHECK(sc_v[14][0] == 2404); - CHECK(sc_v[14][1] == 6826); - CHECK(sc_v[14][2] == 6873); - CHECK(sc_v[15][0] == 2404); - CHECK(sc_v[15][1] == 6826); - CHECK(sc_v[15][2] == 6953); - CHECK(sc_v[16][0] == 6695); - CHECK(sc_v[16][1] == 6729); - CHECK(sc_v[16][2] == 6826); - CHECK(sc_v[17][0] == 6695); - CHECK(sc_v[17][1] == 6780); - CHECK(sc_v[17][2] == 6826); - CHECK(sc_v[18][0] == 6729); - CHECK(sc_v[18][1] == 6804); - CHECK(sc_v[18][2] == 6826); - CHECK(sc_v[19][0] == 6780); - CHECK(sc_v[19][1] == 6826); - CHECK(sc_v[19][2] == 6873); - CHECK(sc_v[20][0] == 6804); - CHECK(sc_v[20][1] == 6826); - CHECK(sc_v[20][2] == 6869); - CHECK(sc_v[21][0] == 6826); - CHECK(sc_v[21][1] == 6869); - CHECK(sc_v[21][2] == 6953); - CHECK(sc_v[22][0] == 6826); - CHECK(sc_v[22][1] == 6873); - CHECK(sc_v[22][2] == 6953); - CHECK(sc_v[23][0] == 2404); - CHECK(sc_v[23][1] == 6695); - CHECK(sc_v[23][2] == 6729); - CHECK(sc_v[23][3] == 6826); - CHECK(sc_v[24][0] == 2404); - CHECK(sc_v[24][1] == 6695); - CHECK(sc_v[24][2] == 6780); - CHECK(sc_v[24][3] == 6826); - CHECK(sc_v[25][0] == 2404); - CHECK(sc_v[25][1] == 6729); - CHECK(sc_v[25][2] == 6804); - CHECK(sc_v[25][3] == 6826); - CHECK(sc_v[26][0] == 2404); - CHECK(sc_v[26][1] == 6780); - CHECK(sc_v[26][2] == 6826); - CHECK(sc_v[26][3] == 6873); - CHECK(sc_v[27][0] == 2404); - CHECK(sc_v[27][1] == 6804); - CHECK(sc_v[27][2] == 6826); - CHECK(sc_v[27][3] == 6869); - CHECK(sc_v[28][0] == 2404); - CHECK(sc_v[28][1] == 6826); - CHECK(sc_v[28][2] == 6869); - CHECK(sc_v[28][3] == 6953); - CHECK(sc_v[29][0] == 2404); - CHECK(sc_v[29][1] == 6826); - CHECK(sc_v[29][2] == 6873); - CHECK(sc_v[29][3] == 6953); - - t = m.tuple_from_id(PV, 2689); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 22); - CHECK(sc_v[0][0] == 2689); - CHECK(sc_v[1][0] == 2332); - CHECK(sc_v[1][1] == 2689); - CHECK(sc_v[2][0] == 2577); - CHECK(sc_v[2][1] == 2689); - CHECK(sc_v[3][0] == 2633); - CHECK(sc_v[3][1] == 2689); - CHECK(sc_v[4][0] == 2689); - CHECK(sc_v[4][1] == 2720); - CHECK(sc_v[5][0] == 2689); - CHECK(sc_v[5][1] == 2732); - CHECK(sc_v[6][0] == 2689); - CHECK(sc_v[6][1] == 2846); - CHECK(sc_v[7][0] == 2332); - CHECK(sc_v[7][1] == 2577); - CHECK(sc_v[7][2] == 2689); - CHECK(sc_v[8][0] == 2332); - CHECK(sc_v[8][1] == 2633); - CHECK(sc_v[8][2] == 2689); - CHECK(sc_v[9][0] == 2332); - CHECK(sc_v[9][1] == 2689); - CHECK(sc_v[9][2] == 2720); - CHECK(sc_v[10][0] == 2332); - CHECK(sc_v[10][1] == 2689); - CHECK(sc_v[10][2] == 2732); - CHECK(sc_v[11][0] == 2332); - CHECK(sc_v[11][1] == 2689); - CHECK(sc_v[11][2] == 2846); - CHECK(sc_v[12][0] == 2577); - CHECK(sc_v[12][1] == 2633); - CHECK(sc_v[12][2] == 2689); - CHECK(sc_v[13][0] == 2577); - CHECK(sc_v[13][1] == 2689); - CHECK(sc_v[13][2] == 2732); - CHECK(sc_v[14][0] == 2633); - CHECK(sc_v[14][1] == 2689); - CHECK(sc_v[14][2] == 2720); - CHECK(sc_v[15][0] == 2689); - CHECK(sc_v[15][1] == 2720); - CHECK(sc_v[15][2] == 2846); - CHECK(sc_v[16][0] == 2689); - CHECK(sc_v[16][1] == 2732); - CHECK(sc_v[16][2] == 2846); - CHECK(sc_v[17][0] == 2332); - CHECK(sc_v[17][1] == 2577); - CHECK(sc_v[17][2] == 2633); - CHECK(sc_v[17][3] == 2689); - CHECK(sc_v[18][0] == 2332); - CHECK(sc_v[18][1] == 2577); - CHECK(sc_v[18][2] == 2689); - CHECK(sc_v[18][3] == 2732); - CHECK(sc_v[19][0] == 2332); - CHECK(sc_v[19][1] == 2633); - CHECK(sc_v[19][2] == 2689); - CHECK(sc_v[19][3] == 2720); - CHECK(sc_v[20][0] == 2332); - CHECK(sc_v[20][1] == 2689); - CHECK(sc_v[20][2] == 2720); - CHECK(sc_v[20][3] == 2846); - CHECK(sc_v[21][0] == 2332); - CHECK(sc_v[21][1] == 2689); - CHECK(sc_v[21][2] == 2732); - CHECK(sc_v[21][3] == 2846); - - t = m.edge_tuple_from_vids(5175, 5238); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 6); - CHECK(sc_e[0][0] == 5175); - CHECK(sc_e[0][1] == 5238); - CHECK(sc_e[1][0] == 2480); - CHECK(sc_e[1][1] == 5175); - CHECK(sc_e[1][2] == 5238); - CHECK(sc_e[2][0] == 5095); - CHECK(sc_e[2][1] == 5175); - CHECK(sc_e[2][2] == 5238); - CHECK(sc_e[3][0] == 5175); - CHECK(sc_e[3][1] == 5238); - CHECK(sc_e[3][2] == 5250); - CHECK(sc_e[4][0] == 2480); - CHECK(sc_e[4][1] == 5095); - CHECK(sc_e[4][2] == 5175); - CHECK(sc_e[4][3] == 5238); - CHECK(sc_e[5][0] == 2480); - CHECK(sc_e[5][1] == 5175); - CHECK(sc_e[5][2] == 5238); - CHECK(sc_e[5][3] == 5250); - - t = m.edge_tuple_from_vids(1623, 1861); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 1623); - CHECK(sc_e[0][1] == 1861); - CHECK(sc_e[1][0] == 1002); - CHECK(sc_e[1][1] == 1623); - CHECK(sc_e[1][2] == 1861); - CHECK(sc_e[2][0] == 1021); - CHECK(sc_e[2][1] == 1623); - CHECK(sc_e[2][2] == 1861); - CHECK(sc_e[3][0] == 1042); - CHECK(sc_e[3][1] == 1623); - CHECK(sc_e[3][2] == 1861); - CHECK(sc_e[4][0] == 1623); - CHECK(sc_e[4][1] == 1641); - CHECK(sc_e[4][2] == 1861); - CHECK(sc_e[5][0] == 1623); - CHECK(sc_e[5][1] == 1804); - CHECK(sc_e[5][2] == 1861); - CHECK(sc_e[6][0] == 1002); - CHECK(sc_e[6][1] == 1042); - CHECK(sc_e[6][2] == 1623); - CHECK(sc_e[6][3] == 1861); - CHECK(sc_e[7][0] == 1002); - CHECK(sc_e[7][1] == 1623); - CHECK(sc_e[7][2] == 1804); - CHECK(sc_e[7][3] == 1861); - CHECK(sc_e[8][0] == 1021); - CHECK(sc_e[8][1] == 1042); - CHECK(sc_e[8][2] == 1623); - CHECK(sc_e[8][3] == 1861); - CHECK(sc_e[9][0] == 1021); - CHECK(sc_e[9][1] == 1623); - CHECK(sc_e[9][2] == 1641); - CHECK(sc_e[9][3] == 1861); - CHECK(sc_e[10][0] == 1623); - CHECK(sc_e[10][1] == 1641); - CHECK(sc_e[10][2] == 1804); - CHECK(sc_e[10][3] == 1861); - - t = m.edge_tuple_from_vids(7559, 7787); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 7559); - CHECK(sc_e[0][1] == 7787); - CHECK(sc_e[1][0] == 327); - CHECK(sc_e[1][1] == 7559); - CHECK(sc_e[1][2] == 7787); - CHECK(sc_e[2][0] == 359); - CHECK(sc_e[2][1] == 7559); - CHECK(sc_e[2][2] == 7787); - CHECK(sc_e[3][0] == 7330); - CHECK(sc_e[3][1] == 7559); - CHECK(sc_e[3][2] == 7787); - CHECK(sc_e[4][0] == 7559); - CHECK(sc_e[4][1] == 7634); - CHECK(sc_e[4][2] == 7787); - CHECK(sc_e[5][0] == 7559); - CHECK(sc_e[5][1] == 7703); - CHECK(sc_e[5][2] == 7787); - CHECK(sc_e[6][0] == 327); - CHECK(sc_e[6][1] == 359); - CHECK(sc_e[6][2] == 7559); - CHECK(sc_e[6][3] == 7787); - CHECK(sc_e[7][0] == 327); - CHECK(sc_e[7][1] == 7559); - CHECK(sc_e[7][2] == 7703); - CHECK(sc_e[7][3] == 7787); - CHECK(sc_e[8][0] == 359); - CHECK(sc_e[8][1] == 7559); - CHECK(sc_e[8][2] == 7634); - CHECK(sc_e[8][3] == 7787); - CHECK(sc_e[9][0] == 7330); - CHECK(sc_e[9][1] == 7559); - CHECK(sc_e[9][2] == 7634); - CHECK(sc_e[9][3] == 7787); - CHECK(sc_e[10][0] == 7330); - CHECK(sc_e[10][1] == 7559); - CHECK(sc_e[10][2] == 7703); - CHECK(sc_e[10][3] == 7787); - - t = m.edge_tuple_from_vids(6200, 7751); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 9); - CHECK(sc_e[0][0] == 6200); - CHECK(sc_e[0][1] == 7751); - CHECK(sc_e[1][0] == 6044); - CHECK(sc_e[1][1] == 6200); - CHECK(sc_e[1][2] == 7751); - CHECK(sc_e[2][0] == 6115); - CHECK(sc_e[2][1] == 6200); - CHECK(sc_e[2][2] == 7751); - CHECK(sc_e[3][0] == 6191); - CHECK(sc_e[3][1] == 6200); - CHECK(sc_e[3][2] == 7751); - CHECK(sc_e[4][0] == 6200); - CHECK(sc_e[4][1] == 7751); - CHECK(sc_e[4][2] == 7893); - CHECK(sc_e[5][0] == 6044); - CHECK(sc_e[5][1] == 6115); - CHECK(sc_e[5][2] == 6200); - CHECK(sc_e[5][3] == 7751); - CHECK(sc_e[6][0] == 6044); - CHECK(sc_e[6][1] == 6191); - CHECK(sc_e[6][2] == 6200); - CHECK(sc_e[6][3] == 7751); - CHECK(sc_e[7][0] == 6115); - CHECK(sc_e[7][1] == 6200); - CHECK(sc_e[7][2] == 7751); - CHECK(sc_e[7][3] == 7893); - CHECK(sc_e[8][0] == 6191); - CHECK(sc_e[8][1] == 6200); - CHECK(sc_e[8][2] == 7751); - CHECK(sc_e[8][3] == 7893); - - t = m.edge_tuple_from_vids(1416, 7335); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 13); - CHECK(sc_e[0][0] == 1416); - CHECK(sc_e[0][1] == 7335); - CHECK(sc_e[1][0] == 1110); - CHECK(sc_e[1][1] == 1416); - CHECK(sc_e[1][2] == 7335); - CHECK(sc_e[2][0] == 1150); - CHECK(sc_e[2][1] == 1416); - CHECK(sc_e[2][2] == 7335); - CHECK(sc_e[3][0] == 1318); - CHECK(sc_e[3][1] == 1416); - CHECK(sc_e[3][2] == 7335); - CHECK(sc_e[4][0] == 1416); - CHECK(sc_e[4][1] == 1540); - CHECK(sc_e[4][2] == 7335); - CHECK(sc_e[5][0] == 1416); - CHECK(sc_e[5][1] == 1597); - CHECK(sc_e[5][2] == 7335); - CHECK(sc_e[6][0] == 1416); - CHECK(sc_e[6][1] == 7332); - CHECK(sc_e[6][2] == 7335); - CHECK(sc_e[7][0] == 1110); - CHECK(sc_e[7][1] == 1150); - CHECK(sc_e[7][2] == 1416); - CHECK(sc_e[7][3] == 7335); - CHECK(sc_e[8][0] == 1110); - CHECK(sc_e[8][1] == 1416); - CHECK(sc_e[8][2] == 7332); - CHECK(sc_e[8][3] == 7335); - CHECK(sc_e[9][0] == 1150); - CHECK(sc_e[9][1] == 1318); - CHECK(sc_e[9][2] == 1416); - CHECK(sc_e[9][3] == 7335); - CHECK(sc_e[10][0] == 1318); - CHECK(sc_e[10][1] == 1416); - CHECK(sc_e[10][2] == 1540); - CHECK(sc_e[10][3] == 7335); - CHECK(sc_e[11][0] == 1416); - CHECK(sc_e[11][1] == 1540); - CHECK(sc_e[11][2] == 1597); - CHECK(sc_e[11][3] == 7335); - CHECK(sc_e[12][0] == 1416); - CHECK(sc_e[12][1] == 1597); - CHECK(sc_e[12][2] == 7332); - CHECK(sc_e[12][3] == 7335); - - t = m.face_tuple_from_vids(1957, 2037, 2368); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 1957); - CHECK(sc_f[0][1] == 2037); - CHECK(sc_f[0][2] == 2368); - CHECK(sc_f[1][0] == 1930); - CHECK(sc_f[1][1] == 1957); - CHECK(sc_f[1][2] == 2037); - CHECK(sc_f[1][3] == 2368); - CHECK(sc_f[2][0] == 1957); - CHECK(sc_f[2][1] == 2037); - CHECK(sc_f[2][2] == 2368); - CHECK(sc_f[2][3] == 2390); - - t = m.face_tuple_from_vids(2052, 2067, 2157); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 2052); - CHECK(sc_f[0][1] == 2067); - CHECK(sc_f[0][2] == 2157); - CHECK(sc_f[1][0] == 2052); - CHECK(sc_f[1][1] == 2067); - CHECK(sc_f[1][2] == 2157); - CHECK(sc_f[1][3] == 2158); - CHECK(sc_f[2][0] == 2052); - CHECK(sc_f[2][1] == 2067); - CHECK(sc_f[2][2] == 2157); - CHECK(sc_f[2][3] == 2164); - - t = m.face_tuple_from_vids(6013, 6062, 6121); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 6013); - CHECK(sc_f[0][1] == 6062); - CHECK(sc_f[0][2] == 6121); - CHECK(sc_f[1][0] == 6013); - CHECK(sc_f[1][1] == 6062); - CHECK(sc_f[1][2] == 6121); - CHECK(sc_f[1][3] == 7679); - - t = m.face_tuple_from_vids(2077, 2314, 7596); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 3); - CHECK(sc_f[0][0] == 2077); - CHECK(sc_f[0][1] == 2314); - CHECK(sc_f[0][2] == 7596); - CHECK(sc_f[1][0] == 2077); - CHECK(sc_f[1][1] == 2199); - CHECK(sc_f[1][2] == 2314); - CHECK(sc_f[1][3] == 7596); - CHECK(sc_f[2][0] == 2077); - CHECK(sc_f[2][1] == 2283); - CHECK(sc_f[2][2] == 2314); - CHECK(sc_f[2][3] == 7596); - - t = m.face_tuple_from_vids(3702, 4081, 4130); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 3702); - CHECK(sc_f[0][1] == 4081); - CHECK(sc_f[0][2] == 4130); - CHECK(sc_f[1][0] == 3702); - CHECK(sc_f[1][1] == 3801); - CHECK(sc_f[1][2] == 4081); - CHECK(sc_f[1][3] == 4130); - - t = m.tet_tuple_from_vids(3485, 3580, 3754, 3787); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 3485); - CHECK(sc_t[0][1] == 3580); - CHECK(sc_t[0][2] == 3754); - CHECK(sc_t[0][3] == 3787); - - t = m.tet_tuple_from_vids(571, 3181, 3742, 7379); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 571); - CHECK(sc_t[0][1] == 3181); - CHECK(sc_t[0][2] == 3742); - CHECK(sc_t[0][3] == 7379); - - t = m.tet_tuple_from_vids(2824, 3017, 3076, 7527); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 2824); - CHECK(sc_t[0][1] == 3017); - CHECK(sc_t[0][2] == 3076); - CHECK(sc_t[0][3] == 7527); - - t = m.tet_tuple_from_vids(1561, 7367, 7663, 7807); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 1561); - CHECK(sc_t[0][1] == 7367); - CHECK(sc_t[0][2] == 7663); - CHECK(sc_t[0][3] == 7807); - - t = m.tet_tuple_from_vids(3707, 3798, 3816, 7890); - sc_t = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 3707); - CHECK(sc_t[0][1] == 3798); - CHECK(sc_t[0][2] == 3816); - CHECK(sc_t[0][3] == 7890); -} - -TEST_CASE( - "simplex_with_boundary_bunny_tetwild_80", - "[simplicial_complex][simplex_with_boundary][3D]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 4765); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 4765); - - t = m.tuple_from_id(PV, 3081); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 3081); - - t = m.tuple_from_id(PV, 1879); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 1879); - - t = m.tuple_from_id(PV, 4040); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 4040); - - t = m.tuple_from_id(PV, 1848); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 1848); - - t = m.edge_tuple_from_vids(6255, 7515); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 6255); - CHECK(sc_e[1][0] == 7515); - CHECK(sc_e[2][0] == 6255); - CHECK(sc_e[2][1] == 7515); - - t = m.edge_tuple_from_vids(2812, 2859); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 2812); - CHECK(sc_e[1][0] == 2859); - CHECK(sc_e[2][0] == 2812); - CHECK(sc_e[2][1] == 2859); - - t = m.edge_tuple_from_vids(997, 1148); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 997); - CHECK(sc_e[1][0] == 1148); - CHECK(sc_e[2][0] == 997); - CHECK(sc_e[2][1] == 1148); - - t = m.edge_tuple_from_vids(754, 981); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 754); - CHECK(sc_e[1][0] == 981); - CHECK(sc_e[2][0] == 754); - CHECK(sc_e[2][1] == 981); - - t = m.edge_tuple_from_vids(6959, 7440); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 6959); - CHECK(sc_e[1][0] == 7440); - CHECK(sc_e[2][0] == 6959); - CHECK(sc_e[2][1] == 7440); - - t = m.face_tuple_from_vids(1145, 1198, 1205); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 1145); - CHECK(sc_f[1][0] == 1198); - CHECK(sc_f[2][0] == 1205); - CHECK(sc_f[3][0] == 1145); - CHECK(sc_f[3][1] == 1198); - CHECK(sc_f[4][0] == 1145); - CHECK(sc_f[4][1] == 1205); - CHECK(sc_f[5][0] == 1198); - CHECK(sc_f[5][1] == 1205); - CHECK(sc_f[6][0] == 1145); - CHECK(sc_f[6][1] == 1198); - CHECK(sc_f[6][2] == 1205); - - t = m.face_tuple_from_vids(2221, 2371, 7637); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 2221); - CHECK(sc_f[1][0] == 2371); - CHECK(sc_f[2][0] == 7637); - CHECK(sc_f[3][0] == 2221); - CHECK(sc_f[3][1] == 2371); - CHECK(sc_f[4][0] == 2221); - CHECK(sc_f[4][1] == 7637); - CHECK(sc_f[5][0] == 2371); - CHECK(sc_f[5][1] == 7637); - CHECK(sc_f[6][0] == 2221); - CHECK(sc_f[6][1] == 2371); - CHECK(sc_f[6][2] == 7637); - - t = m.face_tuple_from_vids(290, 348, 7588); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - for (int i = 0; i < sc_f.size(); i++) { - std::cout << i << ": "; - for (int j = 0; j < sc_f[i].size(); j++) { - std::cout << sc_f[i][j] << " "; - } - std::cout << std::endl; - } - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 290); - CHECK(sc_f[1][0] == 348); - CHECK(sc_f[2][0] == 7588); - CHECK(sc_f[3][0] == 290); - CHECK(sc_f[3][1] == 348); - CHECK(sc_f[4][0] == 290); - CHECK(sc_f[4][1] == 7588); - CHECK(sc_f[5][0] == 348); - CHECK(sc_f[5][1] == 7588); - CHECK(sc_f[6][0] == 290); - CHECK(sc_f[6][1] == 348); - CHECK(sc_f[6][2] == 7588); - - t = m.face_tuple_from_vids(1439, 1442, 1523); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 1439); - CHECK(sc_f[1][0] == 1442); - CHECK(sc_f[2][0] == 1523); - CHECK(sc_f[3][0] == 1439); - CHECK(sc_f[3][1] == 1442); - CHECK(sc_f[4][0] == 1439); - CHECK(sc_f[4][1] == 1523); - CHECK(sc_f[5][0] == 1442); - CHECK(sc_f[5][1] == 1523); - CHECK(sc_f[6][0] == 1439); - CHECK(sc_f[6][1] == 1442); - CHECK(sc_f[6][2] == 1523); - - t = m.face_tuple_from_vids(2217, 2297, 2502); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 2217); - CHECK(sc_f[1][0] == 2297); - CHECK(sc_f[2][0] == 2502); - CHECK(sc_f[3][0] == 2217); - CHECK(sc_f[3][1] == 2297); - CHECK(sc_f[4][0] == 2217); - CHECK(sc_f[4][1] == 2502); - CHECK(sc_f[5][0] == 2297); - CHECK(sc_f[5][1] == 2502); - CHECK(sc_f[6][0] == 2217); - CHECK(sc_f[6][1] == 2297); - CHECK(sc_f[6][2] == 2502); - - t = m.tet_tuple_from_vids(3557, 3922, 3950, 4016); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 3557); - CHECK(sc_t[1][0] == 3922); - CHECK(sc_t[2][0] == 3950); - CHECK(sc_t[3][0] == 4016); - CHECK(sc_t[4][0] == 3557); - CHECK(sc_t[4][1] == 3922); - CHECK(sc_t[5][0] == 3557); - CHECK(sc_t[5][1] == 3950); - CHECK(sc_t[6][0] == 3557); - CHECK(sc_t[6][1] == 4016); - CHECK(sc_t[7][0] == 3922); - CHECK(sc_t[7][1] == 3950); - CHECK(sc_t[8][0] == 3922); - CHECK(sc_t[8][1] == 4016); - CHECK(sc_t[9][0] == 3950); - CHECK(sc_t[9][1] == 4016); - CHECK(sc_t[10][0] == 3557); - CHECK(sc_t[10][1] == 3922); - CHECK(sc_t[10][2] == 3950); - CHECK(sc_t[11][0] == 3557); - CHECK(sc_t[11][1] == 3922); - CHECK(sc_t[11][2] == 4016); - CHECK(sc_t[12][0] == 3557); - CHECK(sc_t[12][1] == 3950); - CHECK(sc_t[12][2] == 4016); - CHECK(sc_t[13][0] == 3922); - CHECK(sc_t[13][1] == 3950); - CHECK(sc_t[13][2] == 4016); - CHECK(sc_t[14][0] == 3557); - CHECK(sc_t[14][1] == 3922); - CHECK(sc_t[14][2] == 3950); - CHECK(sc_t[14][3] == 4016); - - t = m.tet_tuple_from_vids(1568, 1582, 1589, 1736); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 1568); - CHECK(sc_t[1][0] == 1582); - CHECK(sc_t[2][0] == 1589); - CHECK(sc_t[3][0] == 1736); - CHECK(sc_t[4][0] == 1568); - CHECK(sc_t[4][1] == 1582); - CHECK(sc_t[5][0] == 1568); - CHECK(sc_t[5][1] == 1589); - CHECK(sc_t[6][0] == 1568); - CHECK(sc_t[6][1] == 1736); - CHECK(sc_t[7][0] == 1582); - CHECK(sc_t[7][1] == 1589); - CHECK(sc_t[8][0] == 1582); - CHECK(sc_t[8][1] == 1736); - CHECK(sc_t[9][0] == 1589); - CHECK(sc_t[9][1] == 1736); - CHECK(sc_t[10][0] == 1568); - CHECK(sc_t[10][1] == 1582); - CHECK(sc_t[10][2] == 1589); - CHECK(sc_t[11][0] == 1568); - CHECK(sc_t[11][1] == 1582); - CHECK(sc_t[11][2] == 1736); - CHECK(sc_t[12][0] == 1568); - CHECK(sc_t[12][1] == 1589); - CHECK(sc_t[12][2] == 1736); - CHECK(sc_t[13][0] == 1582); - CHECK(sc_t[13][1] == 1589); - CHECK(sc_t[13][2] == 1736); - CHECK(sc_t[14][0] == 1568); - CHECK(sc_t[14][1] == 1582); - CHECK(sc_t[14][2] == 1589); - CHECK(sc_t[14][3] == 1736); - - t = m.tet_tuple_from_vids(4443, 4468, 4472, 7848); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 4443); - CHECK(sc_t[1][0] == 4468); - CHECK(sc_t[2][0] == 4472); - CHECK(sc_t[3][0] == 7848); - CHECK(sc_t[4][0] == 4443); - CHECK(sc_t[4][1] == 4468); - CHECK(sc_t[5][0] == 4443); - CHECK(sc_t[5][1] == 4472); - CHECK(sc_t[6][0] == 4443); - CHECK(sc_t[6][1] == 7848); - CHECK(sc_t[7][0] == 4468); - CHECK(sc_t[7][1] == 4472); - CHECK(sc_t[8][0] == 4468); - CHECK(sc_t[8][1] == 7848); - CHECK(sc_t[9][0] == 4472); - CHECK(sc_t[9][1] == 7848); - CHECK(sc_t[10][0] == 4443); - CHECK(sc_t[10][1] == 4468); - CHECK(sc_t[10][2] == 4472); - CHECK(sc_t[11][0] == 4443); - CHECK(sc_t[11][1] == 4468); - CHECK(sc_t[11][2] == 7848); - CHECK(sc_t[12][0] == 4443); - CHECK(sc_t[12][1] == 4472); - CHECK(sc_t[12][2] == 7848); - CHECK(sc_t[13][0] == 4468); - CHECK(sc_t[13][1] == 4472); - CHECK(sc_t[13][2] == 7848); - CHECK(sc_t[14][0] == 4443); - CHECK(sc_t[14][1] == 4468); - CHECK(sc_t[14][2] == 4472); - CHECK(sc_t[14][3] == 7848); - - t = m.tet_tuple_from_vids(6731, 6758, 6803, 7702); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 6731); - CHECK(sc_t[1][0] == 6758); - CHECK(sc_t[2][0] == 6803); - CHECK(sc_t[3][0] == 7702); - CHECK(sc_t[4][0] == 6731); - CHECK(sc_t[4][1] == 6758); - CHECK(sc_t[5][0] == 6731); - CHECK(sc_t[5][1] == 6803); - CHECK(sc_t[6][0] == 6731); - CHECK(sc_t[6][1] == 7702); - CHECK(sc_t[7][0] == 6758); - CHECK(sc_t[7][1] == 6803); - CHECK(sc_t[8][0] == 6758); - CHECK(sc_t[8][1] == 7702); - CHECK(sc_t[9][0] == 6803); - CHECK(sc_t[9][1] == 7702); - CHECK(sc_t[10][0] == 6731); - CHECK(sc_t[10][1] == 6758); - CHECK(sc_t[10][2] == 6803); - CHECK(sc_t[11][0] == 6731); - CHECK(sc_t[11][1] == 6758); - CHECK(sc_t[11][2] == 7702); - CHECK(sc_t[12][0] == 6731); - CHECK(sc_t[12][1] == 6803); - CHECK(sc_t[12][2] == 7702); - CHECK(sc_t[13][0] == 6758); - CHECK(sc_t[13][1] == 6803); - CHECK(sc_t[13][2] == 7702); - CHECK(sc_t[14][0] == 6731); - CHECK(sc_t[14][1] == 6758); - CHECK(sc_t[14][2] == 6803); - CHECK(sc_t[14][3] == 7702); - - t = m.tet_tuple_from_vids(847, 925, 986, 7342); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 847); - CHECK(sc_t[1][0] == 925); - CHECK(sc_t[2][0] == 986); - CHECK(sc_t[3][0] == 7342); - CHECK(sc_t[4][0] == 847); - CHECK(sc_t[4][1] == 925); - CHECK(sc_t[5][0] == 847); - CHECK(sc_t[5][1] == 986); - CHECK(sc_t[6][0] == 847); - CHECK(sc_t[6][1] == 7342); - CHECK(sc_t[7][0] == 925); - CHECK(sc_t[7][1] == 986); - CHECK(sc_t[8][0] == 925); - CHECK(sc_t[8][1] == 7342); - CHECK(sc_t[9][0] == 986); - CHECK(sc_t[9][1] == 7342); - CHECK(sc_t[10][0] == 847); - CHECK(sc_t[10][1] == 925); - CHECK(sc_t[10][2] == 986); - CHECK(sc_t[11][0] == 847); - CHECK(sc_t[11][1] == 925); - CHECK(sc_t[11][2] == 7342); - CHECK(sc_t[12][0] == 847); - CHECK(sc_t[12][1] == 986); - CHECK(sc_t[12][2] == 7342); - CHECK(sc_t[13][0] == 925); - CHECK(sc_t[13][1] == 986); - CHECK(sc_t[13][2] == 7342); - CHECK(sc_t[14][0] == 847); - CHECK(sc_t[14][1] == 925); - CHECK(sc_t[14][2] == 986); - CHECK(sc_t[14][3] == 7342); -} - -TEST_CASE( - "simplex_with_boundary_bunny_tetwild_80", - "[simplicial_complex][simplex_with_boundary][3D][2]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 620); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 620); - - t = m.tuple_from_id(PV, 4386); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 4386); - - t = m.tuple_from_id(PV, 4518); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 4518); - - t = m.tuple_from_id(PV, 4892); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 4892); - - t = m.tuple_from_id(PV, 1390); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 1); - CHECK(sc_v[0][0] == 1390); - - t = m.edge_tuple_from_vids(1012, 1080); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 1012); - CHECK(sc_e[1][0] == 1080); - CHECK(sc_e[2][0] == 1012); - CHECK(sc_e[2][1] == 1080); - - t = m.edge_tuple_from_vids(2261, 2472); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 2261); - CHECK(sc_e[1][0] == 2472); - CHECK(sc_e[2][0] == 2261); - CHECK(sc_e[2][1] == 2472); - - t = m.edge_tuple_from_vids(4958, 7685); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 4958); - CHECK(sc_e[1][0] == 7685); - CHECK(sc_e[2][0] == 4958); - CHECK(sc_e[2][1] == 7685); - - t = m.edge_tuple_from_vids(5141, 5252); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 5141); - CHECK(sc_e[1][0] == 5252); - CHECK(sc_e[2][0] == 5141); - CHECK(sc_e[2][1] == 5252); - - t = m.edge_tuple_from_vids(4536, 4588); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 4536); - CHECK(sc_e[1][0] == 4588); - CHECK(sc_e[2][0] == 4536); - CHECK(sc_e[2][1] == 4588); - - t = m.face_tuple_from_vids(7414, 7580, 7608); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 7414); - CHECK(sc_f[1][0] == 7580); - CHECK(sc_f[2][0] == 7608); - CHECK(sc_f[3][0] == 7414); - CHECK(sc_f[3][1] == 7580); - CHECK(sc_f[4][0] == 7414); - CHECK(sc_f[4][1] == 7608); - CHECK(sc_f[5][0] == 7580); - CHECK(sc_f[5][1] == 7608); - CHECK(sc_f[6][0] == 7414); - CHECK(sc_f[6][1] == 7580); - CHECK(sc_f[6][2] == 7608); - - t = m.face_tuple_from_vids(6075, 6110, 6151); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 6075); - CHECK(sc_f[1][0] == 6110); - CHECK(sc_f[2][0] == 6151); - CHECK(sc_f[3][0] == 6075); - CHECK(sc_f[3][1] == 6110); - CHECK(sc_f[4][0] == 6075); - CHECK(sc_f[4][1] == 6151); - CHECK(sc_f[5][0] == 6110); - CHECK(sc_f[5][1] == 6151); - CHECK(sc_f[6][0] == 6075); - CHECK(sc_f[6][1] == 6110); - CHECK(sc_f[6][2] == 6151); - - t = m.face_tuple_from_vids(6506, 6530, 6537); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 6506); - CHECK(sc_f[1][0] == 6530); - CHECK(sc_f[2][0] == 6537); - CHECK(sc_f[3][0] == 6506); - CHECK(sc_f[3][1] == 6530); - CHECK(sc_f[4][0] == 6506); - CHECK(sc_f[4][1] == 6537); - CHECK(sc_f[5][0] == 6530); - CHECK(sc_f[5][1] == 6537); - CHECK(sc_f[6][0] == 6506); - CHECK(sc_f[6][1] == 6530); - CHECK(sc_f[6][2] == 6537); - - t = m.face_tuple_from_vids(615, 622, 667); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 615); - CHECK(sc_f[1][0] == 622); - CHECK(sc_f[2][0] == 667); - CHECK(sc_f[3][0] == 615); - CHECK(sc_f[3][1] == 622); - CHECK(sc_f[4][0] == 615); - CHECK(sc_f[4][1] == 667); - CHECK(sc_f[5][0] == 622); - CHECK(sc_f[5][1] == 667); - CHECK(sc_f[6][0] == 615); - CHECK(sc_f[6][1] == 622); - CHECK(sc_f[6][2] == 667); - - t = m.face_tuple_from_vids(3388, 3652, 7916); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 3388); - CHECK(sc_f[1][0] == 3652); - CHECK(sc_f[2][0] == 7916); - CHECK(sc_f[3][0] == 3388); - CHECK(sc_f[3][1] == 3652); - CHECK(sc_f[4][0] == 3388); - CHECK(sc_f[4][1] == 7916); - CHECK(sc_f[5][0] == 3652); - CHECK(sc_f[5][1] == 7916); - CHECK(sc_f[6][0] == 3388); - CHECK(sc_f[6][1] == 3652); - CHECK(sc_f[6][2] == 7916); - - t = m.tet_tuple_from_vids(4857, 7384, 7844, 7848); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 4857); - CHECK(sc_t[1][0] == 7384); - CHECK(sc_t[2][0] == 7844); - CHECK(sc_t[3][0] == 7848); - CHECK(sc_t[4][0] == 4857); - CHECK(sc_t[4][1] == 7384); - CHECK(sc_t[5][0] == 4857); - CHECK(sc_t[5][1] == 7844); - CHECK(sc_t[6][0] == 4857); - CHECK(sc_t[6][1] == 7848); - CHECK(sc_t[7][0] == 7384); - CHECK(sc_t[7][1] == 7844); - CHECK(sc_t[8][0] == 7384); - CHECK(sc_t[8][1] == 7848); - CHECK(sc_t[9][0] == 7844); - CHECK(sc_t[9][1] == 7848); - CHECK(sc_t[10][0] == 4857); - CHECK(sc_t[10][1] == 7384); - CHECK(sc_t[10][2] == 7844); - CHECK(sc_t[11][0] == 4857); - CHECK(sc_t[11][1] == 7384); - CHECK(sc_t[11][2] == 7848); - CHECK(sc_t[12][0] == 4857); - CHECK(sc_t[12][1] == 7844); - CHECK(sc_t[12][2] == 7848); - CHECK(sc_t[13][0] == 7384); - CHECK(sc_t[13][1] == 7844); - CHECK(sc_t[13][2] == 7848); - CHECK(sc_t[14][0] == 4857); - CHECK(sc_t[14][1] == 7384); - CHECK(sc_t[14][2] == 7844); - CHECK(sc_t[14][3] == 7848); - - t = m.tet_tuple_from_vids(458, 541, 545, 7801); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 458); - CHECK(sc_t[1][0] == 541); - CHECK(sc_t[2][0] == 545); - CHECK(sc_t[3][0] == 7801); - CHECK(sc_t[4][0] == 458); - CHECK(sc_t[4][1] == 541); - CHECK(sc_t[5][0] == 458); - CHECK(sc_t[5][1] == 545); - CHECK(sc_t[6][0] == 458); - CHECK(sc_t[6][1] == 7801); - CHECK(sc_t[7][0] == 541); - CHECK(sc_t[7][1] == 545); - CHECK(sc_t[8][0] == 541); - CHECK(sc_t[8][1] == 7801); - CHECK(sc_t[9][0] == 545); - CHECK(sc_t[9][1] == 7801); - CHECK(sc_t[10][0] == 458); - CHECK(sc_t[10][1] == 541); - CHECK(sc_t[10][2] == 545); - CHECK(sc_t[11][0] == 458); - CHECK(sc_t[11][1] == 541); - CHECK(sc_t[11][2] == 7801); - CHECK(sc_t[12][0] == 458); - CHECK(sc_t[12][1] == 545); - CHECK(sc_t[12][2] == 7801); - CHECK(sc_t[13][0] == 541); - CHECK(sc_t[13][1] == 545); - CHECK(sc_t[13][2] == 7801); - CHECK(sc_t[14][0] == 458); - CHECK(sc_t[14][1] == 541); - CHECK(sc_t[14][2] == 545); - CHECK(sc_t[14][3] == 7801); - - t = m.tet_tuple_from_vids(2236, 4151, 4594, 7594); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 2236); - CHECK(sc_t[1][0] == 4151); - CHECK(sc_t[2][0] == 4594); - CHECK(sc_t[3][0] == 7594); - CHECK(sc_t[4][0] == 2236); - CHECK(sc_t[4][1] == 4151); - CHECK(sc_t[5][0] == 2236); - CHECK(sc_t[5][1] == 4594); - CHECK(sc_t[6][0] == 2236); - CHECK(sc_t[6][1] == 7594); - CHECK(sc_t[7][0] == 4151); - CHECK(sc_t[7][1] == 4594); - CHECK(sc_t[8][0] == 4151); - CHECK(sc_t[8][1] == 7594); - CHECK(sc_t[9][0] == 4594); - CHECK(sc_t[9][1] == 7594); - CHECK(sc_t[10][0] == 2236); - CHECK(sc_t[10][1] == 4151); - CHECK(sc_t[10][2] == 4594); - CHECK(sc_t[11][0] == 2236); - CHECK(sc_t[11][1] == 4151); - CHECK(sc_t[11][2] == 7594); - CHECK(sc_t[12][0] == 2236); - CHECK(sc_t[12][1] == 4594); - CHECK(sc_t[12][2] == 7594); - CHECK(sc_t[13][0] == 4151); - CHECK(sc_t[13][1] == 4594); - CHECK(sc_t[13][2] == 7594); - CHECK(sc_t[14][0] == 2236); - CHECK(sc_t[14][1] == 4151); - CHECK(sc_t[14][2] == 4594); - CHECK(sc_t[14][3] == 7594); - - t = m.tet_tuple_from_vids(1629, 1669, 1746, 2078); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 1629); - CHECK(sc_t[1][0] == 1669); - CHECK(sc_t[2][0] == 1746); - CHECK(sc_t[3][0] == 2078); - CHECK(sc_t[4][0] == 1629); - CHECK(sc_t[4][1] == 1669); - CHECK(sc_t[5][0] == 1629); - CHECK(sc_t[5][1] == 1746); - CHECK(sc_t[6][0] == 1629); - CHECK(sc_t[6][1] == 2078); - CHECK(sc_t[7][0] == 1669); - CHECK(sc_t[7][1] == 1746); - CHECK(sc_t[8][0] == 1669); - CHECK(sc_t[8][1] == 2078); - CHECK(sc_t[9][0] == 1746); - CHECK(sc_t[9][1] == 2078); - CHECK(sc_t[10][0] == 1629); - CHECK(sc_t[10][1] == 1669); - CHECK(sc_t[10][2] == 1746); - CHECK(sc_t[11][0] == 1629); - CHECK(sc_t[11][1] == 1669); - CHECK(sc_t[11][2] == 2078); - CHECK(sc_t[12][0] == 1629); - CHECK(sc_t[12][1] == 1746); - CHECK(sc_t[12][2] == 2078); - CHECK(sc_t[13][0] == 1669); - CHECK(sc_t[13][1] == 1746); - CHECK(sc_t[13][2] == 2078); - CHECK(sc_t[14][0] == 1629); - CHECK(sc_t[14][1] == 1669); - CHECK(sc_t[14][2] == 1746); - CHECK(sc_t[14][3] == 2078); - - t = m.tet_tuple_from_vids(255, 285, 331, 7688); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::simplex_with_boundary(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 15); - CHECK(sc_t[0][0] == 255); - CHECK(sc_t[1][0] == 285); - CHECK(sc_t[2][0] == 331); - CHECK(sc_t[3][0] == 7688); - CHECK(sc_t[4][0] == 255); - CHECK(sc_t[4][1] == 285); - CHECK(sc_t[5][0] == 255); - CHECK(sc_t[5][1] == 331); - CHECK(sc_t[6][0] == 255); - CHECK(sc_t[6][1] == 7688); - CHECK(sc_t[7][0] == 285); - CHECK(sc_t[7][1] == 331); - CHECK(sc_t[8][0] == 285); - CHECK(sc_t[8][1] == 7688); - CHECK(sc_t[9][0] == 331); - CHECK(sc_t[9][1] == 7688); - CHECK(sc_t[10][0] == 255); - CHECK(sc_t[10][1] == 285); - CHECK(sc_t[10][2] == 331); - CHECK(sc_t[11][0] == 255); - CHECK(sc_t[11][1] == 285); - CHECK(sc_t[11][2] == 7688); - CHECK(sc_t[12][0] == 255); - CHECK(sc_t[12][1] == 331); - CHECK(sc_t[12][2] == 7688); - CHECK(sc_t[13][0] == 285); - CHECK(sc_t[13][1] == 331); - CHECK(sc_t[13][2] == 7688); - CHECK(sc_t[14][0] == 255); - CHECK(sc_t[14][1] == 285); - CHECK(sc_t[14][2] == 331); - CHECK(sc_t[14][3] == 7688); -} - - -TEST_CASE("top_coface_simplex_bunny_tetwild_80", "[simplicial_complex][top_coface_simplex][3D]") -{ - Eigen::MatrixXd V; - Eigen::MatrixXi T; - Eigen::MatrixXi F; - Eigen::VectorXi Tritag, Tettag; - std::string name = "/bunny_tetwild_80.msh"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::readMSH(path, V, F, T, Tritag, Tettag); - tests_3d::DEBUG_TetMesh m; - RowVectors4l Tr; - Tr.resize(T.rows(), T.cols()); - assert(T.cols() == 4); - for (long i = 0; i < T.rows(); i++) { - Tr(i, 0) = T(i, 0); - Tr(i, 1) = T(i, 1); - Tr(i, 2) = T(i, 2); - Tr(i, 3) = T(i, 3); - } - m.initialize(Tr); - - Tuple t; - std::vector> sc_v, sc_e, sc_f, sc_t; - t = m.tuple_from_id(PV, 2143); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PV, t)).get_simplex_vector()); - - for (int i = 0; i < sc_v.size(); i++) { - std::cout << i << ": "; - for (int j = 0; j < sc_v[i].size(); j++) { - std::cout << sc_v[i][j] << " "; - } - std::cout << std::endl; - } - REQUIRE(sc_v.size() == 6); - CHECK(sc_v[0][0] == 2041); - CHECK(sc_v[0][1] == 2060); - CHECK(sc_v[0][2] == 2143); - CHECK(sc_v[0][3] == 2297); - CHECK(sc_v[1][0] == 2041); - CHECK(sc_v[1][1] == 2128); - CHECK(sc_v[1][2] == 2143); - CHECK(sc_v[1][3] == 2222); - CHECK(sc_v[2][0] == 2041); - CHECK(sc_v[2][1] == 2143); - CHECK(sc_v[2][2] == 2222); - CHECK(sc_v[2][3] == 2297); - CHECK(sc_v[3][0] == 2060); - CHECK(sc_v[3][1] == 2137); - CHECK(sc_v[3][2] == 2143); - CHECK(sc_v[3][3] == 2297); - CHECK(sc_v[4][0] == 2137); - CHECK(sc_v[4][1] == 2143); - CHECK(sc_v[4][2] == 2232); - CHECK(sc_v[4][3] == 2297); - CHECK(sc_v[5][0] == 2143); - CHECK(sc_v[5][1] == 2222); - CHECK(sc_v[5][2] == 2232); - CHECK(sc_v[5][3] == 2297); - - t = m.tuple_from_id(PV, 6450); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 6); - CHECK(sc_v[0][0] == 6366); - CHECK(sc_v[0][1] == 6408); - CHECK(sc_v[0][2] == 6425); - CHECK(sc_v[0][3] == 6450); - CHECK(sc_v[1][0] == 6408); - CHECK(sc_v[1][1] == 6425); - CHECK(sc_v[1][2] == 6450); - CHECK(sc_v[1][3] == 7408); - CHECK(sc_v[2][0] == 6408); - CHECK(sc_v[2][1] == 6450); - CHECK(sc_v[2][2] == 6483); - CHECK(sc_v[2][3] == 7408); - CHECK(sc_v[3][0] == 6425); - CHECK(sc_v[3][1] == 6450); - CHECK(sc_v[3][2] == 6476); - CHECK(sc_v[3][3] == 7408); - CHECK(sc_v[4][0] == 6450); - CHECK(sc_v[4][1] == 6476); - CHECK(sc_v[4][2] == 6546); - CHECK(sc_v[4][3] == 7408); - CHECK(sc_v[5][0] == 6450); - CHECK(sc_v[5][1] == 6483); - CHECK(sc_v[5][2] == 6546); - CHECK(sc_v[5][3] == 7408); - - t = m.tuple_from_id(PV, 1611); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 5); - CHECK(sc_v[0][0] == 1535); - CHECK(sc_v[0][1] == 1611); - CHECK(sc_v[0][2] == 1615); - CHECK(sc_v[0][3] == 1945); - CHECK(sc_v[1][0] == 1535); - CHECK(sc_v[1][1] == 1611); - CHECK(sc_v[1][2] == 1619); - CHECK(sc_v[1][3] == 1945); - CHECK(sc_v[2][0] == 1611); - CHECK(sc_v[2][1] == 1615); - CHECK(sc_v[2][2] == 1722); - CHECK(sc_v[2][3] == 1945); - CHECK(sc_v[3][0] == 1611); - CHECK(sc_v[3][1] == 1619); - CHECK(sc_v[3][2] == 1793); - CHECK(sc_v[3][3] == 1945); - CHECK(sc_v[4][0] == 1611); - CHECK(sc_v[4][1] == 1722); - CHECK(sc_v[4][2] == 1793); - CHECK(sc_v[4][3] == 1945); - - t = m.tuple_from_id(PV, 4298); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 6); - CHECK(sc_v[0][0] == 4074); - CHECK(sc_v[0][1] == 4153); - CHECK(sc_v[0][2] == 4298); - CHECK(sc_v[0][3] == 7811); - CHECK(sc_v[1][0] == 4074); - CHECK(sc_v[1][1] == 4298); - CHECK(sc_v[1][2] == 4398); - CHECK(sc_v[1][3] == 7811); - CHECK(sc_v[2][0] == 4153); - CHECK(sc_v[2][1] == 4272); - CHECK(sc_v[2][2] == 4298); - CHECK(sc_v[2][3] == 7811); - CHECK(sc_v[3][0] == 4272); - CHECK(sc_v[3][1] == 4298); - CHECK(sc_v[3][2] == 4367); - CHECK(sc_v[3][3] == 7811); - CHECK(sc_v[4][0] == 4298); - CHECK(sc_v[4][1] == 4367); - CHECK(sc_v[4][2] == 4399); - CHECK(sc_v[4][3] == 7811); - CHECK(sc_v[5][0] == 4298); - CHECK(sc_v[5][1] == 4398); - CHECK(sc_v[5][2] == 4399); - CHECK(sc_v[5][3] == 7811); - - t = m.tuple_from_id(PV, 4158); - REQUIRE(m.is_valid_slow(t)); - sc_v = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 10); - CHECK(sc_v[0][0] == 4012); - CHECK(sc_v[0][1] == 4039); - CHECK(sc_v[0][2] == 4065); - CHECK(sc_v[0][3] == 4158); - CHECK(sc_v[1][0] == 4012); - CHECK(sc_v[1][1] == 4039); - CHECK(sc_v[1][2] == 4085); - CHECK(sc_v[1][3] == 4158); - CHECK(sc_v[2][0] == 4012); - CHECK(sc_v[2][1] == 4065); - CHECK(sc_v[2][2] == 4158); - CHECK(sc_v[2][3] == 4204); - CHECK(sc_v[3][0] == 4012); - CHECK(sc_v[3][1] == 4085); - CHECK(sc_v[3][2] == 4113); - CHECK(sc_v[3][3] == 4158); - CHECK(sc_v[4][0] == 4012); - CHECK(sc_v[4][1] == 4113); - CHECK(sc_v[4][2] == 4158); - CHECK(sc_v[4][3] == 4204); - CHECK(sc_v[5][0] == 4085); - CHECK(sc_v[5][1] == 4113); - CHECK(sc_v[5][2] == 4158); - CHECK(sc_v[5][3] == 4160); - CHECK(sc_v[6][0] == 4113); - CHECK(sc_v[6][1] == 4158); - CHECK(sc_v[6][2] == 4160); - CHECK(sc_v[6][3] == 4328); - CHECK(sc_v[7][0] == 4113); - CHECK(sc_v[7][1] == 4158); - CHECK(sc_v[7][2] == 4204); - CHECK(sc_v[7][3] == 4328); - CHECK(sc_v[8][0] == 4158); - CHECK(sc_v[8][1] == 4160); - CHECK(sc_v[8][2] == 4321); - CHECK(sc_v[8][3] == 4328); - CHECK(sc_v[9][0] == 4158); - CHECK(sc_v[9][1] == 4204); - CHECK(sc_v[9][2] == 4321); - CHECK(sc_v[9][3] == 4328); - - t = m.edge_tuple_from_vids(2230, 2288); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 2153); - CHECK(sc_e[0][1] == 2230); - CHECK(sc_e[0][2] == 2288); - CHECK(sc_e[0][3] == 2517); - CHECK(sc_e[1][0] == 2230); - CHECK(sc_e[1][1] == 2288); - CHECK(sc_e[1][2] == 2399); - CHECK(sc_e[1][3] == 2517); - - t = m.edge_tuple_from_vids(6216, 6444); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 6216); - CHECK(sc_e[0][1] == 6344); - CHECK(sc_e[0][2] == 6444); - CHECK(sc_e[0][3] == 7455); - CHECK(sc_e[1][0] == 6216); - CHECK(sc_e[1][1] == 6431); - CHECK(sc_e[1][2] == 6444); - CHECK(sc_e[1][3] == 7893); - CHECK(sc_e[2][0] == 6216); - CHECK(sc_e[2][1] == 6444); - CHECK(sc_e[2][2] == 7455); - CHECK(sc_e[2][3] == 7893); - - t = m.edge_tuple_from_vids(7141, 7150); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 1); - CHECK(sc_e[0][0] == 7126); - CHECK(sc_e[0][1] == 7141); - CHECK(sc_e[0][2] == 7150); - CHECK(sc_e[0][3] == 7164); - - t = m.edge_tuple_from_vids(5394, 5475); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 5); - CHECK(sc_e[0][0] == 5294); - CHECK(sc_e[0][1] == 5327); - CHECK(sc_e[0][2] == 5394); - CHECK(sc_e[0][3] == 5475); - CHECK(sc_e[1][0] == 5294); - CHECK(sc_e[1][1] == 5352); - CHECK(sc_e[1][2] == 5394); - CHECK(sc_e[1][3] == 5475); - CHECK(sc_e[2][0] == 5352); - CHECK(sc_e[2][1] == 5394); - CHECK(sc_e[2][2] == 5422); - CHECK(sc_e[2][3] == 5475); - CHECK(sc_e[3][0] == 5394); - CHECK(sc_e[3][1] == 5422); - CHECK(sc_e[3][2] == 5475); - CHECK(sc_e[3][3] == 5492); - CHECK(sc_e[4][0] == 5394); - CHECK(sc_e[4][1] == 5475); - CHECK(sc_e[4][2] == 5492); - CHECK(sc_e[4][3] == 5537); - - t = m.edge_tuple_from_vids(2063, 3083); - REQUIRE(m.is_valid_slow(t)); - sc_e = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 5); - CHECK(sc_e[0][0] == 2063); - CHECK(sc_e[0][1] == 3083); - CHECK(sc_e[0][2] == 3151); - CHECK(sc_e[0][3] == 7404); - CHECK(sc_e[1][0] == 2063); - CHECK(sc_e[1][1] == 3083); - CHECK(sc_e[1][2] == 3151); - CHECK(sc_e[1][3] == 7837); - CHECK(sc_e[2][0] == 2063); - CHECK(sc_e[2][1] == 3083); - CHECK(sc_e[2][2] == 3687); - CHECK(sc_e[2][3] == 7437); - CHECK(sc_e[3][0] == 2063); - CHECK(sc_e[3][1] == 3083); - CHECK(sc_e[3][2] == 3687); - CHECK(sc_e[3][3] == 7837); - CHECK(sc_e[4][0] == 2063); - CHECK(sc_e[4][1] == 3083); - CHECK(sc_e[4][2] == 7404); - CHECK(sc_e[4][3] == 7437); - - t = m.face_tuple_from_vids(5672, 5709, 7814); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 5612); - CHECK(sc_f[0][1] == 5672); - CHECK(sc_f[0][2] == 5709); - CHECK(sc_f[0][3] == 7814); - CHECK(sc_f[1][0] == 5672); - CHECK(sc_f[1][1] == 5709); - CHECK(sc_f[1][2] == 5753); - CHECK(sc_f[1][3] == 7814); - - t = m.face_tuple_from_vids(512, 2757, 4143); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 512); - CHECK(sc_f[0][1] == 2757); - CHECK(sc_f[0][2] == 4143); - CHECK(sc_f[0][3] == 4597); - CHECK(sc_f[1][0] == 512); - CHECK(sc_f[1][1] == 2757); - CHECK(sc_f[1][2] == 4143); - CHECK(sc_f[1][3] == 7677); - - t = m.face_tuple_from_vids(7055, 7144, 7156); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 7055); - CHECK(sc_f[0][1] == 7144); - CHECK(sc_f[0][2] == 7156); - CHECK(sc_f[0][3] == 7799); - - t = m.face_tuple_from_vids(392, 476, 7753); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 2); - CHECK(sc_f[0][0] == 392); - CHECK(sc_f[0][1] == 399); - CHECK(sc_f[0][2] == 476); - CHECK(sc_f[0][3] == 7753); - CHECK(sc_f[1][0] == 392); - CHECK(sc_f[1][1] == 422); - CHECK(sc_f[1][2] == 476); - CHECK(sc_f[1][3] == 7753); - - t = m.face_tuple_from_vids(792, 838, 1076); - REQUIRE(m.is_valid_slow(t)); - sc_f = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 792); - CHECK(sc_f[0][1] == 838); - CHECK(sc_f[0][2] == 955); - CHECK(sc_f[0][3] == 1076); - - t = m.tet_tuple_from_vids(1839, 1950, 1983, 7956); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 1839); - CHECK(sc_t[0][1] == 1950); - CHECK(sc_t[0][2] == 1983); - CHECK(sc_t[0][3] == 7956); - - t = m.tet_tuple_from_vids(5886, 5967, 6096, 7796); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 5886); - CHECK(sc_t[0][1] == 5967); - CHECK(sc_t[0][2] == 6096); - CHECK(sc_t[0][3] == 7796); - - t = m.tet_tuple_from_vids(4458, 4487, 4527, 7811); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 4458); - CHECK(sc_t[0][1] == 4487); - CHECK(sc_t[0][2] == 4527); - CHECK(sc_t[0][3] == 7811); - - t = m.tet_tuple_from_vids(4645, 4704, 4753, 7385); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 4645); - CHECK(sc_t[0][1] == 4704); - CHECK(sc_t[0][2] == 4753); - CHECK(sc_t[0][3] == 7385); - - t = m.tet_tuple_from_vids(4186, 4260, 4264, 7872); - REQUIRE(m.is_valid_slow(t)); - sc_t = get_sorted_sc( - m, - SimplicialComplex::top_coface_simplex(m, Simplex(PT, t)).get_simplex_vector()); - REQUIRE(sc_t.size() == 1); - CHECK(sc_t[0][0] == 4186); - CHECK(sc_t[0][1] == 4260); - CHECK(sc_t[0][2] == 4264); - CHECK(sc_t[0][3] == 7872); -} diff --git a/tests/simplicial_complex_tests/circle_mesh_tests.cpp b/tests/simplicial_complex_tests/circle_mesh_tests.cpp deleted file mode 100644 index 24c9857c1e..0000000000 --- a/tests/simplicial_complex_tests/circle_mesh_tests.cpp +++ /dev/null @@ -1,986 +0,0 @@ -#include -#include -#include -#include "../tools/DEBUG_TriMesh.hpp" - -using namespace wmtk; -constexpr PrimitiveType PV = PrimitiveType::Vertex; -constexpr PrimitiveType PE = PrimitiveType::Edge; -constexpr PrimitiveType PF = PrimitiveType::Face; -constexpr PrimitiveType PT = PrimitiveType::Tetrahedron; -namespace { -std::vector> get_sorted_sc(const tests::DEBUG_TriMesh &m, const std::vector &sc) -{ - std::vector> ret; - for (auto s : sc) - { - std::vector s_vec; - Tuple t = s.tuple(); - switch (s.primitive_type()) - { - case PV: - s_vec.push_back(m.id(t, PV)); - break; - case PE: - s_vec.push_back(m.id(t, PV)); - s_vec.push_back(m.id(m.switch_vertex(t), PV)); - break; - case PF: - s_vec.push_back(m.id(t, PV)); - s_vec.push_back(m.id(m.switch_vertex(t), PV)); - s_vec.push_back(m.id(m.switch_vertex(m.switch_edge(t)), PV)); - /* code */ - break; - case PT: - // TODO: need implement for tet - /* code */ - break; - default: - break; - } - std::sort(s_vec.begin(), s_vec.end()); - ret.push_back(s_vec); - } - std::sort(ret.begin(), ret.end(), [](const std::vector& a, const std::vector& b) { - if (a.size() != b.size()) { - return a.size() < b.size(); - } - return a < b; - }); - return ret; -} -} -TEST_CASE("open_star_circle", "[simplicial_complex][open_star][2D]") -{ - RowVectors3d V; - RowVectors3l F; - std::string name = "/circle.obj"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::read_triangle_mesh(path, V, F); - tests::DEBUG_TriMesh m; - m.initialize(F); - - Tuple t; - std::vector> sc_v, sc_e, sc_f; - t = m.tuple_from_id(PV, 3802); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 13); - CHECK(sc_v[0][0] == 3802); - CHECK(sc_v[1][0] == 200); - CHECK(sc_v[1][1] == 3802); - CHECK(sc_v[2][0] == 201); - CHECK(sc_v[2][1] == 3802); - CHECK(sc_v[3][0] == 3772); - CHECK(sc_v[3][1] == 3802); - CHECK(sc_v[4][0] == 3773); - CHECK(sc_v[4][1] == 3802); - CHECK(sc_v[5][0] == 3801); - CHECK(sc_v[5][1] == 3802); - CHECK(sc_v[6][0] == 3802); - CHECK(sc_v[6][1] == 3803); - CHECK(sc_v[7][0] == 200); - CHECK(sc_v[7][1] == 201); - CHECK(sc_v[7][2] == 3802); - CHECK(sc_v[8][0] == 200); - CHECK(sc_v[8][1] == 3802); - CHECK(sc_v[8][2] == 3803); - CHECK(sc_v[9][0] == 201); - CHECK(sc_v[9][1] == 3801); - CHECK(sc_v[9][2] == 3802); - CHECK(sc_v[10][0] == 3772); - CHECK(sc_v[10][1] == 3773); - CHECK(sc_v[10][2] == 3802); - CHECK(sc_v[11][0] == 3772); - CHECK(sc_v[11][1] == 3801); - CHECK(sc_v[11][2] == 3802); - CHECK(sc_v[12][0] == 3773); - CHECK(sc_v[12][1] == 3802); - CHECK(sc_v[12][2] == 3803); - - t = m.tuple_from_id(PV, 2587); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 13); - CHECK(sc_v[0][0] == 2587); - CHECK(sc_v[1][0] == 2575); - CHECK(sc_v[1][1] == 2587); - CHECK(sc_v[2][0] == 2576); - CHECK(sc_v[2][1] == 2587); - CHECK(sc_v[3][0] == 2586); - CHECK(sc_v[3][1] == 2587); - CHECK(sc_v[4][0] == 2587); - CHECK(sc_v[4][1] == 2588); - CHECK(sc_v[5][0] == 2587); - CHECK(sc_v[5][1] == 2599); - CHECK(sc_v[6][0] == 2587); - CHECK(sc_v[6][1] == 2600); - CHECK(sc_v[7][0] == 2575); - CHECK(sc_v[7][1] == 2576); - CHECK(sc_v[7][2] == 2587); - CHECK(sc_v[8][0] == 2575); - CHECK(sc_v[8][1] == 2586); - CHECK(sc_v[8][2] == 2587); - CHECK(sc_v[9][0] == 2576); - CHECK(sc_v[9][1] == 2587); - CHECK(sc_v[9][2] == 2588); - CHECK(sc_v[10][0] == 2586); - CHECK(sc_v[10][1] == 2587); - CHECK(sc_v[10][2] == 2599); - CHECK(sc_v[11][0] == 2587); - CHECK(sc_v[11][1] == 2588); - CHECK(sc_v[11][2] == 2600); - CHECK(sc_v[12][0] == 2587); - CHECK(sc_v[12][1] == 2599); - CHECK(sc_v[12][2] == 2600); - - t = m.tuple_from_id(PV, 1050); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 13); - CHECK(sc_v[0][0] == 1050); - CHECK(sc_v[1][0] == 1036); - CHECK(sc_v[1][1] == 1050); - CHECK(sc_v[2][0] == 1037); - CHECK(sc_v[2][1] == 1050); - CHECK(sc_v[3][0] == 1049); - CHECK(sc_v[3][1] == 1050); - CHECK(sc_v[4][0] == 1050); - CHECK(sc_v[4][1] == 1051); - CHECK(sc_v[5][0] == 1050); - CHECK(sc_v[5][1] == 1064); - CHECK(sc_v[6][0] == 1050); - CHECK(sc_v[6][1] == 1065); - CHECK(sc_v[7][0] == 1036); - CHECK(sc_v[7][1] == 1037); - CHECK(sc_v[7][2] == 1050); - CHECK(sc_v[8][0] == 1036); - CHECK(sc_v[8][1] == 1049); - CHECK(sc_v[8][2] == 1050); - CHECK(sc_v[9][0] == 1037); - CHECK(sc_v[9][1] == 1050); - CHECK(sc_v[9][2] == 1051); - CHECK(sc_v[10][0] == 1049); - CHECK(sc_v[10][1] == 1050); - CHECK(sc_v[10][2] == 1064); - CHECK(sc_v[11][0] == 1050); - CHECK(sc_v[11][1] == 1051); - CHECK(sc_v[11][2] == 1065); - CHECK(sc_v[12][0] == 1050); - CHECK(sc_v[12][1] == 1064); - CHECK(sc_v[12][2] == 1065); - - t = m.tuple_from_id(PV, 1781); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 13); - CHECK(sc_v[0][0] == 1781); - CHECK(sc_v[1][0] == 52); - CHECK(sc_v[1][1] == 1781); - CHECK(sc_v[2][0] == 53); - CHECK(sc_v[2][1] == 1781); - CHECK(sc_v[3][0] == 1765); - CHECK(sc_v[3][1] == 1781); - CHECK(sc_v[4][0] == 1766); - CHECK(sc_v[4][1] == 1781); - CHECK(sc_v[5][0] == 1780); - CHECK(sc_v[5][1] == 1781); - CHECK(sc_v[6][0] == 1781); - CHECK(sc_v[6][1] == 1782); - CHECK(sc_v[7][0] == 52); - CHECK(sc_v[7][1] == 53); - CHECK(sc_v[7][2] == 1781); - CHECK(sc_v[8][0] == 52); - CHECK(sc_v[8][1] == 1781); - CHECK(sc_v[8][2] == 1782); - CHECK(sc_v[9][0] == 53); - CHECK(sc_v[9][1] == 1780); - CHECK(sc_v[9][2] == 1781); - CHECK(sc_v[10][0] == 1765); - CHECK(sc_v[10][1] == 1766); - CHECK(sc_v[10][2] == 1781); - CHECK(sc_v[11][0] == 1765); - CHECK(sc_v[11][1] == 1780); - CHECK(sc_v[11][2] == 1781); - CHECK(sc_v[12][0] == 1766); - CHECK(sc_v[12][1] == 1781); - CHECK(sc_v[12][2] == 1782); - - t = m.tuple_from_id(PV, 2055); - sc_v = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 13); - CHECK(sc_v[0][0] == 2055); - CHECK(sc_v[1][0] == 2039); - CHECK(sc_v[1][1] == 2055); - CHECK(sc_v[2][0] == 2040); - CHECK(sc_v[2][1] == 2055); - CHECK(sc_v[3][0] == 2054); - CHECK(sc_v[3][1] == 2055); - CHECK(sc_v[4][0] == 2055); - CHECK(sc_v[4][1] == 2056); - CHECK(sc_v[5][0] == 2055); - CHECK(sc_v[5][1] == 2070); - CHECK(sc_v[6][0] == 2055); - CHECK(sc_v[6][1] == 2071); - CHECK(sc_v[7][0] == 2039); - CHECK(sc_v[7][1] == 2040); - CHECK(sc_v[7][2] == 2055); - CHECK(sc_v[8][0] == 2039); - CHECK(sc_v[8][1] == 2054); - CHECK(sc_v[8][2] == 2055); - CHECK(sc_v[9][0] == 2040); - CHECK(sc_v[9][1] == 2055); - CHECK(sc_v[9][2] == 2056); - CHECK(sc_v[10][0] == 2054); - CHECK(sc_v[10][1] == 2055); - CHECK(sc_v[10][2] == 2070); - CHECK(sc_v[11][0] == 2055); - CHECK(sc_v[11][1] == 2056); - CHECK(sc_v[11][2] == 2071); - CHECK(sc_v[12][0] == 2055); - CHECK(sc_v[12][1] == 2070); - CHECK(sc_v[12][2] == 2071); - - t = m.edge_tuple_from_vids(277,2246); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 277); - CHECK(sc_e[0][1] == 2246); - CHECK(sc_e[1][0] == 276); - CHECK(sc_e[1][1] == 277); - CHECK(sc_e[1][2] == 2246); - CHECK(sc_e[2][0] == 277); - CHECK(sc_e[2][1] == 2233); - CHECK(sc_e[2][2] == 2246); - - t = m.edge_tuple_from_vids(4879,4896); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 4879); - CHECK(sc_e[0][1] == 4896); - CHECK(sc_e[1][0] == 4878); - CHECK(sc_e[1][1] == 4879); - CHECK(sc_e[1][2] == 4896); - CHECK(sc_e[2][0] == 4879); - CHECK(sc_e[2][1] == 4896); - CHECK(sc_e[2][2] == 4897); - - t = m.edge_tuple_from_vids(4124,4125); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 4124); - CHECK(sc_e[0][1] == 4125); - CHECK(sc_e[1][0] == 4100); - CHECK(sc_e[1][1] == 4124); - CHECK(sc_e[1][2] == 4125); - CHECK(sc_e[2][0] == 4124); - CHECK(sc_e[2][1] == 4125); - CHECK(sc_e[2][2] == 4150); - - t = m.edge_tuple_from_vids(552,553); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 552); - CHECK(sc_e[0][1] == 553); - CHECK(sc_e[1][0] == 541); - CHECK(sc_e[1][1] == 552); - CHECK(sc_e[1][2] == 553); - CHECK(sc_e[2][0] == 552); - CHECK(sc_e[2][1] == 553); - CHECK(sc_e[2][2] == 565); - - t = m.edge_tuple_from_vids(2113,2128); - sc_e = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 3); - CHECK(sc_e[0][0] == 2113); - CHECK(sc_e[0][1] == 2128); - CHECK(sc_e[1][0] == 2112); - CHECK(sc_e[1][1] == 2113); - CHECK(sc_e[1][2] == 2128); - CHECK(sc_e[2][0] == 2113); - CHECK(sc_e[2][1] == 2128); - CHECK(sc_e[2][2] == 2129); - - t = m.face_tuple_from_vids(31, 496, 503); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 31); - CHECK(sc_f[0][1] == 496); - CHECK(sc_f[0][2] == 503); - - t = m.face_tuple_from_vids(1386, 1401, 1402); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 1386); - CHECK(sc_f[0][1] == 1401); - CHECK(sc_f[0][2] == 1402); - - t = m.face_tuple_from_vids(1589, 1590, 1605); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 1589); - CHECK(sc_f[0][1] == 1590); - CHECK(sc_f[0][2] == 1605); - - t = m.face_tuple_from_vids(10, 482, 486); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 10); - CHECK(sc_f[0][1] == 482); - CHECK(sc_f[0][2] == 486); - - t = m.face_tuple_from_vids(3666, 3692, 3693); - sc_f = get_sorted_sc(m, SimplicialComplex::open_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 1); - CHECK(sc_f[0][0] == 3666); - CHECK(sc_f[0][1] == 3692); - CHECK(sc_f[0][2] == 3693); - -} - -TEST_CASE("closed_star_circle", "[simplicial_complex][closed_star][2D]") -{ - RowVectors3d V; - RowVectors3l F; - std::string name = "/circle.obj"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::read_triangle_mesh(path, V, F); - tests::DEBUG_TriMesh m; - m.initialize(F); - - Tuple t; - std::vector> sc_v, sc_e, sc_f; - t = m.tuple_from_id(PV, 3062); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 25); - CHECK(sc_v[0][0] == 3043); - CHECK(sc_v[1][0] == 3044); - CHECK(sc_v[2][0] == 3061); - CHECK(sc_v[3][0] == 3062); - CHECK(sc_v[4][0] == 3063); - CHECK(sc_v[5][0] == 3081); - CHECK(sc_v[6][0] == 3082); - CHECK(sc_v[7][0] == 3043); - CHECK(sc_v[7][1] == 3044); - CHECK(sc_v[8][0] == 3043); - CHECK(sc_v[8][1] == 3061); - CHECK(sc_v[9][0] == 3043); - CHECK(sc_v[9][1] == 3062); - CHECK(sc_v[10][0] == 3044); - CHECK(sc_v[10][1] == 3062); - CHECK(sc_v[11][0] == 3044); - CHECK(sc_v[11][1] == 3063); - CHECK(sc_v[12][0] == 3061); - CHECK(sc_v[12][1] == 3062); - CHECK(sc_v[13][0] == 3061); - CHECK(sc_v[13][1] == 3081); - CHECK(sc_v[14][0] == 3062); - CHECK(sc_v[14][1] == 3063); - CHECK(sc_v[15][0] == 3062); - CHECK(sc_v[15][1] == 3081); - CHECK(sc_v[16][0] == 3062); - CHECK(sc_v[16][1] == 3082); - CHECK(sc_v[17][0] == 3063); - CHECK(sc_v[17][1] == 3082); - CHECK(sc_v[18][0] == 3081); - CHECK(sc_v[18][1] == 3082); - CHECK(sc_v[19][0] == 3043); - CHECK(sc_v[19][1] == 3044); - CHECK(sc_v[19][2] == 3062); - CHECK(sc_v[20][0] == 3043); - CHECK(sc_v[20][1] == 3061); - CHECK(sc_v[20][2] == 3062); - CHECK(sc_v[21][0] == 3044); - CHECK(sc_v[21][1] == 3062); - CHECK(sc_v[21][2] == 3063); - CHECK(sc_v[22][0] == 3061); - CHECK(sc_v[22][1] == 3062); - CHECK(sc_v[22][2] == 3081); - CHECK(sc_v[23][0] == 3062); - CHECK(sc_v[23][1] == 3063); - CHECK(sc_v[23][2] == 3082); - CHECK(sc_v[24][0] == 3062); - CHECK(sc_v[24][1] == 3081); - CHECK(sc_v[24][2] == 3082); - - t = m.tuple_from_id(PV, 2939); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 25); - CHECK(sc_v[0][0] == 2928); - CHECK(sc_v[1][0] == 2929); - CHECK(sc_v[2][0] == 2938); - CHECK(sc_v[3][0] == 2939); - CHECK(sc_v[4][0] == 2940); - CHECK(sc_v[5][0] == 2950); - CHECK(sc_v[6][0] == 2951); - CHECK(sc_v[7][0] == 2928); - CHECK(sc_v[7][1] == 2929); - CHECK(sc_v[8][0] == 2928); - CHECK(sc_v[8][1] == 2938); - CHECK(sc_v[9][0] == 2928); - CHECK(sc_v[9][1] == 2939); - CHECK(sc_v[10][0] == 2929); - CHECK(sc_v[10][1] == 2939); - CHECK(sc_v[11][0] == 2929); - CHECK(sc_v[11][1] == 2940); - CHECK(sc_v[12][0] == 2938); - CHECK(sc_v[12][1] == 2939); - CHECK(sc_v[13][0] == 2938); - CHECK(sc_v[13][1] == 2950); - CHECK(sc_v[14][0] == 2939); - CHECK(sc_v[14][1] == 2940); - CHECK(sc_v[15][0] == 2939); - CHECK(sc_v[15][1] == 2950); - CHECK(sc_v[16][0] == 2939); - CHECK(sc_v[16][1] == 2951); - CHECK(sc_v[17][0] == 2940); - CHECK(sc_v[17][1] == 2951); - CHECK(sc_v[18][0] == 2950); - CHECK(sc_v[18][1] == 2951); - CHECK(sc_v[19][0] == 2928); - CHECK(sc_v[19][1] == 2929); - CHECK(sc_v[19][2] == 2939); - CHECK(sc_v[20][0] == 2928); - CHECK(sc_v[20][1] == 2938); - CHECK(sc_v[20][2] == 2939); - CHECK(sc_v[21][0] == 2929); - CHECK(sc_v[21][1] == 2939); - CHECK(sc_v[21][2] == 2940); - CHECK(sc_v[22][0] == 2938); - CHECK(sc_v[22][1] == 2939); - CHECK(sc_v[22][2] == 2950); - CHECK(sc_v[23][0] == 2939); - CHECK(sc_v[23][1] == 2940); - CHECK(sc_v[23][2] == 2951); - CHECK(sc_v[24][0] == 2939); - CHECK(sc_v[24][1] == 2950); - CHECK(sc_v[24][2] == 2951); - - t = m.tuple_from_id(PV, 100); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 25); - CHECK(sc_v[0][0] == 99); - CHECK(sc_v[1][0] == 100); - CHECK(sc_v[2][0] == 101); - CHECK(sc_v[3][0] == 716); - CHECK(sc_v[4][0] == 718); - CHECK(sc_v[5][0] == 1436); - CHECK(sc_v[6][0] == 1437); - CHECK(sc_v[7][0] == 99); - CHECK(sc_v[7][1] == 100); - CHECK(sc_v[8][0] == 99); - CHECK(sc_v[8][1] == 718); - CHECK(sc_v[9][0] == 99); - CHECK(sc_v[9][1] == 1437); - CHECK(sc_v[10][0] == 100); - CHECK(sc_v[10][1] == 101); - CHECK(sc_v[11][0] == 100); - CHECK(sc_v[11][1] == 716); - CHECK(sc_v[12][0] == 100); - CHECK(sc_v[12][1] == 718); - CHECK(sc_v[13][0] == 100); - CHECK(sc_v[13][1] == 1436); - CHECK(sc_v[14][0] == 100); - CHECK(sc_v[14][1] == 1437); - CHECK(sc_v[15][0] == 101); - CHECK(sc_v[15][1] == 716); - CHECK(sc_v[16][0] == 101); - CHECK(sc_v[16][1] == 1436); - CHECK(sc_v[17][0] == 716); - CHECK(sc_v[17][1] == 718); - CHECK(sc_v[18][0] == 1436); - CHECK(sc_v[18][1] == 1437); - CHECK(sc_v[19][0] == 99); - CHECK(sc_v[19][1] == 100); - CHECK(sc_v[19][2] == 718); - CHECK(sc_v[20][0] == 99); - CHECK(sc_v[20][1] == 100); - CHECK(sc_v[20][2] == 1437); - CHECK(sc_v[21][0] == 100); - CHECK(sc_v[21][1] == 101); - CHECK(sc_v[21][2] == 716); - CHECK(sc_v[22][0] == 100); - CHECK(sc_v[22][1] == 101); - CHECK(sc_v[22][2] == 1436); - CHECK(sc_v[23][0] == 100); - CHECK(sc_v[23][1] == 716); - CHECK(sc_v[23][2] == 718); - CHECK(sc_v[24][0] == 100); - CHECK(sc_v[24][1] == 1436); - CHECK(sc_v[24][2] == 1437); - - t = m.tuple_from_id(PV, 2801); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 25); - CHECK(sc_v[0][0] == 2785); - CHECK(sc_v[1][0] == 2786); - CHECK(sc_v[2][0] == 2800); - CHECK(sc_v[3][0] == 2801); - CHECK(sc_v[4][0] == 2802); - CHECK(sc_v[5][0] == 2816); - CHECK(sc_v[6][0] == 2817); - CHECK(sc_v[7][0] == 2785); - CHECK(sc_v[7][1] == 2786); - CHECK(sc_v[8][0] == 2785); - CHECK(sc_v[8][1] == 2800); - CHECK(sc_v[9][0] == 2785); - CHECK(sc_v[9][1] == 2801); - CHECK(sc_v[10][0] == 2786); - CHECK(sc_v[10][1] == 2801); - CHECK(sc_v[11][0] == 2786); - CHECK(sc_v[11][1] == 2802); - CHECK(sc_v[12][0] == 2800); - CHECK(sc_v[12][1] == 2801); - CHECK(sc_v[13][0] == 2800); - CHECK(sc_v[13][1] == 2816); - CHECK(sc_v[14][0] == 2801); - CHECK(sc_v[14][1] == 2802); - CHECK(sc_v[15][0] == 2801); - CHECK(sc_v[15][1] == 2816); - CHECK(sc_v[16][0] == 2801); - CHECK(sc_v[16][1] == 2817); - CHECK(sc_v[17][0] == 2802); - CHECK(sc_v[17][1] == 2817); - CHECK(sc_v[18][0] == 2816); - CHECK(sc_v[18][1] == 2817); - CHECK(sc_v[19][0] == 2785); - CHECK(sc_v[19][1] == 2786); - CHECK(sc_v[19][2] == 2801); - CHECK(sc_v[20][0] == 2785); - CHECK(sc_v[20][1] == 2800); - CHECK(sc_v[20][2] == 2801); - CHECK(sc_v[21][0] == 2786); - CHECK(sc_v[21][1] == 2801); - CHECK(sc_v[21][2] == 2802); - CHECK(sc_v[22][0] == 2800); - CHECK(sc_v[22][1] == 2801); - CHECK(sc_v[22][2] == 2816); - CHECK(sc_v[23][0] == 2801); - CHECK(sc_v[23][1] == 2802); - CHECK(sc_v[23][2] == 2817); - CHECK(sc_v[24][0] == 2801); - CHECK(sc_v[24][1] == 2816); - CHECK(sc_v[24][2] == 2817); - - t = m.tuple_from_id(PV, 4947); - sc_v = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 25); - CHECK(sc_v[0][0] == 4926); - CHECK(sc_v[1][0] == 4927); - CHECK(sc_v[2][0] == 4946); - CHECK(sc_v[3][0] == 4947); - CHECK(sc_v[4][0] == 4948); - CHECK(sc_v[5][0] == 4968); - CHECK(sc_v[6][0] == 4969); - CHECK(sc_v[7][0] == 4926); - CHECK(sc_v[7][1] == 4927); - CHECK(sc_v[8][0] == 4926); - CHECK(sc_v[8][1] == 4946); - CHECK(sc_v[9][0] == 4926); - CHECK(sc_v[9][1] == 4947); - CHECK(sc_v[10][0] == 4927); - CHECK(sc_v[10][1] == 4947); - CHECK(sc_v[11][0] == 4927); - CHECK(sc_v[11][1] == 4948); - CHECK(sc_v[12][0] == 4946); - CHECK(sc_v[12][1] == 4947); - CHECK(sc_v[13][0] == 4946); - CHECK(sc_v[13][1] == 4968); - CHECK(sc_v[14][0] == 4947); - CHECK(sc_v[14][1] == 4948); - CHECK(sc_v[15][0] == 4947); - CHECK(sc_v[15][1] == 4968); - CHECK(sc_v[16][0] == 4947); - CHECK(sc_v[16][1] == 4969); - CHECK(sc_v[17][0] == 4948); - CHECK(sc_v[17][1] == 4969); - CHECK(sc_v[18][0] == 4968); - CHECK(sc_v[18][1] == 4969); - CHECK(sc_v[19][0] == 4926); - CHECK(sc_v[19][1] == 4927); - CHECK(sc_v[19][2] == 4947); - CHECK(sc_v[20][0] == 4926); - CHECK(sc_v[20][1] == 4946); - CHECK(sc_v[20][2] == 4947); - CHECK(sc_v[21][0] == 4927); - CHECK(sc_v[21][1] == 4947); - CHECK(sc_v[21][2] == 4948); - CHECK(sc_v[22][0] == 4946); - CHECK(sc_v[22][1] == 4947); - CHECK(sc_v[22][2] == 4968); - CHECK(sc_v[23][0] == 4947); - CHECK(sc_v[23][1] == 4948); - CHECK(sc_v[23][2] == 4969); - CHECK(sc_v[24][0] == 4947); - CHECK(sc_v[24][1] == 4968); - CHECK(sc_v[24][2] == 4969); - - t = m.edge_tuple_from_vids(3759,3760); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 3731); - CHECK(sc_e[1][0] == 3759); - CHECK(sc_e[2][0] == 3760); - CHECK(sc_e[3][0] == 3789); - CHECK(sc_e[4][0] == 3731); - CHECK(sc_e[4][1] == 3759); - CHECK(sc_e[5][0] == 3731); - CHECK(sc_e[5][1] == 3760); - CHECK(sc_e[6][0] == 3759); - CHECK(sc_e[6][1] == 3760); - CHECK(sc_e[7][0] == 3759); - CHECK(sc_e[7][1] == 3789); - CHECK(sc_e[8][0] == 3760); - CHECK(sc_e[8][1] == 3789); - CHECK(sc_e[9][0] == 3731); - CHECK(sc_e[9][1] == 3759); - CHECK(sc_e[9][2] == 3760); - CHECK(sc_e[10][0] == 3759); - CHECK(sc_e[10][1] == 3760); - CHECK(sc_e[10][2] == 3789); - - t = m.edge_tuple_from_vids(884,885); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 875); - CHECK(sc_e[1][0] == 884); - CHECK(sc_e[2][0] == 885); - CHECK(sc_e[3][0] == 895); - CHECK(sc_e[4][0] == 875); - CHECK(sc_e[4][1] == 884); - CHECK(sc_e[5][0] == 875); - CHECK(sc_e[5][1] == 885); - CHECK(sc_e[6][0] == 884); - CHECK(sc_e[6][1] == 885); - CHECK(sc_e[7][0] == 884); - CHECK(sc_e[7][1] == 895); - CHECK(sc_e[8][0] == 885); - CHECK(sc_e[8][1] == 895); - CHECK(sc_e[9][0] == 875); - CHECK(sc_e[9][1] == 884); - CHECK(sc_e[9][2] == 885); - CHECK(sc_e[10][0] == 884); - CHECK(sc_e[10][1] == 885); - CHECK(sc_e[10][2] == 895); - - t = m.edge_tuple_from_vids(4074,4075); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 4052); - CHECK(sc_e[1][0] == 4074); - CHECK(sc_e[2][0] == 4075); - CHECK(sc_e[3][0] == 4098); - CHECK(sc_e[4][0] == 4052); - CHECK(sc_e[4][1] == 4074); - CHECK(sc_e[5][0] == 4052); - CHECK(sc_e[5][1] == 4075); - CHECK(sc_e[6][0] == 4074); - CHECK(sc_e[6][1] == 4075); - CHECK(sc_e[7][0] == 4074); - CHECK(sc_e[7][1] == 4098); - CHECK(sc_e[8][0] == 4075); - CHECK(sc_e[8][1] == 4098); - CHECK(sc_e[9][0] == 4052); - CHECK(sc_e[9][1] == 4074); - CHECK(sc_e[9][2] == 4075); - CHECK(sc_e[10][0] == 4074); - CHECK(sc_e[10][1] == 4075); - CHECK(sc_e[10][2] == 4098); - - t = m.edge_tuple_from_vids(4644,4671); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 4643); - CHECK(sc_e[1][0] == 4644); - CHECK(sc_e[2][0] == 4671); - CHECK(sc_e[3][0] == 4672); - CHECK(sc_e[4][0] == 4643); - CHECK(sc_e[4][1] == 4644); - CHECK(sc_e[5][0] == 4643); - CHECK(sc_e[5][1] == 4671); - CHECK(sc_e[6][0] == 4644); - CHECK(sc_e[6][1] == 4671); - CHECK(sc_e[7][0] == 4644); - CHECK(sc_e[7][1] == 4672); - CHECK(sc_e[8][0] == 4671); - CHECK(sc_e[8][1] == 4672); - CHECK(sc_e[9][0] == 4643); - CHECK(sc_e[9][1] == 4644); - CHECK(sc_e[9][2] == 4671); - CHECK(sc_e[10][0] == 4644); - CHECK(sc_e[10][1] == 4671); - CHECK(sc_e[10][2] == 4672); - - t = m.edge_tuple_from_vids(2357,2372); - sc_e = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 11); - CHECK(sc_e[0][0] == 2356); - CHECK(sc_e[1][0] == 2357); - CHECK(sc_e[2][0] == 2372); - CHECK(sc_e[3][0] == 2373); - CHECK(sc_e[4][0] == 2356); - CHECK(sc_e[4][1] == 2357); - CHECK(sc_e[5][0] == 2356); - CHECK(sc_e[5][1] == 2372); - CHECK(sc_e[6][0] == 2357); - CHECK(sc_e[6][1] == 2372); - CHECK(sc_e[7][0] == 2357); - CHECK(sc_e[7][1] == 2373); - CHECK(sc_e[8][0] == 2372); - CHECK(sc_e[8][1] == 2373); - CHECK(sc_e[9][0] == 2356); - CHECK(sc_e[9][1] == 2357); - CHECK(sc_e[9][2] == 2372); - CHECK(sc_e[10][0] == 2357); - CHECK(sc_e[10][1] == 2372); - CHECK(sc_e[10][2] == 2373); - - t = m.face_tuple_from_vids(175, 1291, 1307); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 175); - CHECK(sc_f[1][0] == 1291); - CHECK(sc_f[2][0] == 1307); - CHECK(sc_f[3][0] == 175); - CHECK(sc_f[3][1] == 1291); - CHECK(sc_f[4][0] == 175); - CHECK(sc_f[4][1] == 1307); - CHECK(sc_f[5][0] == 1291); - CHECK(sc_f[5][1] == 1307); - CHECK(sc_f[6][0] == 175); - CHECK(sc_f[6][1] == 1291); - CHECK(sc_f[6][2] == 1307); - - t = m.face_tuple_from_vids(989, 997, 998); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 989); - CHECK(sc_f[1][0] == 997); - CHECK(sc_f[2][0] == 998); - CHECK(sc_f[3][0] == 989); - CHECK(sc_f[3][1] == 997); - CHECK(sc_f[4][0] == 989); - CHECK(sc_f[4][1] == 998); - CHECK(sc_f[5][0] == 997); - CHECK(sc_f[5][1] == 998); - CHECK(sc_f[6][0] == 989); - CHECK(sc_f[6][1] == 997); - CHECK(sc_f[6][2] == 998); - - t = m.face_tuple_from_vids(46, 47, 632); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 46); - CHECK(sc_f[1][0] == 47); - CHECK(sc_f[2][0] == 632); - CHECK(sc_f[3][0] == 46); - CHECK(sc_f[3][1] == 47); - CHECK(sc_f[4][0] == 46); - CHECK(sc_f[4][1] == 632); - CHECK(sc_f[5][0] == 47); - CHECK(sc_f[5][1] == 632); - CHECK(sc_f[6][0] == 46); - CHECK(sc_f[6][1] == 47); - CHECK(sc_f[6][2] == 632); - - t = m.face_tuple_from_vids(1186, 1187, 1202); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 1186); - CHECK(sc_f[1][0] == 1187); - CHECK(sc_f[2][0] == 1202); - CHECK(sc_f[3][0] == 1186); - CHECK(sc_f[3][1] == 1187); - CHECK(sc_f[4][0] == 1186); - CHECK(sc_f[4][1] == 1202); - CHECK(sc_f[5][0] == 1187); - CHECK(sc_f[5][1] == 1202); - CHECK(sc_f[6][0] == 1186); - CHECK(sc_f[6][1] == 1187); - CHECK(sc_f[6][2] == 1202); - - t = m.face_tuple_from_vids(1268, 1269, 1284); - sc_f = get_sorted_sc(m, SimplicialComplex::closed_star(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 7); - CHECK(sc_f[0][0] == 1268); - CHECK(sc_f[1][0] == 1269); - CHECK(sc_f[2][0] == 1284); - CHECK(sc_f[3][0] == 1268); - CHECK(sc_f[3][1] == 1269); - CHECK(sc_f[4][0] == 1268); - CHECK(sc_f[4][1] == 1284); - CHECK(sc_f[5][0] == 1269); - CHECK(sc_f[5][1] == 1284); - CHECK(sc_f[6][0] == 1268); - CHECK(sc_f[6][1] == 1269); - CHECK(sc_f[6][2] == 1284); - -} - -TEST_CASE("link_circle", "[simplicial_complex][link][2D]") -{ - RowVectors3d V; - RowVectors3l F; - std::string name = "/circle.obj"; - std::string path; - path.append(WMTK_DATA_DIR); - path.append(name); - igl::read_triangle_mesh(path, V, F); - tests::DEBUG_TriMesh m; - m.initialize(F); - - Tuple t; - std::vector> sc_v, sc_e, sc_f; - t = m.tuple_from_id(PV, 3342); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 12); - CHECK(sc_v[0][0] == 384); - CHECK(sc_v[1][0] == 385); - CHECK(sc_v[2][0] == 3341); - CHECK(sc_v[3][0] == 3343); - CHECK(sc_v[4][0] == 3344); - CHECK(sc_v[5][0] == 3345); - CHECK(sc_v[6][0] == 384); - CHECK(sc_v[6][1] == 385); - CHECK(sc_v[7][0] == 384); - CHECK(sc_v[7][1] == 3341); - CHECK(sc_v[8][0] == 385); - CHECK(sc_v[8][1] == 3344); - CHECK(sc_v[9][0] == 3341); - CHECK(sc_v[9][1] == 3343); - CHECK(sc_v[10][0] == 3343); - CHECK(sc_v[10][1] == 3345); - CHECK(sc_v[11][0] == 3344); - CHECK(sc_v[11][1] == 3345); - - t = m.tuple_from_id(PV, 3467); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 12); - CHECK(sc_v[0][0] == 3451); - CHECK(sc_v[1][0] == 3452); - CHECK(sc_v[2][0] == 3466); - CHECK(sc_v[3][0] == 3468); - CHECK(sc_v[4][0] == 3483); - CHECK(sc_v[5][0] == 3484); - CHECK(sc_v[6][0] == 3451); - CHECK(sc_v[6][1] == 3452); - CHECK(sc_v[7][0] == 3451); - CHECK(sc_v[7][1] == 3466); - CHECK(sc_v[8][0] == 3452); - CHECK(sc_v[8][1] == 3468); - CHECK(sc_v[9][0] == 3466); - CHECK(sc_v[9][1] == 3483); - CHECK(sc_v[10][0] == 3468); - CHECK(sc_v[10][1] == 3484); - CHECK(sc_v[11][0] == 3483); - CHECK(sc_v[11][1] == 3484); - - t = m.tuple_from_id(PV, 462); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 12); - CHECK(sc_v[0][0] == 461); - CHECK(sc_v[1][0] == 463); - CHECK(sc_v[2][0] == 4407); - CHECK(sc_v[3][0] == 4424); - CHECK(sc_v[4][0] == 4888); - CHECK(sc_v[5][0] == 4906); - CHECK(sc_v[6][0] == 461); - CHECK(sc_v[6][1] == 4407); - CHECK(sc_v[7][0] == 461); - CHECK(sc_v[7][1] == 4888); - CHECK(sc_v[8][0] == 463); - CHECK(sc_v[8][1] == 4424); - CHECK(sc_v[9][0] == 463); - CHECK(sc_v[9][1] == 4906); - CHECK(sc_v[10][0] == 4407); - CHECK(sc_v[10][1] == 4424); - CHECK(sc_v[11][0] == 4888); - CHECK(sc_v[11][1] == 4906); - - t = m.tuple_from_id(PV, 2714); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 12); - CHECK(sc_v[0][0] == 2698); - CHECK(sc_v[1][0] == 2699); - CHECK(sc_v[2][0] == 2713); - CHECK(sc_v[3][0] == 2715); - CHECK(sc_v[4][0] == 2729); - CHECK(sc_v[5][0] == 2730); - CHECK(sc_v[6][0] == 2698); - CHECK(sc_v[6][1] == 2699); - CHECK(sc_v[7][0] == 2698); - CHECK(sc_v[7][1] == 2713); - CHECK(sc_v[8][0] == 2699); - CHECK(sc_v[8][1] == 2715); - CHECK(sc_v[9][0] == 2713); - CHECK(sc_v[9][1] == 2729); - CHECK(sc_v[10][0] == 2715); - CHECK(sc_v[10][1] == 2730); - CHECK(sc_v[11][0] == 2729); - CHECK(sc_v[11][1] == 2730); - - t = m.tuple_from_id(PV, 835); - sc_v = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PV, t)).get_simplex_vector()); - REQUIRE(sc_v.size() == 7); - CHECK(sc_v[0][0] == 86); - CHECK(sc_v[1][0] == 87); - CHECK(sc_v[2][0] == 820); - CHECK(sc_v[3][0] == 834); - CHECK(sc_v[4][0] == 86); - CHECK(sc_v[4][1] == 87); - CHECK(sc_v[5][0] == 87); - CHECK(sc_v[5][1] == 820); - CHECK(sc_v[6][0] == 820); - CHECK(sc_v[6][1] == 834); - - t = m.edge_tuple_from_vids(207,3796); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 206); - CHECK(sc_e[1][0] == 3795); - - t = m.edge_tuple_from_vids(1516,1530); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 1517); - CHECK(sc_e[1][0] == 1529); - - t = m.edge_tuple_from_vids(3508,3509); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 3491); - CHECK(sc_e[1][0] == 3527); - - t = m.edge_tuple_from_vids(4182,4209); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 4181); - CHECK(sc_e[1][0] == 4210); - - t = m.edge_tuple_from_vids(112,113); - sc_e = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PE, t)).get_simplex_vector()); - REQUIRE(sc_e.size() == 2); - CHECK(sc_e[0][0] == 891); - CHECK(sc_e[1][0] == 2505); - - t = m.face_tuple_from_vids(3560, 3561, 3582); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 0); - - t = m.face_tuple_from_vids(2351, 2352, 2367); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 0); - - t = m.face_tuple_from_vids(1231, 1232, 1247); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 0); - - t = m.face_tuple_from_vids(3863, 3864, 3875); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 0); - - t = m.face_tuple_from_vids(653, 654, 665); - sc_f = get_sorted_sc(m, SimplicialComplex::link(m, Simplex(PF, t)).get_simplex_vector()); - REQUIRE(sc_f.size() == 0); - -}