34 V.row(0) << 1.0, 0.0, 0.0;
35 V.row(1) << 1.25, 0.0, 0.0;
36 V.row(2) << 1.5, 0.0, 0.0;
37 V.row(3) << 1.75, 0.0, 0.0;
38 V.row(4) << 2.0, 0.0, 0.0;
39 V.row(5) << 1.0, 1.0, 0.0;
40 V.row(6) << 1.25, 1.0, 0.0;
41 V.row(7) << 1.5, 1.0, 0.0;
42 V.row(8) << 1.75, 1.0, 0.0;
43 V.row(9) << 2.0, 1.0, 0.0;
44 V.row(10) << 1.0, 2.0, 0.0;
45 V.row(11) << 1.25, 2.0, 0.0;
46 V.row(12) << 1.5, 2.0, 0.0;
47 V.row(13) << 1.75, 2.0, 0.0;
48 V.row(14) << 2.0, 2.0, 0.0;
61 F.row(9) << 5, 11, 10;
62 F.row(10) << 6, 7, 12;
63 F.row(11) << 6, 12, 11;
64 F.row(12) << 7, 8, 13;
65 F.row(13) << 7, 13, 12;
66 F.row(14) << 8, 9, 14;
67 F.row(15) << 8, 14, 13;
86 wmtk::components::fusion(Paths(), input, cache);
89 DEBUG_TriMesh& periodic_mesh =
static_cast<DEBUG_TriMesh&
>(*p_mesh);
92 periodic_mesh.serialize(writer);
97 std::cout << F_p << std::endl << std::endl;
99 auto childs = periodic_mesh.get_child_meshes();
100 CHECK(childs.size() == 1);
102 childs[0]->get_all(PrimitiveType::Triangle).size() ==
103 periodic_mesh.get_all(PrimitiveType::Triangle).size());
104 CHECK(periodic_mesh.get_all(PrimitiveType::Vertex).size() == 12);
105 CHECK(childs[0]->get_all(PrimitiveType::Vertex).size() == 15);
108 childs[0]->serialize(writer_child);
115 std::cout << V_child << std::endl << std::endl;
116 std::cout << FV_child << std::endl << std::endl;
122 "input": "test_mesh",
129 wmtk::components::fusion(Paths(), input, cache);
132 DEBUG_TriMesh& periodic_mesh =
static_cast<DEBUG_TriMesh&
>(*p_mesh);
135 periodic_mesh.serialize(writer);
145 auto childs = periodic_mesh.get_child_meshes();
146 CHECK(childs.size() == 1);
148 childs[0]->get_all(PrimitiveType::Triangle).size() ==
149 periodic_mesh.get_all(PrimitiveType::Triangle).size());
155 "input": "test_mesh",
162 wmtk::components::fusion(Paths(), input, cache);
165 DEBUG_TriMesh& periodic_mesh =
static_cast<DEBUG_TriMesh&
>(*p_mesh);
168 periodic_mesh.serialize(writer);
177 auto childs = periodic_mesh.get_child_meshes();
178 CHECK(childs.size() == 1);
180 childs[0]->get_all(PrimitiveType::Triangle).size() ==
181 periodic_mesh.get_all(PrimitiveType::Triangle).size());
185TEST_CASE(
"fusion_3d",
"[components][fusion][.]")
191 V.row(0) << 1.0, 1.0, 1.0;
192 V.row(1) << 3.0, 1.0, 1.0;
193 V.row(2) << 3.0, 1.5, 1.0;
194 V.row(3) << 1.0, 1.5, 1.0;
195 V.row(4) << 1.0, 1.0, 4.0;
196 V.row(5) << 3.0, 1.0, 4.0;
197 V.row(6) << 3.0, 1.5, 4.0;
198 V.row(7) << 1.0, 1.5, 4.0;
202 T.row(0) << 0, 1, 2, 3;
203 T.row(1) << 5, 2, 6, 7;
204 T.row(2) << 4, 1, 5, 3;
205 T.row(3) << 4, 3, 7, 5;
206 T.row(4) << 3, 1, 5, 2;
207 T.row(5) << 2, 3, 7, 5;
219 "input": "test_mesh",
226 wmtk::components::fusion(Paths(), input, cache);
229 DEBUG_TetMesh& periodic_mesh =
static_cast<DEBUG_TetMesh&
>(*p_mesh);
232 periodic_mesh.serialize(writer);
241 auto childs = periodic_mesh.get_child_meshes();
242 CHECK(childs.size() == 1);
244 childs[0]->get_all(PrimitiveType::Tetrahedron).size() ==
245 periodic_mesh.get_all(PrimitiveType::Tetrahedron).size());
246 CHECK(periodic_mesh.get_all(PrimitiveType::Vertex).size() == 4);
249 childs[0]->serialize(writer_child);
256 std::cout << V_child << std::endl << std::endl;
257 std::cout << TV_child << std::endl << std::endl;
264 "input": "test_mesh",
271 wmtk::components::fusion(Paths(), input, cache);
274 DEBUG_TetMesh& periodic_mesh =
static_cast<DEBUG_TetMesh&
>(*p_mesh);
277 periodic_mesh.serialize(writer);
286 auto childs = periodic_mesh.get_child_meshes();
287 CHECK(childs.size() == 1);
289 childs[0]->get_all(PrimitiveType::Tetrahedron).size() ==
290 periodic_mesh.get_all(PrimitiveType::Tetrahedron).size());
291 CHECK(periodic_mesh.get_all(PrimitiveType::Vertex).size() == 2);