29 std::vector<MHexahedron *> &dwarfs88);
34 double u1 = 0., u2 = 1.;
67 case 0: isBL =
true;
break;
70 if(ve && ve->
bl_data) isBL =
true;
75 if(vf && vf->
bl_data) isBL =
true;
79 if(!isBL)
return false;
90 std::vector<MLine *> lines2;
91 for(std::size_t i = 0; i < ge->
lines.size(); i++) {
116 if(!splitIntoQuads && !splitIntoHexas) {
117 std::vector<MTriangle *> triangles2;
118 for(std::size_t i = 0; i < gf->
triangles.size(); i++) {
121 triangles2.push_back(
123 triangles2.push_back(
125 triangles2.push_back(
127 triangles2.push_back(
136 std::vector<MQuadrangle *> quadrangles2;
137 for(std::size_t i = 0; i < gf->
quadrangles.size(); i++) {
152 if(splitIntoQuads || splitIntoHexas) {
153 for(std::size_t i = 0; i < gf->
triangles.size(); i++) {
159 t->
pnt(1. / 3., 1. / 3., 0., ptx);
160 newv =
new MVertex(ptx.
x(), ptx.
y(), ptx.
z(), gf);
164 const double pp[2] = {0.5, 0.5};
169 if(splitIntoHexas) faceVertices[t->
getFace(0)].push_back(newv);
195 if(!splitIntoHexas) {
197 std::vector<MTetrahedron *> tetrahedra2;
198 for(std::size_t i = 0; i < gr->
tetrahedra.size(); i++) {
230 std::vector<MHexahedron *> hexahedra2;
231 for(std::size_t i = 0; i < gr->
hexahedra.size(); i++) {
269 for(std::size_t i = 0; i < gr->
tetrahedra.size(); i++) {
272 std::vector<MVertex *> newv;
275 auto fIter = faceVertices.find(face);
276 if(fIter != faceVertices.end()) { newv.push_back(fIter->second[0]); }
279 newv.push_back(
new MVertex(pc.
x(), pc.
y(), pc.
z(), gr));
280 faceVertices[face].push_back(newv.back());
285 newv.push_back(
new MVertex(pc.
x(), pc.
y(), pc.
z(), gr));
289 t->
getVertex(7), newv[1], newv[4], newv[2]));
290 hexahedra2.push_back(
292 newv[0], newv[1], t->
getVertex(9), newv[3], newv[4]));
298 t->
getVertex(8), newv[3], newv[4], newv[2]));
311 for(std::size_t i = 0; i < gr->
prisms.size(); i++) {
314 std::vector<MVertex *> newv;
315 for(
int j = 0; j < 2; j++) {
317 auto fIter = faceVertices.find(face);
318 if(fIter != faceVertices.end()) { newv.push_back(fIter->second[0]); }
321 newv.push_back(
new MVertex(pc.
x(), pc.
y(), pc.
z(), gr));
322 faceVertices[face].push_back(newv.back());
327 newv.push_back(
new MVertex(pc.
x(), pc.
y(), pc.
z(), gr));
359 std::vector<MHexahedron *> dwarfs88;
360 for(std::size_t i = 0; i < gr->
pyramids.size(); i++) {
364 for(
int j = 0; j < 88; j++) hexahedra2.push_back(dwarfs88[j]);
372 std::vector<MPrism *> prisms2;
373 for(std::size_t i = 0; i < gr->
prisms.size(); i++) {
406 std::vector<MPyramid *> pyramids2;
407 for(std::size_t i = 0; i < gr->
pyramids.size(); i++) {
409 Msg::Error(
"Full hexahedron subdivision is not implemented for pyramids");
495 Subdivide(*it, splitIntoQuads, splitIntoHexas, faceVertices, linear);
497 Subdivide(*it, splitIntoHexas, faceVertices);
520 std::vector<MTriangle *> triangles2(3 * numt);
521 for(std::size_t i = 0; i < numt; i++) {
527 triangles2[3 * i + 1] =
529 triangles2[3 * i + 2] =
543 std::vector<MTetrahedron *> tetrahedra2(4 * numt);
544 for(std::size_t i = 0; i < numt; i++) {
566 Msg::StatusBar(
true,
"Done barycentrically refining mesh (Wall %gs, CPU %gs)",
574 double coord[105] = {
575 0.500000, 0.666667, 0.500000, 1.000000, 1.000000, 1.000000, 0.289057,
576 0.324970, 0.276710, 0.337200, 0.364878, 0.325197, 0.000000, 0.000000,
577 0.000000, 0.000000, 0.000000, 0.000000, -0.289057, -0.324970, -0.276710,
578 -0.337200, -0.364878, -0.325197, -0.500000, -0.666667, -0.500000, -1.000000,
579 -1.000000, -1.000000, 0.084599, 0.263953, 0.442960, 0.310954, 0.000000,
580 0.000000, 0.118244, 0.212082, 0.244049, 0.213940, 0.040495, 0.110306,
581 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.118244,
582 -0.212082, -0.244049, -0.213940, -0.040495, -0.110306, -0.084599, -0.263953,
583 -0.442960, -0.310954, 0.650493, 0.454537, 0.000000, 0.000000, 0.320508,
584 0.264129, 0.063695, 0.092212, 0.000000, 0.000000, 0.000000, 0.000000,
585 -0.320508, -0.264129, -0.063695, -0.092212, -0.650493, -0.454537, 0.619616,
586 0.000000, 0.277170, 0.124682, 0.000000, 0.000000, -0.277170, -0.124682,
587 -0.619616, 0.128101, 0.000000, 0.176104, 0.084236, 0.000000, 0.000000,
588 -0.176104, -0.084236, -0.128101, 0.000000, 0.000000, 0.000000, 0.000000,
589 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000};
596 double coord[105] = {
597 0.707107, 0.471405, 0.707107, 0.000000, 0.000000, 0.000000, 0.474601,
598 0.421483, 0.463847, 0.367090, 0.344843, 0.361229, 0.429392, 0.410339,
599 0.435001, 0.407674, 0.401208, 0.404164, 0.474601, 0.421483, 0.463847,
600 0.367090, 0.344843, 0.361229, 0.707107, 0.471405, 0.707107, 0.000000,
601 0.000000, 0.000000, 0.536392, 0.697790, 0.569124, 0.742881, 0.558045,
602 0.946690, 0.497378, 0.532513, 0.500133, 0.541479, 0.530503, 0.666252,
603 0.463274, 0.465454, 0.430972, 0.451135, 0.515274, 0.589713, 0.497378,
604 0.532513, 0.500133, 0.541479, 0.530503, 0.666252, 0.536392, 0.697790,
605 0.569124, 0.742881, 0.080018, 0.104977, 0.216381, 0.200920, 0.326416,
606 0.339933, 0.280915, 0.305725, 0.396502, 0.394423, 0.310617, 0.337499,
607 0.326416, 0.339933, 0.280915, 0.305725, 0.080018, 0.104977, 0.081443,
608 0.204690, 0.354750, 0.334964, 0.403611, 0.367496, 0.354750, 0.334964,
609 0.081443, 0.501199, 0.538575, 0.447454, 0.486224, 0.431723, 0.470065,
610 0.447454, 0.486224, 0.501199, 0.488701, 0.471405, 0.017336, 0.000000,
611 0.452197, 0.471405, 0.057682, 0.000000, 1.414213, 0.015731, 0.000000};
618 double coord[105] = {
619 0.500000, 0.000000, -0.500000, 1.000000, 0.000000, -1.000000, 0.051666,
620 -0.058015, -0.148140, 0.071987, -0.057896, -0.181788, -0.016801, -0.054195,
621 -0.104114, -0.015276, -0.054392, -0.110605, 0.051666, -0.058015, -0.148140,
622 0.071987, -0.057896, -0.181788, 0.500000, 0.000000, -0.500000, 1.000000,
623 0.000000, -1.000000, -0.208673, -0.162945, 0.021476, 0.389516, -0.157646,
624 0.159885, -0.142645, -0.073557, -0.032793, 0.060339, -0.136482, 0.043449,
625 -0.111103, -0.079664, -0.047879, -0.008734, -0.124554, 0.008560, -0.142645,
626 -0.073557, -0.032793, 0.060339, -0.136482, 0.043449, -0.208673, -0.162945,
627 0.021476, 0.389516, -0.041899, -0.680880, -0.103504, -0.392255, -0.065989,
628 -0.212535, -0.093142, -0.227139, -0.056201, -0.124443, -0.087185, -0.182164,
629 -0.065989, -0.212535, -0.093142, -0.227139, -0.041899, -0.680880, 0.786284,
630 0.443271, 0.104202, 0.144731, -0.005330, 0.073926, 0.104202, 0.144731,
631 0.786284, -0.364254, -0.282882, -0.189794, -0.182143, -0.127036, -0.148665,
632 -0.189794, -0.182143, -0.364254, 0.642222, 0.666667, 0.959658, 1.000000,
633 -0.455079, -0.666667, -0.844452, -1.000000, 0.000000, -0.009020, 0.000000};
640 int n0[88] = {0, 1, 6, 7, 12, 13, 18, 19, 41, 39, 37, 41, 36, 40, 47,
641 45, 43, 47, 42, 46, 53, 51, 49, 53, 48, 52, 35, 57, 55, 35,
642 54, 34, 34, 35, 65, 63, 64, 62, 69, 67, 68, 66, 73, 71, 72,
643 70, 61, 75, 60, 74, 60, 61, 79, 78, 81, 80, 83, 82, 77, 84,
644 77, 88, 87, 90, 89, 92, 91, 86, 93, 86, 57, 24, 95, 85, 2,
645 99, 84, 74, 97, 104, 104, 97, 26, 35, 35, 24, 35, 24};
647 int n1[88] = {1, 2, 7, 8, 13, 14, 19, 20, 39, 6, 38, 37, 37, 36, 45,
648 12, 44, 43, 43, 42, 51, 18, 50, 49, 49, 48, 57, 24, 56, 55,
649 55, 54, 40, 41, 63, 11, 62, 10, 67, 17, 66, 16, 71, 23, 70,
650 22, 75, 29, 74, 28, 64, 65, 78, 9, 80, 15, 82, 21, 84, 27,
651 79, 87, 8, 89, 14, 91, 20, 93, 26, 88, 35, 57, 94, 86, 85,
652 98, 77, 60, 96, 103, 28, 27, 99, 55, 102, 25, 31, 102};
654 int n2[88] = {4, 5, 10, 11, 16, 17, 22, 23, 38, 7, 7, 36, 8, 87, 44,
655 13, 13, 42, 14, 89, 50, 19, 19, 48, 20, 91, 56, 25, 25, 54,
656 26, 93, 46, 47, 62, 10, 78, 9, 66, 16, 80, 15, 70, 22, 82,
657 21, 74, 28, 84, 27, 68, 69, 39, 6, 45, 12, 51, 18, 57, 24,
658 81, 63, 11, 67, 17, 71, 23, 75, 29, 90, 33, 94, 33, 93, 98,
659 93, 76, 58, 76, 58, 74, 84, 2, 26, 2, 26, 2, 0};
661 int n3[88] = {3, 4, 9, 10, 15, 16, 21, 22, 37, 38, 8, 40, 87,
662 88, 43, 44, 14, 46, 89, 90, 49, 50, 20, 52, 91, 92,
663 55, 56, 26, 34, 93, 86, 52, 53, 64, 62, 79, 78, 68,
664 66, 81, 80, 72, 70, 83, 82, 60, 74, 77, 84, 72, 73,
665 41, 39, 47, 45, 53, 51, 35, 57, 83, 65, 63, 69, 67,
666 73, 71, 61, 75, 92, 94, 95, 0, 98, 99, 26, 96, 103,
667 3, 4, 103, 96, 102, 102, 31, 102, 102, 95};
669 int n4[88] = {6, 7, 12, 13, 18, 19, 24, 25, 35, 33, 31, 35, 30, 34, 41,
670 39, 37, 41, 36, 40, 47, 45, 43, 47, 42, 46, 53, 51, 49, 53,
671 48, 52, 86, 34, 61, 59, 60, 58, 65, 63, 64, 62, 69, 67, 68,
672 66, 73, 71, 72, 70, 77, 60, 77, 76, 79, 78, 81, 80, 83, 82,
673 35, 86, 85, 88, 87, 90, 89, 92, 91, 61, 84, 27, 97, 59, 5,
674 101, 74, 75, 104, 101, 101, 104, 93, 34, 34, 57, 33, 57};
676 int n5[88] = {7, 8, 13, 14, 19, 20, 25, 26, 33, 0, 32, 31, 31, 30, 39,
677 6, 38, 37, 37, 36, 45, 12, 44, 43, 43, 42, 51, 18, 50, 49,
678 49, 48, 88, 40, 59, 5, 58, 4, 63, 11, 62, 10, 67, 17, 66,
679 16, 71, 23, 70, 22, 79, 64, 76, 3, 78, 9, 80, 15, 82, 21,
680 41, 85, 2, 87, 8, 89, 14, 91, 20, 65, 77, 84, 96, 61, 59,
681 100, 60, 61, 103, 100, 29, 28, 98, 54, 86, 56, 32, 35};
683 int n6[88] = {10, 11, 16, 17, 22, 23, 28, 29, 32, 1, 1, 30, 2, 85, 38,
684 7, 7, 36, 8, 87, 44, 13, 13, 42, 14, 89, 50, 19, 19, 48,
685 20, 91, 90, 46, 58, 4, 76, 3, 62, 10, 78, 9, 66, 16, 80,
686 15, 70, 22, 82, 21, 81, 68, 33, 0, 39, 6, 45, 12, 51, 18,
687 47, 59, 5, 63, 11, 67, 17, 71, 23, 69, 76, 96, 76, 75, 100,
688 75, 58, 59, 58, 59, 75, 74, 85, 93, 85, 55, 1, 33};
690 int n7[88] = {9, 10, 15, 16, 21, 22, 27, 28, 31, 32, 2, 34, 85,
691 86, 37, 38, 8, 40, 87, 88, 43, 44, 14, 46, 89, 90,
692 49, 50, 20, 52, 91, 92, 92, 52, 60, 58, 77, 76, 64,
693 62, 79, 78, 68, 66, 81, 80, 72, 70, 83, 82, 83, 72,
694 35, 33, 41, 39, 47, 45, 53, 51, 53, 61, 59, 65, 63,
695 69, 67, 73, 71, 73, 96, 97, 3, 100, 101, 29, 103, 100,
696 4, 5, 100, 103, 86, 86, 30, 35, 0, 94};
698 if(i == 0) {
return n0[j]; }
724 std::vector<MHexahedron *> &dwarfs88)
726 std::vector<MVertex *> v(105, (
MVertex *)
nullptr);
732 v[102] =
element->getVertex(4);
737 v[101] =
element->getVertex(6);
744 v[104] =
element->getVertex(13);
748 auto fIter = faceVertices.find(
MFace(v[29], v[27], v[102]));
749 if(fIter != faceVertices.end())
750 v[25] = fIter->second[0];
752 element->pnt(0.0, -0.666667, 0.471405 / 1.414213, point);
753 v[25] =
new MVertex(point.
x(), point.
y(), point.
z(), gr);
755 faceVertices[
MFace(v[29], v[27], v[102])].push_back(v[25]);
758 fIter = faceVertices.find(
MFace(v[27], v[3], v[102]));
759 if(fIter != faceVertices.end())
760 v[95] = fIter->second[0];
762 element->pnt(0.666667, 0.0, 0.471405 / 1.414213, point);
763 v[95] =
new MVertex(point.
x(), point.
y(), point.
z(), gr);
765 faceVertices[
MFace(v[27], v[3], v[102])].push_back(v[95]);
768 fIter = faceVertices.find(
MFace(v[3], v[5], v[102]));
769 if(fIter != faceVertices.end())
770 v[1] = fIter->second[0];
772 element->pnt(0.0, 0.666667, 0.471405 / 1.414213, point);
773 v[1] =
new MVertex(point.
x(), point.
y(), point.
z(), gr);
775 faceVertices[
MFace(v[3], v[5], v[102])].push_back(v[1]);
778 fIter = faceVertices.find(
MFace(v[5], v[29], v[102]));
779 if(fIter != faceVertices.end())
780 v[99] = fIter->second[0];
782 element->pnt(-0.666667, 0.0, 0.471405 / 1.414213, point);
783 v[99] =
new MVertex(point.
x(), point.
y(), point.
z(), gr);
785 faceVertices[
MFace(v[5], v[29], v[102])].push_back(v[99]);
788 for(
int i = 0; i < 105; i++) {
792 v[i] =
new MVertex(point.
x(), point.
y(), point.
z(), gr);
799 for(
int i = 0; i < 88; i++) {
809 dwarfs88[i] =
new MHexahedron(v[index1], v[index2], v[index3], v[index4],
810 v[index5], v[index6], v[index7], v[index8]);