1 #include <catch2/catch_test_macros.hpp>
2 #include <nlohmann/json.hpp>
3 #include <tools/DEBUG_TetMesh.hpp>
4 #include <tools/DEBUG_TriMesh.hpp>
5 #include <tools/TetMesh_examples.hpp>
6 #include <tools/TriMesh_examples.hpp>
13 using namespace tests;
15 TEST_CASE(
"component_tag_intersection_options",
"[components][tag_intersection]")
17 using namespace components::internal;
21 "input": "input_mesh",
22 "output": "output_mesh",
27 "tetrahedron_labels": []
33 "tetrahedron_values": []
35 "output_attributes": {
39 "tetrahedron_labels": []
45 "tetrahedron_values": []
51 CHECK_NOTHROW(o.get<TagIntersectionOptions>());
54 TEST_CASE("component_tag_intersection_tri",
"[components][tag_intersection]")
56 tests::DEBUG_TriMesh m = tests::edge_region_with_position();
58 SECTION(
"two_face_tags_edgeintersection")
64 auto tag1_acc = m.create_accessor<int64_t>(tag1);
65 auto tag2_acc = m.create_accessor<int64_t>(tag2);
66 tag1_acc.scalar_attribute(m.face_tuple_from_vids(1, 4, 5)) = 1;
67 tag2_acc.scalar_attribute(m.face_tuple_from_vids(4, 8, 5)) = 1;
73 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
76 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
83 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
84 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
85 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 1);
86 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 0);
87 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(8, 4)) == 0);
89 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
90 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
93 SECTION(
"two_face_tags_vertexintersection")
99 auto tag1_acc = m.create_accessor<int64_t>(tag1);
100 auto tag2_acc = m.create_accessor<int64_t>(tag2);
101 tag1_acc.scalar_attribute(m.face_tuple_from_vids(3, 4, 7)) = 1;
102 tag2_acc.scalar_attribute(m.face_tuple_from_vids(4, 1, 5)) = 1;
108 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
111 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
118 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
119 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
120 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
121 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 3)) == 1);
122 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 4)) == 0);
124 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
125 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 1)) == 0);
126 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 0);
127 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 7)) == 0);
128 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 3)) == 0);
131 SECTION(
"four_blocks_tags_edgeintersection")
139 auto tag1_acc = m.create_accessor<int64_t>(tag1);
140 auto tag2_acc = m.create_accessor<int64_t>(tag2);
141 auto tag3_acc = m.create_accessor<int64_t>(tag3);
142 auto tag4_acc = m.create_accessor<int64_t>(tag4);
143 tag1_acc.scalar_attribute(m.face_tuple_from_vids(3, 4, 7)) = 1;
144 tag2_acc.scalar_attribute(m.face_tuple_from_vids(4, 1, 5)) = 1;
145 tag3_acc.scalar_attribute(m.face_tuple_from_vids(4, 7, 8)) = 1;
146 tag3_acc.scalar_attribute(m.face_tuple_from_vids(8, 5, 4)) = 1;
147 tag4_acc.scalar_attribute(m.face_tuple_from_vids(3, 4, 0)) = 1;
148 tag4_acc.scalar_attribute(m.face_tuple_from_vids(4, 1, 0)) = 1;
154 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
159 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
166 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
167 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 1)) == 1);
168 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 0);
169 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
170 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(7, 4)) == 0);
171 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 4)) == 0);
173 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
174 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 4)) == 0);
175 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(7, 4)) == 0);
176 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
177 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 0);
178 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
179 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(8, 4)) == 0);
181 SECTION(
"two_seperated_vertices_and_two_intersected_vertices")
187 auto tag1_acc = m.create_accessor<int64_t>(tag1);
188 auto tag2_acc = m.create_accessor<int64_t>(tag2);
189 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(4, 5)) = 1;
190 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(1, 2)) = 1;
191 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(5, 4)) = 1;
192 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(1, 0)) = 1;
198 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
201 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
208 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
209 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 0);
210 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
211 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 2)) == 1);
213 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
214 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 0);
215 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 0);
216 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 5)) == 0);
218 SECTION(
"two_seperated_edges_and_two_intersected_edges")
224 auto tag1_acc = m.create_accessor<int64_t>(tag1);
225 auto tag2_acc = m.create_accessor<int64_t>(tag2);
226 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(0, 4)) = 1;
227 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(4, 5)) = 1;
228 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(2, 5)) = 1;
229 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(5, 4)) = 1;
235 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
238 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
245 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
246 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
247 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 1);
248 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
249 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 5)) == 0);
251 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
252 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
253 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
254 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 5)) == 0);
256 SECTION(
"two_overlap_blocks")
262 auto tag1_acc = m.create_accessor<int64_t>(tag1);
263 auto tag2_acc = m.create_accessor<int64_t>(tag2);
264 tag1_acc.scalar_attribute(m.face_tuple_from_vids(4, 1, 0)) = 1;
265 tag1_acc.scalar_attribute(m.face_tuple_from_vids(4, 5, 1)) = 1;
266 tag2_acc.scalar_attribute(m.face_tuple_from_vids(4, 5, 1)) = 1;
267 tag2_acc.scalar_attribute(m.face_tuple_from_vids(8, 5, 4)) = 1;
274 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
277 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
285 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
286 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
287 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 1)) == 1);
288 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 1);
289 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
290 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(8, 5)) == 0);
292 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
293 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 4)) == 1);
294 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 5)) == 1);
295 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 1)) == 1);
296 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
297 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 1)) == 0);
298 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(8, 4)) == 0);
299 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(8, 5)) == 0);
301 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
302 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(4, 5, 1)) == 1);
303 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(0, 4, 1)) == 0);
304 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(8, 5, 4)) == 0);
308 TEST_CASE(
"component_tag_intersection_tet",
"[components][tag_intersection]")
310 tests_3d::DEBUG_TetMesh m = tests_3d::six_cycle_tets();
311 SECTION(
"seperated_vertices_and_intersected_vertices")
317 auto tag1_acc = m.create_accessor<int64_t>(tag1);
318 auto tag2_acc = m.create_accessor<int64_t>(tag2);
319 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(2, 3)) = 1;
320 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(3, 2)) = 1;
321 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(2, 3)) = 1;
322 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(5, 3)) = 1;
330 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
333 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
342 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
343 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
344 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 5)) == 0);
345 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
347 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
349 CHECK(e_otag_acc.const_scalar_attribute(e) == 0);
352 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
354 CHECK(f_otag_acc.const_scalar_attribute(f) == 0);
357 auto t_otag_acc = m.create_accessor<int64_t>(t_otag);
359 CHECK(t_otag_acc.const_scalar_attribute(t) == 0);
362 SECTION(
"seperated_and_intersected_edges")
368 auto tag1_acc = m.create_accessor<int64_t>(tag1);
369 auto tag2_acc = m.create_accessor<int64_t>(tag2);
370 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(0, 1)) = 1;
371 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(1, 2)) = 1;
372 tag1_acc.scalar_attribute(m.edge_tuple_from_vids(2, 3)) = 1;
373 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(7, 5)) = 1;
374 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(5, 3)) = 1;
375 tag2_acc.scalar_attribute(m.edge_tuple_from_vids(3, 2)) = 1;
383 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
386 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
395 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
396 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
397 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 2)) == 1);
398 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 4)) == 0);
399 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 2)) == 0);
400 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 4)) == 0);
401 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(4, 0)) == 0);
402 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(6, 7)) == 0);
403 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(7, 6)) == 0);
405 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
406 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
407 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 3)) == 0);
408 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 2)) == 0);
409 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 3)) == 0);
410 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 2)) == 0);
411 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(5, 7)) == 0);
412 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 1)) == 0);
414 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
416 CHECK(f_otag_acc.const_scalar_attribute(f) == 0);
419 auto t_otag_acc = m.create_accessor<int64_t>(t_otag);
421 CHECK(t_otag_acc.const_scalar_attribute(t) == 0);
424 SECTION(
"two_blocks_contact")
430 auto tag1_acc = m.create_accessor<int64_t>(tag1);
431 auto tag2_acc = m.create_accessor<int64_t>(tag2);
432 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(0, 1, 2, 3)) = 1;
433 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(1, 2, 3, 6)) = 1;
434 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(0, 2, 3, 4)) = 1;
435 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(2, 3, 4, 5)) = 1;
443 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
446 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
455 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
458 if (v_otag_acc.const_scalar_attribute(v) == 1) {
463 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
464 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 2)) == 1);
465 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 2)) == 1);
467 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
470 if (e_otag_acc.const_scalar_attribute(e) == 1) {
475 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
476 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 3)) == 1);
477 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 2)) == 1);
479 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
482 if (f_otag_acc.const_scalar_attribute(f) == 1) {
487 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(0, 2, 3)) == 1);
489 auto t_otag_acc = m.create_accessor<int64_t>(t_otag);
491 CHECK(t_otag_acc.const_scalar_attribute(t) == 0);
494 SECTION(
"two_blocks_intersect")
500 auto tag1_acc = m.create_accessor<int64_t>(tag1);
501 auto tag2_acc = m.create_accessor<int64_t>(tag2);
502 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(0, 1, 2, 3)) = 1;
503 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(1, 2, 3, 6)) = 1;
504 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(0, 2, 3, 4)) = 1;
505 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(2, 3, 4, 5)) = 1;
506 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(0, 1, 2, 3)) = 1;
514 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
517 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
526 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
529 if (v_otag_acc.const_scalar_attribute(v) == 1) {
534 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
535 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 2)) == 1);
536 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 2)) == 1);
537 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 2)) == 1);
539 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
542 if (e_otag_acc.const_scalar_attribute(e) == 1) {
547 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 1)) == 1);
548 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 2)) == 1);
549 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(0, 3)) == 1);
550 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(1, 2)) == 1);
551 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
552 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 1)) == 1);
554 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
557 if (f_otag_acc.const_scalar_attribute(f) == 1) {
562 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(0, 1, 2)) == 1);
563 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(0, 1, 3)) == 1);
564 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(0, 2, 3)) == 1);
565 CHECK(f_otag_acc.const_scalar_attribute(m.face_tuple_from_vids(1, 2, 3)) == 1);
567 auto t_otag_acc = m.create_accessor<int64_t>(t_otag);
570 if (t_otag_acc.const_scalar_attribute(t) == 1) {
575 CHECK(t_otag_acc.const_scalar_attribute(m.tet_tuple_from_vids(0, 1, 2, 3)) == 1);
577 SECTION(
"three_blocks")
584 auto tag1_acc = m.create_accessor<int64_t>(tag1);
585 auto tag2_acc = m.create_accessor<int64_t>(tag2);
586 auto tag3_acc = m.create_accessor<int64_t>(tag3);
587 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(0, 1, 2, 3)) = 1;
588 tag1_acc.scalar_attribute(m.tet_tuple_from_vids(1, 2, 3, 6)) = 1;
589 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(0, 2, 3, 4)) = 1;
590 tag2_acc.scalar_attribute(m.tet_tuple_from_vids(2, 3, 4, 5)) = 1;
591 tag3_acc.scalar_attribute(m.tet_tuple_from_vids(2, 3, 6, 7)) = 1;
592 tag3_acc.scalar_attribute(m.tet_tuple_from_vids(2, 3, 5, 7)) = 1;
600 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> input_tags = {
604 std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>> output_tags = {
613 auto v_otag_acc = m.create_accessor<int64_t>(v_otag);
616 if (v_otag_acc.const_scalar_attribute(v) == 1) {
621 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
622 CHECK(v_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(3, 2)) == 1);
624 auto e_otag_acc = m.create_accessor<int64_t>(e_otag);
627 if (e_otag_acc.const_scalar_attribute(e) == 1) {
632 CHECK(e_otag_acc.const_scalar_attribute(m.edge_tuple_from_vids(2, 3)) == 1);
634 auto f_otag_acc = m.create_accessor<int64_t>(f_otag);
637 if (f_otag_acc.const_scalar_attribute(f) == 1) {
643 auto t_otag_acc = m.create_accessor<int64_t>(t_otag);
645 CHECK(t_otag_acc.const_scalar_attribute(t) == 0);
void tag_intersection(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
TEST_CASE("component_tag_intersection_options", "[components][tag_intersection]")