50 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
51 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
52 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
53 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
55 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
56 auto & doubleValues = doubleData->values();
58 mesh->allocateDataValues();
60 doubleValues(0) = 1.0;
61 doubleValues(1) = 2.0;
62 doubleValues(2) = 3.0;
63 doubleValues(3) = 4.0;
65 std::string fileName(
"precice-WatchIntegralTest-scalarData-noConnectivity.log");
75 doubleValues(0) = 2.0;
76 doubleValues(1) = 3.0;
77 doubleValues(2) = 4.0;
78 doubleValues(3) = 5.0;
86 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData NoConnectivity")
88 auto result = readDoublesFromTXTFile(fileName, 2);
93 BOOST_TEST(result.size() == expected.size());
94 for (
size_t i = 0; i < result.size(); ++i) {
95 BOOST_TEST_CONTEXT(
"entry index: " << i)
98 BOOST_TEST(equals(result.at(i), expected.at(i)));
107 using namespace mesh;
113 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
114 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
115 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
116 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
118 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
119 auto & doubleValues = doubleData->values();
121 mesh->allocateDataValues();
123 doubleValues(0) = 1.0;
124 doubleValues(1) = 2.0;
125 doubleValues(2) = 3.0;
126 doubleValues(3) = 4.0;
127 doubleValues(4) = 5.0;
128 doubleValues(5) = 6.0;
129 doubleValues(6) = 7.0;
130 doubleValues(7) = 8.0;
132 std::string fileName(
"precice-WatchIntegralTest-vectorData-noConnectivity.log");
142 doubleValues(0) = 2.0;
143 doubleValues(1) = 3.0;
144 doubleValues(2) = 4.0;
145 doubleValues(3) = 5.0;
146 doubleValues(4) = 6.0;
147 doubleValues(5) = 7.0;
148 doubleValues(6) = 8.0;
149 doubleValues(7) = 9.0;
157 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData NoConnectivity")
159 auto result = readDoublesFromTXTFile(fileName, 3);
164 BOOST_TEST(result.size() == expected.size());
165 for (
size_t i = 0; i < result.size(); ++i) {
166 BOOST_TEST_CONTEXT(
"entry index: " << i)
169 BOOST_TEST(equals(result.at(i), expected.at(i)));
178 using namespace mesh;
184 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
185 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
186 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
188 mesh->createEdge(v1, v2);
189 mesh->createEdge(v2, v3);
191 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
192 auto & doubleValues = doubleData->values();
194 mesh->allocateDataValues();
196 doubleValues(0) = 1.0;
197 doubleValues(1) = 2.0;
198 doubleValues(2) = 3.0;
200 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity.log");
210 doubleValues(0) = 2.0;
211 doubleValues(1) = 3.0;
212 doubleValues(2) = 4.0;
220 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData EdgeConnectivity")
222 auto result = readDoublesFromTXTFile(fileName, 3);
227 BOOST_TEST(result.size() == expected.size());
228 for (
size_t i = 0; i < result.size(); ++i) {
229 BOOST_TEST_CONTEXT(
"entry index: " << i)
232 BOOST_TEST(equals(result.at(i), expected.at(i)));
241 using namespace mesh;
247 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
248 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
249 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
251 mesh->createEdge(v1, v2);
252 mesh->createEdge(v2, v3);
254 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
255 auto & doubleValues = doubleData->values();
257 mesh->allocateDataValues();
259 doubleValues(0) = 1.0;
260 doubleValues(1) = 2.0;
261 doubleValues(2) = 3.0;
263 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity-noScale.log");
273 doubleValues(0) = 2.0;
274 doubleValues(1) = 3.0;
275 doubleValues(2) = 4.0;
283 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData EdgeConnectivity NoScale")
285 auto result = readDoublesFromTXTFile(fileName, 3);
290 BOOST_TEST(result.size() == expected.size());
291 for (
size_t i = 0; i < result.size(); ++i) {
292 BOOST_TEST_CONTEXT(
"entry index: " << i)
295 BOOST_TEST(equals(result.at(i), expected.at(i)));
304 using namespace mesh;
310 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
311 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
312 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
314 mesh->createEdge(v1, v2);
315 mesh->createEdge(v2, v3);
317 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
318 auto & doubleValues = doubleData->values();
320 mesh->allocateDataValues();
322 doubleValues(0) = 1.0;
323 doubleValues(1) = 2.0;
324 doubleValues(2) = 3.0;
325 doubleValues(3) = 4.0;
326 doubleValues(4) = 5.0;
327 doubleValues(5) = 6.0;
329 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity.log");
339 doubleValues(0) = 2.0;
340 doubleValues(1) = 3.0;
341 doubleValues(2) = 4.0;
342 doubleValues(3) = 5.0;
343 doubleValues(4) = 6.0;
344 doubleValues(5) = 7.0;
352 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData EdgeConnectivity")
355 auto result = readDoublesFromTXTFile(fileName, 4);
357 0.0, 10.0, 13.0, 3.0,
358 1.0, 13.0, 56.0, 3.0,
359 2.0, 13.0, 56.0, 3.0};
360 BOOST_TEST(result.size() == expected.size());
361 for (
size_t i = 0; i < result.size(); ++i) {
362 BOOST_TEST_CONTEXT(
"entry index: " << i)
365 BOOST_TEST(equals(result.at(i), expected.at(i)));
375 using namespace mesh;
381 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
382 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
383 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
385 mesh->createEdge(v1, v2);
386 mesh->createEdge(v2, v3);
388 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
389 auto & doubleValues = doubleData->values();
391 mesh->allocateDataValues();
393 doubleValues(0) = 1.0;
394 doubleValues(1) = 2.0;
395 doubleValues(2) = 3.0;
396 doubleValues(3) = 4.0;
397 doubleValues(4) = 5.0;
398 doubleValues(5) = 6.0;
400 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity-noScale.log");
410 doubleValues(0) = 2.0;
411 doubleValues(1) = 3.0;
412 doubleValues(2) = 4.0;
413 doubleValues(3) = 5.0;
414 doubleValues(4) = 6.0;
415 doubleValues(5) = 7.0;
423 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData EdgeConnectivity NoScale")
426 auto result = readDoublesFromTXTFile(fileName, 4);
429 1.0, 12.0, 15.0, 3.0,
430 2.0, 12.0, 15.0, 3.0};
431 BOOST_TEST(result.size() == expected.size());
432 for (
size_t i = 0; i < result.size(); ++i) {
433 BOOST_TEST_CONTEXT(
"entry index: " << i)
436 BOOST_TEST(equals(result.at(i), expected.at(i)));
446 using namespace mesh;
452 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
453 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
454 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
455 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
463 mesh->createTriangle(e1, e2, e5);
464 mesh->createTriangle(e3, e4, e5);
466 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
467 auto & doubleValues = doubleData->values();
469 mesh->allocateDataValues();
471 doubleValues(0) = 1.0;
472 doubleValues(1) = 2.0;
473 doubleValues(2) = 3.0;
474 doubleValues(3) = 4.0;
476 std::string fileName(
"precice-WatchIntegralTest-scalarData-faceConnectivity.log");
486 doubleValues(0) = 2.0;
487 doubleValues(1) = 3.0;
488 doubleValues(2) = 4.0;
489 doubleValues(3) = 5.0;
497 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData FaceConnectivity")
499 auto result = readDoublesFromTXTFile(fileName, 3);
504 BOOST_TEST(result.size() == expected.size());
505 for (
size_t i = 0; i < result.size(); ++i) {
506 BOOST_TEST_CONTEXT(
"entry index: " << i)
509 BOOST_TEST(equals(result.at(i), expected.at(i)));
518 using namespace mesh;
524 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
525 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
526 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
527 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
535 mesh->createTriangle(e1, e2, e5);
536 mesh->createTriangle(e3, e4, e5);
538 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
539 auto & doubleValues = doubleData->values();
541 mesh->allocateDataValues();
543 doubleValues(0) = 1.0;
544 doubleValues(1) = 2.0;
545 doubleValues(2) = 3.0;
546 doubleValues(3) = 4.0;
548 std::string fileName(
"precice-WatchIntegralTest-scalarData-faceConnectivity-noScale.log");
558 doubleValues(0) = 2.0;
559 doubleValues(1) = 3.0;
560 doubleValues(2) = 4.0;
561 doubleValues(3) = 5.0;
569 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData FaceConnectivity NoScale")
571 auto result = readDoublesFromTXTFile(fileName, 3);
576 BOOST_TEST(result.size() == expected.size());
577 for (
size_t i = 0; i < result.size(); ++i) {
578 BOOST_TEST_CONTEXT(
"entry index: " << i)
581 BOOST_TEST(equals(result.at(i), expected.at(i)));
590 using namespace mesh;
596 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
597 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
598 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
599 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
607 mesh->createTriangle(e1, e2, e5);
608 mesh->createTriangle(e3, e4, e5);
610 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
611 auto & doubleValues = doubleData->values();
613 mesh->allocateDataValues();
615 doubleValues(0) = 1.0;
616 doubleValues(1) = 2.0;
617 doubleValues(2) = 3.0;
618 doubleValues(3) = 4.0;
619 doubleValues(4) = 5.0;
620 doubleValues(5) = 6.0;
621 doubleValues(6) = 7.0;
622 doubleValues(7) = 8.0;
624 std::string fileName(
"precice-WatchIntegralTest-vectorData-faceConnectivity.log");
634 doubleValues(0) = 2.0;
635 doubleValues(1) = 3.0;
636 doubleValues(2) = 4.0;
637 doubleValues(3) = 5.0;
638 doubleValues(4) = 6.0;
639 doubleValues(5) = 7.0;
640 doubleValues(6) = 8.0;
641 doubleValues(7) = 9.0;
649 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData FaceConnectivity")
651 auto result = readDoublesFromTXTFile(fileName, 4);
653 0.0, 44.0, 56.0, 12.0,
654 1.0, 56.0, 68.0, 12.0,
655 2.0, 56.0, 68.0, 12.0};
656 BOOST_TEST(result.size() == expected.size());
657 for (
size_t i = 0; i < result.size(); ++i) {
658 BOOST_TEST_CONTEXT(
"entry index: " << i)
661 BOOST_TEST(equals(result.at(i), expected.at(i)));
670 using namespace mesh;
676 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
677 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
678 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
679 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
687 mesh->createTriangle(e1, e2, e5);
688 mesh->createTriangle(e3, e4, e5);
690 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
691 auto & doubleValues = doubleData->values();
693 mesh->allocateDataValues();
695 doubleValues(0) = 1.0;
696 doubleValues(1) = 2.0;
697 doubleValues(2) = 3.0;
698 doubleValues(3) = 4.0;
699 doubleValues(4) = 5.0;
700 doubleValues(5) = 6.0;
701 doubleValues(6) = 7.0;
702 doubleValues(7) = 8.0;
704 std::string fileName(
"precice-WatchIntegralTest-vectorData-faceConnectivity-noScale.log");
714 doubleValues(0) = 2.0;
715 doubleValues(1) = 3.0;
716 doubleValues(2) = 4.0;
717 doubleValues(3) = 5.0;
718 doubleValues(4) = 6.0;
719 doubleValues(5) = 7.0;
720 doubleValues(6) = 8.0;
721 doubleValues(7) = 9.0;
729 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData FaceConnectivity NoScale")
731 auto result = readDoublesFromTXTFile(fileName, 4);
733 0.0, 16.0, 20.0, 12.0,
734 1.0, 20.0, 24.0, 12.0,
735 2.0, 20.0, 24.0, 12.0};
736 BOOST_TEST(result.size() == expected.size());
737 for (
size_t i = 0; i < result.size(); ++i) {
738 BOOST_TEST_CONTEXT(
"entry index: " << i)
741 BOOST_TEST(equals(result.at(i), expected.at(i)));
750 using namespace mesh;
756 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
757 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
758 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
759 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
767 mesh->createTriangle(e1, e2, e5);
768 mesh->createTriangle(e3, e4, e5);
770 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
771 auto & doubleValues = doubleData->values();
773 mesh->allocateDataValues();
775 doubleValues(0) = 1.0;
776 doubleValues(1) = 2.0;
777 doubleValues(2) = 3.0;
778 doubleValues(3) = 4.0;
780 std::string fileName(
"precice-WatchIntegralTest-meshChange-faceConnectivity.log");
790 v2.
setCoords(Eigen::Vector3d(3.0, -4.0, 0.0));
798 BOOST_TEST_CONTEXT(
"Validating WatchIntegral MeshChange FaceConnectivity")
800 auto result = readDoublesFromTXTFile(fileName, 3);
805 BOOST_TEST(result.size() == expected.size());
806 for (
size_t i = 0; i < result.size(); ++i) {
807 BOOST_TEST_CONTEXT(
"entry index: " << i)
810 BOOST_TEST(equals(result.at(i), expected.at(i)));
819 using namespace mesh;
824 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
825 auto & doubleValues = doubleData->values();
828 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
829 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
830 }
else if (context.isRank(1)) {
831 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
832 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
833 }
else if (context.isRank(2)) {
834 mesh->createVertex(Eigen::Vector2d(2.0, 0.0));
835 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
836 }
else if (context.isRank(3)) {
837 mesh->createVertex(Eigen::Vector2d(3.0, 0.0));
838 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
841 mesh->allocateDataValues();
844 doubleValues(0) = 1.0;
845 doubleValues(1) = 2.0;
846 }
else if (context.isRank(1)) {
847 doubleValues(0) = 3.0;
848 doubleValues(1) = 4.0;
849 }
else if (context.isRank(2)) {
850 doubleValues(0) = 5.0;
851 doubleValues(1) = 6.0;
852 }
else if (context.isRank(3)) {
853 doubleValues(0) = 7.0;
854 doubleValues(1) = 8.0;
857 std::string fileName(
"precice-WatchIntegralTest-scalarData-noConnectivity-parallel.log");
868 doubleValues(0) = 2.0;
869 doubleValues(1) = 3.0;
870 }
else if (context.isRank(1)) {
871 doubleValues(0) = 4.0;
872 doubleValues(1) = 5.0;
873 }
else if (context.isRank(2)) {
874 doubleValues(0) = 6.0;
875 doubleValues(1) = 7.0;
876 }
else if (context.isRank(3)) {
877 doubleValues(0) = 8.0;
878 doubleValues(1) = 9.0;
887 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData NoConnectivity Parallel")
890 auto result = readDoublesFromTXTFile(fileName, 2);
895 BOOST_TEST(result.size() == expected.size());
896 for (
size_t i = 0; i < result.size(); ++i) {
897 BOOST_TEST_CONTEXT(
"entry index: " << i)
900 BOOST_TEST(equals(result.at(i), expected.at(i)));
910 using namespace mesh;
915 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
916 auto & doubleValues = doubleData->values();
919 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
920 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
921 }
else if (context.isRank(1)) {
922 mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
923 mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
924 }
else if (context.isRank(2)) {
925 mesh->createVertex(Eigen::Vector2d(2.0, 0.0));
926 mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
927 }
else if (context.isRank(3)) {
928 mesh->createVertex(Eigen::Vector2d(3.0, 0.0));
929 mesh->createVertex(Eigen::Vector2d(0.0, 1.0));
932 mesh->allocateDataValues();
935 doubleValues(0) = 1.0;
936 doubleValues(1) = 2.0;
937 doubleValues(2) = 3.0;
938 doubleValues(3) = 4.0;
939 }
else if (context.isRank(1)) {
940 doubleValues(0) = 5.0;
941 doubleValues(1) = 6.0;
942 doubleValues(2) = 7.0;
943 doubleValues(3) = 8.0;
944 }
else if (context.isRank(2)) {
945 doubleValues(0) = 9.0;
946 doubleValues(1) = 10.0;
947 doubleValues(2) = 11.0;
948 doubleValues(3) = 12.0;
949 }
else if (context.isRank(3)) {
950 doubleValues(0) = 13.0;
951 doubleValues(1) = 14.0;
952 doubleValues(2) = 15.0;
953 doubleValues(3) = 16.0;
956 std::string fileName(
"precice-WatchIntegralTest-vectorData-noConnectivity-parallel.log");
967 doubleValues(0) = 2.0;
968 doubleValues(1) = 3.0;
969 doubleValues(2) = 4.0;
970 doubleValues(3) = 5.0;
971 }
else if (context.isRank(1)) {
972 doubleValues(0) = 6.0;
973 doubleValues(1) = 7.0;
974 doubleValues(2) = 8.0;
975 doubleValues(3) = 9.0;
976 }
else if (context.isRank(2)) {
977 doubleValues(0) = 10.0;
978 doubleValues(1) = 11.0;
979 doubleValues(2) = 12.0;
980 doubleValues(3) = 13.0;
981 }
else if (context.isRank(3)) {
982 doubleValues(0) = 14.0;
983 doubleValues(1) = 15.0;
984 doubleValues(2) = 16.0;
985 doubleValues(3) = 17.0;
994 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData NoConnectivity Parallel")
997 auto result = readDoublesFromTXTFile(fileName, 3);
1002 BOOST_TEST(result.size() == expected.size());
1003 for (
size_t i = 0; i < result.size(); ++i) {
1004 BOOST_TEST_CONTEXT(
"entry index: " << i)
1007 BOOST_TEST(equals(result.at(i), expected.at(i)));
1017 using namespace mesh;
1024 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
1025 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
1026 mesh->createEdge(v1, v2);
1028 if (context.isRank(1)) {
1029 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
1030 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
1031 mesh->createEdge(v3, v4);
1033 if (context.isRank(2)) {
1034 mesh::Vertex &v5 = mesh->createVertex(Eigen::Vector2d(2.0, 1.0));
1035 mesh::Vertex &v6 = mesh->createVertex(Eigen::Vector2d(2.0, 2.0));
1036 mesh->createEdge(v5, v6);
1038 if (context.isRank(3)) {
1039 mesh::Vertex &v7 = mesh->createVertex(Eigen::Vector2d(3.0, 1.0));
1040 mesh::Vertex &v8 = mesh->createVertex(Eigen::Vector2d(3.0, 3.0));
1041 mesh->createEdge(v7, v8);
1044 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
1045 auto & doubleValues = doubleData->values();
1047 mesh->allocateDataValues();
1050 doubleValues(0) = 1.0;
1051 doubleValues(1) = 2.0;
1053 if (context.isRank(1)) {
1054 doubleValues(0) = 3.0;
1055 doubleValues(1) = 4.0;
1057 if (context.isRank(2)) {
1058 doubleValues(0) = 5.0;
1059 doubleValues(1) = 6.0;
1061 if (context.isRank(3)) {
1062 doubleValues(0) = 7.0;
1063 doubleValues(1) = 8.0;
1066 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity-parallel.log");
1077 doubleValues(0) = 2.0;
1078 doubleValues(1) = 3.0;
1080 if (context.isRank(1)) {
1081 doubleValues(0) = 4.0;
1082 doubleValues(1) = 5.0;
1084 if (context.isRank(2)) {
1085 doubleValues(0) = 6.0;
1086 doubleValues(1) = 7.0;
1088 if (context.isRank(3)) {
1089 doubleValues(0) = 8.0;
1090 doubleValues(1) = 9.0;
1099 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData EdgeConnectivity Parallel")
1102 auto result = readDoublesFromTXTFile(fileName, 3);
1107 BOOST_TEST(result.size() == expected.size());
1108 for (
size_t i = 0; i < result.size(); ++i) {
1109 BOOST_TEST_CONTEXT(
"entry index: " << i)
1112 BOOST_TEST(equals(result.at(i), expected.at(i)));
1122 using namespace mesh;
1129 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector2d(0.0, 0.0));
1130 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector2d(1.0, 0.0));
1131 mesh->createEdge(v1, v2);
1133 if (context.isRank(1)) {
1134 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector2d(1.0, 1.0));
1135 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector2d(1.0, 2.0));
1136 mesh->createEdge(v3, v4);
1138 if (context.isRank(2)) {
1139 mesh::Vertex &v5 = mesh->createVertex(Eigen::Vector2d(2.0, 1.0));
1140 mesh::Vertex &v6 = mesh->createVertex(Eigen::Vector2d(2.0, 2.0));
1141 mesh->createEdge(v5, v6);
1143 if (context.isRank(3)) {
1144 mesh::Vertex &v7 = mesh->createVertex(Eigen::Vector2d(3.0, 1.0));
1145 mesh::Vertex &v8 = mesh->createVertex(Eigen::Vector2d(3.0, 3.0));
1146 mesh->createEdge(v7, v8);
1149 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
1150 auto & doubleValues = doubleData->values();
1152 mesh->allocateDataValues();
1155 doubleValues(0) = 1.0;
1156 doubleValues(1) = 2.0;
1157 doubleValues(2) = 3.0;
1158 doubleValues(3) = 4.0;
1160 if (context.isRank(1)) {
1161 doubleValues(0) = 5.0;
1162 doubleValues(1) = 6.0;
1163 doubleValues(2) = 7.0;
1164 doubleValues(3) = 8.0;
1166 if (context.isRank(2)) {
1167 doubleValues(0) = 9.0;
1168 doubleValues(1) = 10.0;
1169 doubleValues(2) = 11.0;
1170 doubleValues(3) = 12.0;
1172 if (context.isRank(3)) {
1173 doubleValues(0) = 13.0;
1174 doubleValues(1) = 14.0;
1175 doubleValues(2) = 15.0;
1176 doubleValues(3) = 16.0;
1179 std::string fileName(
"precice-WatchIntegralTest-scalarData-edgeConnectivity-parallel.log");
1190 doubleValues(0) = 2.0;
1191 doubleValues(1) = 3.0;
1192 doubleValues(2) = 4.0;
1193 doubleValues(3) = 5.0;
1195 if (context.isRank(1)) {
1196 doubleValues(0) = 6.0;
1197 doubleValues(1) = 7.0;
1198 doubleValues(2) = 8.0;
1199 doubleValues(3) = 9.0;
1201 if (context.isRank(2)) {
1202 doubleValues(0) = 10.0;
1203 doubleValues(1) = 11.0;
1204 doubleValues(2) = 12.0;
1205 doubleValues(3) = 13.0;
1207 if (context.isRank(3)) {
1208 doubleValues(0) = 14.0;
1209 doubleValues(1) = 15.0;
1210 doubleValues(2) = 16.0;
1211 doubleValues(3) = 17.0;
1220 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData EdgeConnectivity Parallel")
1223 auto result = readDoublesFromTXTFile(fileName, 4);
1225 0.0, 46.0, 51.0, 5.0,
1226 1.0, 51.0, 56.0, 5.0,
1227 2.0, 51.0, 56.0, 5.0};
1228 BOOST_TEST(result.size() == expected.size());
1229 for (
size_t i = 0; i < result.size(); ++i) {
1230 BOOST_TEST_CONTEXT(
"entry index: " << i)
1233 BOOST_TEST(equals(result.at(i), expected.at(i)));
1243 using namespace mesh;
1250 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1251 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
1252 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1256 mesh->createTriangle(e1, e2, e5);
1258 if (context.isRank(1)) {
1260 if (context.isRank(2)) {
1262 if (context.isRank(3)) {
1263 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1264 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1265 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
1269 mesh->createTriangle(e3, e4, e5);
1272 PtrData doubleData = mesh->createData(
"DoubleData", 1, 0_dataID);
1273 auto & doubleValues = doubleData->values();
1275 mesh->allocateDataValues();
1278 doubleValues(0) = 1.0;
1279 doubleValues(1) = 2.0;
1280 doubleValues(2) = 3.0;
1282 if (context.isRank(1)) {
1284 if (context.isRank(2)) {
1286 if (context.isRank(3)) {
1287 doubleValues(0) = 1.0;
1288 doubleValues(1) = 3.0;
1289 doubleValues(2) = 4.0;
1292 std::string fileName(
"precice-WatchIntegralTest-scalarData-faceConnectivity-parallel.log");
1303 doubleValues(0) = 2.0;
1304 doubleValues(1) = 3.0;
1305 doubleValues(2) = 4.0;
1307 if (context.isRank(1)) {
1309 if (context.isRank(2)) {
1311 if (context.isRank(3)) {
1312 doubleValues(0) = 2.0;
1313 doubleValues(1) = 4.0;
1314 doubleValues(2) = 5.0;
1323 BOOST_TEST_CONTEXT(
"Validating WatchIntegral ScalarData FaceConnectivity Parallel")
1326 auto result = readDoublesFromTXTFile(fileName, 3);
1331 BOOST_TEST(result.size() == expected.size());
1332 for (
size_t i = 0; i < result.size(); ++i) {
1333 BOOST_TEST_CONTEXT(
"entry index: " << i)
1336 BOOST_TEST(equals(result.at(i), expected.at(i)));
1346 using namespace mesh;
1353 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1354 mesh::Vertex &v2 = mesh->createVertex(Eigen::Vector3d(3.0, 0.0, 0.0));
1355 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1359 mesh->createTriangle(e1, e2, e5);
1361 if (context.isRank(1)) {
1363 if (context.isRank(2)) {
1365 if (context.isRank(3)) {
1366 mesh::Vertex &v1 = mesh->createVertex(Eigen::Vector3d(0.0, 0.0, 0.0));
1367 mesh::Vertex &v3 = mesh->createVertex(Eigen::Vector3d(3.0, 4.0, 0.0));
1368 mesh::Vertex &v4 = mesh->createVertex(Eigen::Vector3d(0.0, 4.0, 0.0));
1372 mesh->createTriangle(e3, e4, e5);
1375 PtrData doubleData = mesh->createData(
"DoubleData", 2, 0_dataID);
1376 auto & doubleValues = doubleData->values();
1378 mesh->allocateDataValues();
1381 doubleValues(0) = 1.0;
1382 doubleValues(1) = 2.0;
1383 doubleValues(2) = 3.0;
1384 doubleValues(3) = 4.0;
1385 doubleValues(4) = 5.0;
1386 doubleValues(5) = 6.0;
1388 if (context.isRank(1)) {
1390 if (context.isRank(2)) {
1392 if (context.isRank(3)) {
1393 doubleValues(0) = 1.0;
1394 doubleValues(1) = 2.0;
1395 doubleValues(2) = 5.0;
1396 doubleValues(3) = 6.0;
1397 doubleValues(4) = 7.0;
1398 doubleValues(5) = 8.0;
1401 std::string fileName(
"precice-WatchIntegralTest-vectorData-faceConnectivity-parallel.log");
1412 doubleValues(0) = 2.0;
1413 doubleValues(1) = 3.0;
1414 doubleValues(2) = 4.0;
1415 doubleValues(3) = 5.0;
1416 doubleValues(4) = 6.0;
1417 doubleValues(5) = 7.0;
1419 if (context.isRank(1)) {
1421 if (context.isRank(2)) {
1423 if (context.isRank(3)) {
1424 doubleValues(0) = 2.0;
1425 doubleValues(1) = 3.0;
1426 doubleValues(2) = 6.0;
1427 doubleValues(3) = 7.0;
1428 doubleValues(4) = 8.0;
1429 doubleValues(5) = 9.0;
1438 BOOST_TEST_CONTEXT(
"Validating WatchIntegral VectorData FaceConnectivity Parallel")
1441 auto result = readDoublesFromTXTFile(fileName, 4);
1443 0.0, 44.0, 56.0, 12.0,
1444 1.0, 56.0, 68.0, 12.0,
1445 2.0, 56.0, 68.0, 12.0};
1446 BOOST_TEST(result.size() == expected.size());
1447 for (
size_t i = 0; i < result.size(); ++i) {
1448 BOOST_TEST_CONTEXT(
"entry index: " << i)
1451 BOOST_TEST(equals(result.at(i), expected.at(i)));
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...