393 PRECICE_TEST(
"Solid"_on(1_rank),
"Fluid"_on(3_ranks).setupIntraComm(), Require::Events, Require::PETSc);
394 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
398 if (context.isNamed(
"Solid")) {
405 BOOST_TEST(context.isNamed(
"Fluid"));
414 boundingFromMapping->setMeshes(pSolidzMesh, pNastinMesh);
415 boundingToMapping->setMeshes(pNastinMesh, pSolidzMesh);
419 double safetyFactor = 20.0;
427 BOOST_TEST_CONTEXT(*pSolidzMesh)
429 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 3);
430 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 6);
431 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(1) == 6);
432 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(2) == 12);
433 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 6);
436 if (context.isPrimary()) {
437 BOOST_TEST(pSolidzMesh->nVertices() == 6);
438 BOOST_TEST(pSolidzMesh->edges().size() == 5);
439 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
440 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
441 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
442 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
false);
443 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
false);
444 BOOST_TEST(pSolidzMesh->vertex(5).isOwner() ==
false);
445 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
446 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
447 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
448 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
449 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
450 BOOST_TEST(pSolidzMesh->vertex(5).getGlobalIndex() == 5);
451 }
else if (context.isRank(1)) {
452 BOOST_TEST(pSolidzMesh->nVertices() == 0);
453 BOOST_TEST(pSolidzMesh->edges().size() == 0);
454 }
else if (context.isRank(2)) {
455 BOOST_TEST(pSolidzMesh->nVertices() == 6);
456 BOOST_TEST(pSolidzMesh->edges().size() == 5);
457 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
false);
458 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
false);
459 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
false);
460 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
true);
461 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
true);
462 BOOST_TEST(pSolidzMesh->vertex(5).isOwner() ==
true);
463 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
464 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
465 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
466 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
467 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
468 BOOST_TEST(pSolidzMesh->vertex(5).getGlobalIndex() == 5);
476 PRECICE_TEST(
"Solid"_on(1_rank),
"Fluid"_on(3_ranks).setupIntraComm(), Require::Events, Require::PETSc);
477 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
481 if (context.isNamed(
"Solid")) {
488 BOOST_TEST(context.isNamed(
"Fluid"));
492 double supportRadius = 0.25;
499 boundingFromMapping->setMeshes(pSolidzMesh, pNastinMesh);
500 boundingToMapping->setMeshes(pNastinMesh, pSolidzMesh);
504 double safetyFactor = 20.0;
512 BOOST_TEST_CONTEXT(*pSolidzMesh)
514 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 3);
515 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 3);
516 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(1) == 3);
517 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(2) == 6);
518 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 6);
521 if (context.isPrimary()) {
522 BOOST_TEST(pSolidzMesh->nVertices() == 3);
523 BOOST_TEST(pSolidzMesh->edges().size() == 2);
524 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
525 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
526 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
527 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
528 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
529 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
530 }
else if (context.isRank(1)) {
531 BOOST_TEST(pSolidzMesh->nVertices() == 0);
532 BOOST_TEST(pSolidzMesh->edges().size() == 0);
533 }
else if (context.isRank(2)) {
534 BOOST_TEST(pSolidzMesh->nVertices() == 3);
535 BOOST_TEST(pSolidzMesh->edges().size() == 2);
536 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
537 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
538 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
539 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 3);
540 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 4);
541 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 5);
549 PRECICE_TEST(
"Solid"_on(1_rank),
"Fluid"_on(3_ranks).setupIntraComm(), Require::Events, Require::PETSc);
550 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
554 if (context.isNamed(
"Solid")) {
561 BOOST_TEST(context.isNamed(
"Fluid"));
565 double supportRadius = 2.45;
572 boundingFromMapping->setMeshes(pSolidzMesh, pNastinMesh);
573 boundingToMapping->setMeshes(pNastinMesh, pSolidzMesh);
577 double safetyFactor = 20.0;
585 BOOST_TEST_CONTEXT(*pSolidzMesh)
587 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 3);
588 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 4);
589 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(1) == 4);
590 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(2) == 9);
591 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 6);
594 if (context.isPrimary()) {
595 BOOST_TEST(pSolidzMesh->nVertices() == 4);
596 BOOST_TEST(pSolidzMesh->edges().size() == 3);
597 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
598 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
599 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
600 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
false);
601 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
602 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
603 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
604 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
605 }
else if (context.isRank(1)) {
606 BOOST_TEST(pSolidzMesh->nVertices() == 0);
607 BOOST_TEST(pSolidzMesh->edges().size() == 0);
608 }
else if (context.isRank(2)) {
609 BOOST_TEST(pSolidzMesh->nVertices() == 5);
610 BOOST_TEST(pSolidzMesh->edges().size() == 4);
611 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
false);
612 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
false);
613 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
614 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
true);
615 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
true);
616 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 1);
617 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 2);
618 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 3);
619 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 4);
620 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 5);
628 PRECICE_TEST(
"Solid"_on(1_rank),
"Fluid"_on(3_ranks).setupIntraComm(), Require::Events, Require::PETSc);
629 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
633 if (context.isNamed(
"Solid")) {
640 BOOST_TEST(context.isNamed(
"Fluid"));
644 double supportRadius1 = 1.2;
645 double supportRadius2 = 0.2;
653 boundingFromMapping->setMeshes(pSolidzMesh, pNastinMesh);
654 boundingToMapping->setMeshes(pNastinMesh, pSolidzMesh);
658 double safetyFactor = 20.0;
666 BOOST_TEST_CONTEXT(*pSolidzMesh)
668 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 3);
669 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 5);
670 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(1) == 5);
671 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(2) == 10);
672 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 5);
675 if (context.isPrimary()) {
676 BOOST_TEST(pSolidzMesh->nVertices() == 5);
677 BOOST_TEST(pSolidzMesh->edges().size() == 6);
678 BOOST_TEST(pSolidzMesh->triangles().size() == 2);
679 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
680 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
681 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
false);
682 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
false);
683 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
false);
684 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
685 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
686 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
687 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
688 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
689 }
else if (context.isRank(1)) {
690 BOOST_TEST(pSolidzMesh->nVertices() == 0);
691 BOOST_TEST(pSolidzMesh->edges().size() == 0);
692 BOOST_TEST(pSolidzMesh->triangles().size() == 0);
693 }
else if (context.isRank(2)) {
694 BOOST_TEST(pSolidzMesh->nVertices() == 5);
695 BOOST_TEST(pSolidzMesh->edges().size() == 6);
696 BOOST_TEST(pSolidzMesh->triangles().size() == 2);
697 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
false);
698 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
false);
699 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
700 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
true);
701 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
true);
702 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
703 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
704 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
705 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
706 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
768 PRECICE_TEST(
"Solid"_on(1_rank),
"Fluid"_on(3_ranks).setupIntraComm(), Require::Events);
769 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
773 if (context.isNamed(
"Solid")) {
776 Eigen::VectorXd position(dimensions);
777 position << 0.0, 0.0;
778 pMesh->createVertex(position);
779 position << 1.0, 0.0;
780 pMesh->createVertex(position);
781 position << 2.0, 0.0;
782 pMesh->createVertex(position);
784 pMesh->computeBoundingBox();
791 BOOST_TEST(context.isNamed(
"Fluid"));
797 boundingFromMapping->setMeshes(pMesh, pOtherMesh);
799 if (context.isPrimary()) {
800 Eigen::VectorXd position(dimensions);
801 position << 0.0, 0.0;
802 pOtherMesh->createVertex(position);
803 position << 0.8, 0.0;
804 pOtherMesh->createVertex(position);
805 }
else if (context.isRank(1)) {
806 Eigen::VectorXd position(dimensions);
807 position << 1.0, 0.0;
808 pOtherMesh->createVertex(position);
809 position << 1.2, 0.0;
810 pOtherMesh->createVertex(position);
811 }
else if (context.isRank(2)) {
815 pOtherMesh->computeBoundingBox();
817 double safetyFactor = 20.0;
824 BOOST_TEST(pMesh->getVertexOffsets().size() == 3);
825 BOOST_TEST(pMesh->getVertexOffsets().at(0) == 2);
826 BOOST_TEST(pMesh->getVertexOffsets().at(1) == 3);
827 BOOST_TEST(pMesh->getVertexOffsets().at(2) == 3);
829 if (context.isPrimary()) {
830 BOOST_TEST(pMesh->getVertexDistribution().at(0).size() == 2);
831 BOOST_TEST(pMesh->getVertexDistribution().at(1).size() == 1);
832 BOOST_TEST(pMesh->getVertexDistribution().at(2).size() == 0);
833 BOOST_TEST(pMesh->getVertexDistribution().at(0).at(0) == 0);
834 BOOST_TEST(pMesh->getVertexDistribution().at(0).at(1) == 1);
835 BOOST_TEST(pMesh->getVertexDistribution().at(1).at(0) == 1);
836 BOOST_TEST(pMesh->nVertices() == 2);
837 BOOST_TEST(pMesh->vertex(0).getGlobalIndex() == 0);
838 BOOST_TEST(pMesh->vertex(1).getGlobalIndex() == 1);
839 BOOST_TEST(pMesh->vertex(0).isOwner() ==
true);
840 BOOST_TEST(pMesh->vertex(1).isOwner() ==
false);
841 }
else if (context.isRank(1)) {
842 BOOST_TEST(pMesh->nVertices() == 1);
843 BOOST_TEST(pMesh->vertex(0).getGlobalIndex() == 1);
844 BOOST_TEST(pMesh->vertex(0).isOwner() ==
true);
845 }
else if (context.isRank(2)) {
846 BOOST_TEST(pMesh->nVertices() == 0);
853 PRECICE_TEST(
"Fluid"_on(1_rank),
"Solid"_on(1_rank), Require::Events);
854 auto m2n = context.connectPrimaryRanks(
"Solid",
"Fluid");
858 if (context.isNamed(
"Solid")) {
866 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 6);
867 BOOST_TEST(pSolidzMesh->nVertices() == 6);
868 BOOST_TEST(pSolidzMesh->edges().size() == 5);
869 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 1);
870 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 6);
871 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
872 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
873 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
874 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
875 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
876 BOOST_TEST(pSolidzMesh->vertex(5).getGlobalIndex() == 5);
877 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
878 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
879 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
880 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
true);
881 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
true);
882 BOOST_TEST(pSolidzMesh->vertex(5).isOwner() ==
true);
884 BOOST_TEST(context.isNamed(
"Fluid"));
890 boundingFromMapping->setMeshes(pSolidzMesh, pOtherMesh);
892 double safetyFactor = 0.1;
899 BOOST_TEST(pSolidzMesh->getGlobalNumberOfVertices() == 6);
900 BOOST_TEST(pSolidzMesh->nVertices() == 6);
901 BOOST_TEST(pSolidzMesh->edges().size() == 5);
902 BOOST_TEST(pSolidzMesh->getVertexOffsets().size() == 1);
903 BOOST_TEST(pSolidzMesh->getVertexOffsets().at(0) == 6);
904 BOOST_TEST(pSolidzMesh->vertex(0).getGlobalIndex() == 0);
905 BOOST_TEST(pSolidzMesh->vertex(1).getGlobalIndex() == 1);
906 BOOST_TEST(pSolidzMesh->vertex(2).getGlobalIndex() == 2);
907 BOOST_TEST(pSolidzMesh->vertex(3).getGlobalIndex() == 3);
908 BOOST_TEST(pSolidzMesh->vertex(4).getGlobalIndex() == 4);
909 BOOST_TEST(pSolidzMesh->vertex(5).getGlobalIndex() == 5);
910 BOOST_TEST(pSolidzMesh->vertex(0).isOwner() ==
true);
911 BOOST_TEST(pSolidzMesh->vertex(1).isOwner() ==
true);
912 BOOST_TEST(pSolidzMesh->vertex(2).isOwner() ==
true);
913 BOOST_TEST(pSolidzMesh->vertex(3).isOwner() ==
true);
914 BOOST_TEST(pSolidzMesh->vertex(4).isOwner() ==
true);
915 BOOST_TEST(pSolidzMesh->vertex(5).isOwner() ==
true);
1096 PRECICE_TEST(
""_on(4_ranks).setupIntraComm(), Require::Events);
1101 if (context.isRank(0)) {
1102 Eigen::VectorXd position(dimensions);
1103 position << 0.0, 0.0;
1104 mesh->createVertex(position);
1105 position << 1.0, 0.0;
1106 mesh->createVertex(position);
1107 position << 2.0, 0.0;
1108 mesh->createVertex(position);
1109 position << 0.0, 1.0;
1110 mesh->createVertex(position);
1111 position << 1.0, 1.0;
1112 mesh->createVertex(position);
1113 position << 2.0, 1.0;
1114 mesh->createVertex(position);
1116 }
else if (context.isRank(1)) {
1117 Eigen::VectorXd position(dimensions);
1118 position << 0.0, 0.0;
1119 mesh->createVertex(position);
1120 position << -1.0, 0.0;
1121 mesh->createVertex(position);
1122 position << -2.0, 0.0;
1123 mesh->createVertex(position);
1124 position << -0.5, 1.0;
1125 mesh->createVertex(position);
1126 position << -1.0, 1.0;
1127 mesh->createVertex(position);
1128 position << -2.0, 1.0;
1129 mesh->createVertex(position);
1130 }
else if (context.isRank(2)) {
1131 Eigen::VectorXd position(dimensions);
1132 position << 0.0, 0.0;
1133 mesh->createVertex(position);
1134 position << -1.0, -0.5;
1135 mesh->createVertex(position);
1137 Eigen::VectorXd position(dimensions);
1138 position << 0.0, 0.0;
1139 mesh->createVertex(position);
1140 position << 1.0, -0.5;
1141 mesh->createVertex(position);
1142 position << 2.0, -0.5;
1143 mesh->createVertex(position);
1144 position << 0.5, -1.0;
1145 mesh->createVertex(position);
1146 position << 1.0, -1.0;
1147 mesh->createVertex(position);
1148 position << 2.0, -1.0;
1149 mesh->createVertex(position);
1152 mesh->computeBoundingBox();
1153 mesh->setGlobalNumberOfVertices(mesh->nVertices());
1155 for (
auto &vertex : mesh->vertices()) {
1158 if (vertex.coord(0) == 0 && vertex.coord(1) == 0) {
1159 vertex.setGlobalIndex(0);
1166 bool includeVertex =
false;
1168 for (
auto &vertex : mesh->vertices()) {
1169 if (vertex.getGlobalIndex() == 0) {
1170 includeVertex =
true;
1171 if (context.isRank(2)) {
1172 BOOST_TEST(vertex.isOwner() == 1);
1174 BOOST_TEST(vertex.isOwner() == 0);
1177 BOOST_TEST(includeVertex ==
true);
1189 PRECICE_TEST(
""_on(4_ranks).setupIntraComm(), Require::Events);
1194 if (context.isRank(0)) {
1195 Eigen::VectorXd position(dimensions);
1196 position << 0.0, 0.0, 0.0;
1197 mesh->createVertex(position);
1198 position << 1.0, 0.0, 0.0;
1199 mesh->createVertex(position);
1200 position << 2.0, 0.0, 0.0;
1201 mesh->createVertex(position);
1202 position << 0.0, 1.0, 0.0;
1203 mesh->createVertex(position);
1204 position << 1.0, 1.0, 0.0;
1205 mesh->createVertex(position);
1206 position << 2.0, 1.0, 0.0;
1207 mesh->createVertex(position);
1208 position << 0.0, 0.0, 1.0;
1209 mesh->createVertex(position);
1210 position << 1.0, 0.0, 1.0;
1211 mesh->createVertex(position);
1212 position << 2.0, 0.0, 1.0;
1213 mesh->createVertex(position);
1214 position << 0.0, 1.0, 1.0;
1215 mesh->createVertex(position);
1216 position << 1.0, 1.0, 1.0;
1217 mesh->createVertex(position);
1218 position << 2.0, 1.0, 1.0;
1219 mesh->createVertex(position);
1221 }
else if (context.isRank(1)) {
1222 Eigen::VectorXd position(dimensions);
1223 position << 0.0, 0.0, 0.0;
1224 mesh->createVertex(position);
1225 position << -1.0, 0.0, 0.0;
1226 mesh->createVertex(position);
1227 position << -2.0, 0.0, 0.0;
1228 mesh->createVertex(position);
1229 position << -0.1, 1.0, 0.0;
1230 mesh->createVertex(position);
1231 position << -1.0, 1.0, 0.0;
1232 mesh->createVertex(position);
1233 position << -2.0, 1.0, 0.0;
1234 mesh->createVertex(position);
1235 position << 0.0, 0.0, 1.0;
1236 mesh->createVertex(position);
1237 position << -1.0, 0.0, 1.0;
1238 mesh->createVertex(position);
1239 position << -2.0, 0.0, 1.0;
1240 mesh->createVertex(position);
1241 position << -0.1, 1.0, 1.0;
1242 mesh->createVertex(position);
1243 position << -1.0, 1.0, 1.0;
1244 mesh->createVertex(position);
1245 position << -2.0, 1.0, 1.0;
1246 mesh->createVertex(position);
1247 }
else if (context.isRank(2)) {
1248 Eigen::VectorXd position(dimensions);
1249 position << 0.0, 0.0, 0.0;
1250 mesh->createVertex(position);
1251 position << -1.0, -0.1, 0.0;
1252 mesh->createVertex(position);
1253 position << -2.0, -0.1, 0.0;
1254 mesh->createVertex(position);
1255 position << 0.0, -1.0, 0.0;
1256 mesh->createVertex(position);
1257 position << -1.0, -1.0, 0.0;
1258 mesh->createVertex(position);
1259 position << -2.0, -1.0, 0.0;
1260 mesh->createVertex(position);
1261 position << 0.0, 0.0, 1.0;
1262 mesh->createVertex(position);
1263 position << -1.0, -0.1, 1.0;
1264 mesh->createVertex(position);
1265 position << -2.0, -0.1, 1.0;
1266 mesh->createVertex(position);
1267 position << 0.0, -1.0, 1.0;
1268 mesh->createVertex(position);
1269 position << -1.0, -1.0, 1.0;
1270 mesh->createVertex(position);
1271 position << -2.0, -1.0, 1.0;
1272 mesh->createVertex(position);
1274 Eigen::VectorXd position(dimensions);
1275 position << 0.0, 0.0, 0.0;
1276 mesh->createVertex(position);
1277 position << 1.0, -0.1, 0.0;
1278 mesh->createVertex(position);
1279 position << 2.0, -0.1, 0.0;
1280 mesh->createVertex(position);
1281 position << 0.0, -1.0, 0.0;
1282 mesh->createVertex(position);
1283 position << 1.0, -1.0, 0.0;
1284 mesh->createVertex(position);
1285 position << 2.0, -1.0, 0.0;
1286 mesh->createVertex(position);
1287 position << 0.0, 0.0, 1.0;
1288 mesh->createVertex(position);
1289 position << 1.0, -0.1, 1.0;
1290 mesh->createVertex(position);
1291 position << 2.0, -0.1, 1.0;
1292 mesh->createVertex(position);
1293 position << 0.0, -1.0, 1.0;
1294 mesh->createVertex(position);
1295 position << 1.0, -1.0, 1.0;
1296 mesh->createVertex(position);
1297 position << 2.0, -1.0, 1.0;
1298 mesh->createVertex(position);
1301 mesh->computeBoundingBox();
1302 mesh->setGlobalNumberOfVertices(mesh->nVertices());
1304 for (
auto &vertex : mesh->vertices()) {
1307 if (vertex.coord(0) == 0 && vertex.coord(1) == 0) {
1308 if (vertex.coord(2) == 0) {
1309 vertex.setGlobalIndex(0);
1310 }
else if (vertex.coord(2) == 1) {
1311 vertex.setGlobalIndex(6);
1319 bool includeVertex =
false;
1321 for (
auto &vertex : mesh->vertices()) {
1322 if (vertex.getGlobalIndex() == 0) {
1323 includeVertex =
true;
1324 if (context.isRank(0)) {
1325 BOOST_TEST(vertex.isOwner() == 1);
1327 BOOST_TEST(vertex.isOwner() == 0);
1330 BOOST_TEST(includeVertex ==
true);
1342 PRECICE_TEST(
""_on(4_ranks).setupIntraComm(), Require::Events);
1347 if (context.isRank(0)) {
1348 Eigen::VectorXd position(dimensions);
1349 position << 0.0, 0.0, 0.0;
1350 mesh->createVertex(position);
1351 position << 1.0, 0.0, 0.0;
1352 mesh->createVertex(position);
1353 position << 2.0, 0.0, 0.0;
1354 mesh->createVertex(position);
1355 position << 0.0, 1.0, 0.0;
1356 mesh->createVertex(position);
1357 position << 1.0, 1.0, 0.0;
1358 mesh->createVertex(position);
1359 position << 2.0, 1.0, 0.0;
1360 mesh->createVertex(position);
1361 position << 0.0, 0.0, 1.0;
1362 mesh->createVertex(position);
1363 position << 1.0, 0.0, 1.0;
1364 mesh->createVertex(position);
1365 position << 2.0, 0.0, 1.0;
1366 mesh->createVertex(position);
1367 position << 0.0, 1.0, 1.0;
1368 mesh->createVertex(position);
1369 position << 1.0, 1.0, 1.0;
1370 mesh->createVertex(position);
1371 position << 2.0, 1.0, 1.0;
1372 mesh->createVertex(position);
1374 }
else if (context.isRank(1)) {
1375 Eigen::VectorXd position(dimensions);
1376 position << 0.0, 0.0, 0.0;
1377 mesh->createVertex(position);
1378 position << -1.0, 0.0, 0.0;
1379 mesh->createVertex(position);
1380 position << -2.0, 0.0, 0.0;
1381 mesh->createVertex(position);
1382 position << -0.1, 1.0, 0.0;
1383 mesh->createVertex(position);
1384 position << -1.0, 1.0, 0.0;
1385 mesh->createVertex(position);
1386 position << -2.0, 1.0, 0.0;
1387 mesh->createVertex(position);
1388 position << 0.0, 0.0, 1.0;
1389 mesh->createVertex(position);
1390 position << -1.0, 0.0, 1.0;
1391 mesh->createVertex(position);
1392 position << -2.0, 0.0, 1.0;
1393 mesh->createVertex(position);
1394 position << -0.1, 1.0, 1.0;
1395 mesh->createVertex(position);
1396 position << -1.0, 1.0, 1.0;
1397 mesh->createVertex(position);
1398 position << -2.0, 1.0, 1.0;
1399 mesh->createVertex(position);
1400 }
else if (context.isRank(2)) {
1402 Eigen::VectorXd position(dimensions);
1403 position << 0.0, 0.0, 0.0;
1404 mesh->createVertex(position);
1405 position << 1.0, -0.1, 0.0;
1406 mesh->createVertex(position);
1407 position << 2.0, -0.1, 0.0;
1408 mesh->createVertex(position);
1409 position << 0.0, -1.0, 0.0;
1410 mesh->createVertex(position);
1411 position << 1.0, -1.0, 0.0;
1412 mesh->createVertex(position);
1413 position << 2.0, -1.0, 0.0;
1414 mesh->createVertex(position);
1415 position << 0.0, 0.0, 1.0;
1416 mesh->createVertex(position);
1417 position << 1.0, -0.1, 1.0;
1418 mesh->createVertex(position);
1419 position << 2.0, -0.1, 1.0;
1420 mesh->createVertex(position);
1421 position << 0.0, -1.0, 1.0;
1422 mesh->createVertex(position);
1423 position << 1.0, -1.0, 1.0;
1424 mesh->createVertex(position);
1425 position << 2.0, -1.0, 1.0;
1426 mesh->createVertex(position);
1429 mesh->computeBoundingBox();
1430 mesh->setGlobalNumberOfVertices(mesh->nVertices());
1432 for (
auto &vertex : mesh->vertices()) {
1435 if (vertex.coord(0) == 0 && vertex.coord(1) == 0) {
1436 if (vertex.coord(2) == 0) {
1437 vertex.setGlobalIndex(0);
1438 }
else if (vertex.coord(2) == 1) {
1439 vertex.setGlobalIndex(6);
1447 bool includeVertex =
false;
1449 for (
auto &vertex : mesh->vertices()) {
1450 if (vertex.getGlobalIndex() == 0) {
1451 includeVertex =
true;
1452 if (context.isRank(0)) {
1453 BOOST_TEST(vertex.isOwner() == 1);
1455 BOOST_TEST(vertex.isOwner() == 0);
1458 BOOST_TEST(includeVertex ==
true);