30 for(
int i = 0; i < 3; i++) {
35 for(
int i = 0; i < 9; i++) {
_pOrderEdge[i] = order; }
50 case(1):
return 0.5 * (1 + v);
51 case(2):
return -0.5 * (u + v);
52 case(3):
return 0.5 * (1 + u);
53 case(4):
return 0.5 * (1 + w);
54 case(5):
return 0.5 * (1 - w);
55 default:
throw std::runtime_error(
"j must be : 1<=j<=5");
60 std::vector<double> &vertexBasis,
61 std::vector<double> &edgeBasis,
62 std::vector<double> &faceBasis,
63 std::vector<double> &bubbleBasis)
67 double uc = 2 * u - 1;
68 double vc = 2 * v - 1;
77 vertexBasis[0] = lambda2 * lambda5;
78 vertexBasis[1] = lambda3 * lambda5;
79 vertexBasis[2] = lambda1 * lambda5;
80 vertexBasis[3] = lambda2 * lambda4;
81 vertexBasis[4] = lambda4 * lambda3;
82 vertexBasis[5] = lambda1 * lambda4;
84 std::vector<double> product(
_nedge);
85 product[0] = vertexBasis[0] * lambda3;
86 product[1] = vertexBasis[0] * lambda1;
87 product[2] = vertexBasis[0] * lambda4;
88 product[3] = vertexBasis[1] * lambda1;
89 product[4] = vertexBasis[1] * lambda4;
90 product[5] = vertexBasis[2] * lambda4;
91 product[6] = vertexBasis[3] * lambda3;
92 product[7] = vertexBasis[3] * lambda1;
93 product[8] = vertexBasis[4] * lambda1;
94 std::vector<double> substraction(5);
95 substraction[0] = lambda3 - lambda2;
96 substraction[1] = lambda1 - lambda2;
97 substraction[2] = lambda4 - lambda5;
98 substraction[3] = lambda1 - lambda3;
99 substraction[4] = lambda2 - lambda1;
100 std::vector<std::vector<double> > phi(5);
101 phi[0] = std::vector<double>(std::max(
107 phi[1] = std::vector<double>(std::max(
109 phi[2] = std::vector<double>(std::max(
116 phi[3] = std::vector<double>(std::max(
118 phi[4] = std::vector<double>(std::max(
121 for(
int i = 0; i < 5; i++) {
122 for(
unsigned int j = 0; j < phi[i].size(); j++) {
127 int indexEdgeBasis = 0;
128 for(
int iEdge = 0; iEdge <
_nedge; iEdge++) {
132 case(6): numPhi = 0;
break;
134 case(7): numPhi = 1;
break;
137 case(5): numPhi = 2;
break;
139 case(8): numPhi = 3;
break;
141 for(
int indexEdgeFunc = 0; indexEdgeFunc <
_pOrderEdge[iEdge] - 1;
143 edgeBasis[indexEdgeBasis] = product[iEdge] * phi[numPhi][indexEdgeFunc];
149 int indexFaceFunction = 0;
153 double lambdaProduct = 0;
158 lambdaProduct = product[0] * lambda1;
163 lambdaProduct = product[7] * lambda3;
168 lambdaProduct = product[0] * lambda4;
173 lambdaProduct = product[7] * lambda5;
178 lambdaProduct = product[8] * lambda5;
184 faceBasis[indexFaceFunction] =
185 lambdaProduct * phi[indexPhi1][n1] * phi[indexPhi2][n2];
193 faceBasis[indexFaceFunction] =
194 lambdaProduct * phi[indexPhi1][n1] * phi[indexPhi2][n2];
201 int indexBubbleBasis = 0;
202 double lambdaProductBubble = lambda1 * lambda2 * lambda3;
203 for(
int n1 = 0; n1 <
_pb1 - 2; n1++) {
204 for(
int n2 = 0; n2 <
_pb1 - 2 - n1; n2++) {
205 for(
int n3 = 2; n3 <=
_pb2; n3++) {
206 bubbleBasis[indexBubbleBasis] = lambdaProductBubble * phi[0][n1] *
215 double const &u,
double const &v,
double const &w,
216 std::vector<std::vector<double> > &gradientVertex,
217 std::vector<std::vector<double> > &gradientEdge,
218 std::vector<std::vector<double> > &gradientFace,
219 std::vector<std::vector<double> > &gradientBubble)
223 double uc = 2 * u - 1;
224 double vc = 2 * v - 1;
234 std::vector<double> dlambda1(3, 0);
235 std::vector<double> dlambda2(3, 0);
236 std::vector<double> dlambda3(3, 0);
237 std::vector<double> dlambda4(3, 0);
238 std::vector<double> dlambda5(3, 0);
245 for(
int i = 0; i < 3; i++) {
246 gradientVertex[0][i] = lambda5 * dlambda2[i] + dlambda5[i] * lambda2;
247 gradientVertex[1][i] = lambda5 * dlambda3[i] + dlambda5[i] * lambda3;
248 gradientVertex[2][i] = lambda5 * dlambda1[i] + dlambda5[i] * lambda1;
249 gradientVertex[3][i] = lambda2 * dlambda4[i] + dlambda2[i] * lambda4;
250 gradientVertex[4][i] = lambda4 * dlambda3[i] + dlambda4[i] * lambda3;
251 gradientVertex[5][i] = lambda1 * dlambda4[i] + dlambda1[i] * lambda4;
254 std::vector<double> substraction(5);
255 substraction[0] = lambda3 - lambda2;
256 substraction[1] = lambda1 - lambda2;
257 substraction[2] = lambda4 - lambda5;
258 substraction[3] = lambda1 - lambda3;
259 substraction[4] = lambda2 - lambda1;
260 std::vector<std::vector<double> > dsubstraction(
261 5, std::vector<double>(3, 0));
262 for(
int i = 0; i < 3; i++) {
263 dsubstraction[0][i] = dlambda3[i] - dlambda2[i];
264 dsubstraction[1][i] = dlambda1[i] - dlambda2[i];
265 dsubstraction[2][i] = dlambda4[i] - dlambda5[i];
266 dsubstraction[3][i] = dlambda1[i] - dlambda3[i];
267 dsubstraction[4][i] = dlambda2[i] - dlambda1[i];
269 std::vector<std::vector<double> > phi(5);
270 std::vector<std::vector<double> > dphi(5);
271 phi[0] = std::vector<double>(std::max(
277 phi[1] = std::vector<double>(std::max(
279 phi[2] = std::vector<double>(std::max(
286 phi[3] = std::vector<double>(std::max(
288 phi[4] = std::vector<double>(std::max(
291 dphi[0] = std::vector<double>(std::max(
297 dphi[1] = std::vector<double>(std::max(
299 dphi[2] = std::vector<double>(std::max(
306 dphi[3] = std::vector<double>(std::max(
308 dphi[4] = std::vector<double>(std::max(
311 for(
int i = 0; i < 5; i++) {
312 for(
unsigned int j = 0; j < phi[i].size(); j++) {
317 std::vector<double> product1(6);
318 product1[0] = lambda2 * lambda5;
319 product1[1] = lambda3 * lambda5;
320 product1[2] = lambda1 * lambda5;
321 product1[3] = lambda2 * lambda4;
322 product1[4] = lambda4 * lambda3;
323 product1[5] = lambda1 * lambda4;
324 std::vector<double> productEdgeTerm(
_nedge);
325 productEdgeTerm[0] = product1[0] * lambda3;
326 productEdgeTerm[1] = product1[0] * lambda1;
327 productEdgeTerm[2] = product1[0] * lambda4;
328 productEdgeTerm[3] = product1[1] * lambda1;
329 productEdgeTerm[4] = product1[1] * lambda4;
330 productEdgeTerm[5] = product1[2] * lambda4;
331 productEdgeTerm[6] = product1[3] * lambda3;
332 productEdgeTerm[7] = product1[3] * lambda1;
333 productEdgeTerm[8] = product1[4] * lambda1;
334 std::vector<std::vector<double> > dproductEdgeTerm(
_nedge,
335 std::vector<double>(3));
336 for(
int i = 0; i < 3; i++) {
337 dproductEdgeTerm[0][i] =
338 gradientVertex[0][i] * lambda3 + dlambda3[i] * product1[0];
339 dproductEdgeTerm[1][i] =
340 gradientVertex[0][i] * lambda1 + dlambda1[i] * product1[0];
341 dproductEdgeTerm[2][i] =
342 gradientVertex[0][i] * lambda4 + dlambda4[i] * product1[0];
343 dproductEdgeTerm[3][i] =
344 gradientVertex[1][i] * lambda1 + dlambda1[i] * product1[1];
345 dproductEdgeTerm[4][i] =
346 gradientVertex[1][i] * lambda4 + dlambda4[i] * product1[1];
347 dproductEdgeTerm[5][i] =
348 gradientVertex[2][i] * lambda4 + dlambda4[i] * product1[2];
349 dproductEdgeTerm[6][i] =
350 gradientVertex[3][i] * lambda3 + dlambda3[i] * product1[3];
351 dproductEdgeTerm[7][i] =
352 gradientVertex[3][i] * lambda1 + dlambda1[i] * product1[3];
353 dproductEdgeTerm[8][i] =
354 gradientVertex[4][i] * lambda1 + dlambda1[i] * product1[4];
358 int indexEdgeBasis = 0;
359 for(
int iEdge = 0; iEdge <
_nedge; iEdge++) {
363 case(6): numPhi = 0;
break;
365 case(7): numPhi = 1;
break;
368 case(5): numPhi = 2;
break;
370 case(8): numPhi = 3;
break;
373 for(
int indexEdgeFunc = 0; indexEdgeFunc <
_pOrderEdge[iEdge] - 1;
375 for(
int i = 0; i < 3; i++) {
376 gradientEdge[indexEdgeBasis][i] =
377 dproductEdgeTerm[iEdge][i] * phi[numPhi][indexEdgeFunc] +
378 dsubstraction[numPhi][i] * productEdgeTerm[iEdge] *
379 dphi[numPhi][indexEdgeFunc];
386 int indexFaceFunction = 0;
390 double productFaceTerm = 0;
391 std::vector<double> dproductFaceTerm(3, 0);
396 productFaceTerm = productEdgeTerm[0] * lambda1;
397 for(
int i = 0; i < 3; i++) {
398 dproductFaceTerm[i] =
399 dproductEdgeTerm[0][i] * lambda1 + productEdgeTerm[0] * dlambda1[i];
405 productFaceTerm = productEdgeTerm[7] * lambda3;
406 for(
int i = 0; i < 3; i++) {
407 dproductFaceTerm[i] =
408 dproductEdgeTerm[7][i] * lambda3 + productEdgeTerm[7] * dlambda3[i];
414 productFaceTerm = productEdgeTerm[0] * lambda4;
415 for(
int i = 0; i < 3; i++) {
416 dproductFaceTerm[i] =
417 dproductEdgeTerm[0][i] * lambda4 + productEdgeTerm[0] * dlambda4[i];
423 productFaceTerm = productEdgeTerm[7] * lambda5;
424 for(
int i = 0; i < 3; i++) {
425 dproductFaceTerm[i] =
426 dproductEdgeTerm[7][i] * lambda5 + productEdgeTerm[7] * dlambda5[i];
432 productFaceTerm = productEdgeTerm[8] * lambda5;
433 for(
int i = 0; i < 3; i++) {
434 dproductFaceTerm[i] =
435 dproductEdgeTerm[8][i] * lambda5 + productEdgeTerm[8] * dlambda5[i];
442 for(
int i = 0; i < 3; i++) {
443 gradientFace[indexFaceFunction][i] =
444 dproductFaceTerm[i] * phi[indexPhi1][n1] * phi[indexPhi2][n2] +
445 productFaceTerm * dsubstraction[indexPhi1][i] *
446 dphi[indexPhi1][n1] * phi[indexPhi2][n2] +
447 productFaceTerm * dsubstraction[indexPhi2][i] *
448 phi[indexPhi1][n1] * dphi[indexPhi2][n2];
457 for(
int i = 0; i < 3; i++) {
458 gradientFace[indexFaceFunction][i] =
459 dproductFaceTerm[i] * phi[indexPhi1][n1] * phi[indexPhi2][n2] +
460 productFaceTerm * dsubstraction[indexPhi1][i] *
461 dphi[indexPhi1][n1] * phi[indexPhi2][n2] +
462 productFaceTerm * dsubstraction[indexPhi2][i] *
463 phi[indexPhi1][n1] * dphi[indexPhi2][n2];
472 int indexBubbleBasis = 0;
473 double lambdaProductBubble = lambda1 * lambda2 * lambda3;
474 std::vector<double> dlambdaProductBubble(3);
475 for(
int i = 0; i < 3; i++) {
476 dlambdaProductBubble[i] = dlambda1[i] * lambda2 * lambda3 +
477 lambda1 * dlambda2[i] * lambda3 +
478 lambda1 * lambda2 * dlambda3[i];
481 for(
int n1 = 0; n1 <
_pb1 - 2; n1++) {
482 for(
int n2 = 0; n2 <
_pb1 - 2 - n1; n2++) {
483 for(
int n3 = 2; n3 <=
_pb2; n3++) {
484 gradientBubble[indexBubbleBasis][0] =
485 (dlambdaProductBubble[0] * phi[0][n1] * phi[4][n2] +
486 lambdaProductBubble * dsubstraction[0][0] * dphi[0][n1] *
488 lambdaProductBubble * dsubstraction[4][0] * phi[0][n1] *
492 gradientBubble[indexBubbleBasis][1] =
493 (dlambdaProductBubble[1] * phi[0][n1] * phi[4][n2] +
494 lambdaProductBubble * dsubstraction[0][1] * dphi[0][n1] *
496 lambdaProductBubble * dsubstraction[4][1] * phi[0][n1] *
500 gradientBubble[indexBubbleBasis][2] =
501 (dlambdaProductBubble[2] * phi[0][n1] * phi[4][n2] +
502 lambdaProductBubble * dsubstraction[0][2] * dphi[0][n1] *
504 lambdaProductBubble * dsubstraction[4][2] * phi[0][n1] *
508 phi[0][n1] * phi[4][n2];
517 int const &flagOrientation,
int const &edgeNumber,
518 std::vector<double> &edgeFunctions,
519 const std::vector<double> &eTablePositiveFlag,
520 const std::vector<double> &eTableNegativeFlag)
522 if(flagOrientation == -1) {
525 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
526 constant2 = constant2 - 1;
527 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
528 for(
int k = constant1; k <= constant2; k++) {
529 edgeFunctions[k] = eTableNegativeFlag[k];
535 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
536 constant2 = constant2 - 1;
537 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
538 for(
int k = constant1; k <= constant2; k++) {
539 edgeFunctions[k] = eTablePositiveFlag[k];
544 int const &flagOrientation,
int const &edgeNumber,
545 std::vector<std::vector<double> > &edgeFunctions,
546 const std::vector<std::vector<double> > &eTablePositiveFlag,
547 const std::vector<std::vector<double> > &eTableNegativeFlag)
549 if(flagOrientation == -1) {
552 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
553 constant2 = constant2 - 1;
554 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
555 for(
int k = constant1; k <= constant2; k++) {
556 edgeFunctions[k][0] = eTableNegativeFlag[k][0];
557 edgeFunctions[k][1] = eTableNegativeFlag[k][1];
558 edgeFunctions[k][2] = eTableNegativeFlag[k][2];
564 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
565 constant2 = constant2 - 1;
566 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
567 for(
int k = constant1; k <= constant2; k++) {
568 edgeFunctions[k][0] = eTablePositiveFlag[k][0];
569 edgeFunctions[k][1] = eTablePositiveFlag[k][1];
570 edgeFunctions[k][2] = eTablePositiveFlag[k][2];
576 std::vector<double> &edgeFunctions)
580 for(
int edgeNumber = 0; edgeNumber <
_nedge; edgeNumber++) {
583 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
584 constant2 = constant2 - 1;
585 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
586 for(
int k = constant1; k <= constant2; k++) {
587 if((k - constant1) % 2 != 0) {
588 edgeFunctions[k] = edgeFunctions[k] * (-1);
594 std::vector<std::vector<double> > &edgeFunctions)
598 for(
int edgeNumber = 0; edgeNumber <
_nedge; edgeNumber++) {
601 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] - 1; }
602 constant2 = constant2 - 1;
603 constant1 = constant2 -
_pOrderEdge[edgeNumber] + 2;
604 for(
int k = constant1; k <= constant2; k++) {
605 if((k - constant1) % 2 != 0) {
606 edgeFunctions[k][0] = edgeFunctions[k][0] * (-1);
607 edgeFunctions[k][1] = edgeFunctions[k][1] * (-1);
608 edgeFunctions[k][2] = edgeFunctions[k][2] * (-1);
615 double const &w,
int const &flag1,
616 int const &flag2,
int const &flag3,
617 int const &faceNumber,
618 std::vector<double> &faceBasis)
621 if(!(flag1 == 1 && flag2 == 1 && flag3 == 1)) {
623 for(
int i = 0; i < faceNumber; i++) {
631 if(flag1 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
632 if(flag2 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
633 faceBasis[iterator] =
634 faceBasis[iterator] * impactFlag1 * impactFlag2;
641 double uc = 2 * u - 1;
642 double vc = 2 * v - 1;
645 double lambdaProduct = 0;
654 lambdaProduct = lambda2 * lambda3 * lambda4 * lambda5;
655 var1 = lambda3 - lambda2;
656 var2 = lambda4 - lambda5;
664 lambdaProduct = lambda2 * lambda1 * lambda4 * lambda5;
665 var1 = lambda1 - lambda2;
666 var2 = lambda4 - lambda5;
673 lambdaProduct = lambda1 * lambda3 * lambda4 * lambda5;
674 var1 = lambda1 - lambda3;
675 var2 = lambda4 - lambda5;
691 if(flag2 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
692 if(flag1 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
693 faceBasis[iterator] =
694 lambdaProduct * phi1[it2] * phi2[it1] * impactFlag1 * impactFlag2;
702 int constant = faceNumber - 3;
703 if(!(flag1 == 0 && flag2 == 1)) {
705 double uc = 2 * u - 1;
706 double vc = 2 * v - 1;
712 for(
int i = 0; i < constant; i++) {
715 std::vector<double> lambda(3);
731 double product = lambda[0] * lambda[1] * lambda[2] * lambdai;
732 if(flag1 == 1 && flag2 == -1) {
733 double copy = lambda[0];
734 lambda[0] = lambda[1];
737 else if(flag1 == 0 && flag2 == -1) {
738 double copy = lambda[2];
739 lambda[2] = lambda[1];
742 else if(flag1 == 2 && flag2 == -1) {
743 double copy = lambda[2];
744 lambda[2] = lambda[0];
747 else if(flag1 == 1 && flag2 == 1) {
748 double copy = lambda[0];
749 lambda[0] = lambda[1];
750 lambda[1] = lambda[2];
753 else if(flag1 == 2 && flag2 == 1) {
754 double copy = lambda[0];
755 lambda[0] = lambda[2];
756 lambda[2] = lambda[1];
759 double subs1 = lambda[1] - lambda[0];
760 double subs2 = lambda[0] - lambda[2];
768 faceBasis[iterator] = product * phiSubs1 * phiSubs2[n2];
776 double const &u,
double const &v,
double const &w,
int const &flag1,
777 int const &flag2,
int const &flag3,
int const &faceNumber,
778 std::vector<std::vector<double> > &gradientFace, std::string typeFunction)
781 if(!(flag1 == 1 && flag2 == 1 && flag3 == 1)) {
783 for(
int i = 0; i < faceNumber; i++) {
791 if(flag1 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
792 if(flag2 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
793 gradientFace[iterator][0] =
794 gradientFace[iterator][0] * impactFlag1 * impactFlag2;
795 gradientFace[iterator][1] =
796 gradientFace[iterator][1] * impactFlag1 * impactFlag2;
797 gradientFace[iterator][2] =
798 gradientFace[iterator][2] * impactFlag1 * impactFlag2;
805 double uc = 2 * u - 1;
806 double vc = 2 * v - 1;
809 double lambdaProduct = 0;
810 std::vector<double> dlambdaProduct(3, 0);
812 std::vector<double> dvar1(3, 0);
814 std::vector<double> dvar2(3, 0);
821 double lambda45 = lambda4 * lambda5;
822 double lambda23 = lambda2 * lambda3;
823 lambdaProduct = lambda23 * lambda45;
824 var1 = lambda3 - lambda2;
825 var2 = lambda4 - lambda5;
826 dlambdaProduct[0] = -lambda45 * var1;
827 dlambdaProduct[1] = -lambda45 * lambda3;
828 dlambdaProduct[2] = -0.5 * lambda23 * var2;
839 var1 = lambda1 - lambda2;
840 var2 = lambda4 - lambda5;
841 double lambda45 = lambda4 * lambda5;
842 double lambda21 = lambda2 * lambda1;
843 lambdaProduct = lambda21 * lambda45;
844 dlambdaProduct[0] = -lambda45 * lambda1;
845 dlambdaProduct[1] = lambda45 * (lambda2 - lambda1);
846 dlambdaProduct[2] = -0.5 * lambda21 * var2;
857 var1 = lambda1 - lambda3;
858 var2 = lambda4 - lambda5;
859 double lambda45 = lambda4 * lambda5;
860 double lambda13 = lambda1 * lambda3;
861 lambdaProduct = lambda13 * lambda45;
862 dlambdaProduct[0] = lambda45 * lambda1;
863 dlambdaProduct[1] = lambda45 * lambda3;
864 dlambdaProduct[2] = -0.5 * lambda13 * var2;
888 if(flag2 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
889 if(flag1 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
890 for(
int i = 0; i < 3; i++) {
891 gradientFace[iterator][i] =
892 impactFlag1 * impactFlag2 *
893 (dlambdaProduct[i] * phi1[it2] * phi2[it1] +
894 lambdaProduct * dvar1[i] * dphi1[it2] * phi2[it1] +
895 dvar2[i] * lambdaProduct * phi1[it2] * dphi2[it1]);
904 int constant = faceNumber - 3;
905 if(!(flag1 == 0 && flag2 == 1)) {
907 double uc = 2 * u - 1;
908 double vc = 2 * v - 1;
914 for(
int i = 0; i < constant; i++) {
917 std::vector<double> lambda(3);
918 std::vector<std::vector<double> > dlambda(3, std::vector<double>(3, 0));
920 std::vector<double> dlambdai(3, 0);
945 if(flag1 == 1 && flag2 == -1) {
946 double copy = lambda[0];
947 lambda[0] = lambda[1];
949 std::vector<double> dcopy = dlambda[0];
950 dlambda[0] = dlambda[1];
953 else if(flag1 == 0 && flag2 == -1) {
954 double copy = lambda[2];
955 lambda[2] = lambda[1];
957 std::vector<double> dcopy = dlambda[2];
958 dlambda[2] = dlambda[1];
961 else if(flag1 == 2 && flag2 == -1) {
962 double copy = lambda[2];
963 lambda[2] = lambda[0];
965 std::vector<double> dcopy = dlambda[2];
966 dlambda[2] = dlambda[0];
969 else if(flag1 == 1 && flag2 == 1) {
970 double copy = lambda[0];
971 lambda[0] = lambda[1];
972 lambda[1] = lambda[2];
974 std::vector<double> dcopy = dlambda[0];
975 dlambda[0] = dlambda[1];
976 dlambda[1] = dlambda[2];
979 else if(flag1 == 2 && flag2 == 1) {
980 double copy = lambda[0];
981 lambda[0] = lambda[2];
982 lambda[2] = lambda[1];
984 std::vector<double> dcopy = dlambda[0];
985 dlambda[0] = dlambda[2];
986 dlambda[2] = dlambda[1];
989 double subs1 = lambda[1] - lambda[0];
990 double subs2 = lambda[0] - lambda[2];
991 std::vector<double> dsubs1(3, 0);
992 std::vector<double> dsubs2(3, 0);
993 for(
int i = 0; i < 3; i++) {
994 dsubs1[i] = dlambda[1][i] - dlambda[0][i];
995 dsubs2[i] = dlambda[0][i] - dlambda[2][i];
997 double product = lambda[0] * lambda[1] * lambda[2] * lambdai;
998 std::vector<double> dproduct(3, 0);
999 for(
int i = 0; i < 3; i++) {
1000 dproduct[i] = dlambda[0][i] * lambda[1] * lambda[2] * lambdai +
1001 lambda[0] * dlambda[1][i] * lambda[2] * lambdai +
1002 lambda[0] * lambda[1] * dlambda[2][i] * lambdai +
1003 lambda[0] * lambda[1] * lambda[2] * dlambdai[i];
1015 for(
int i = 0; i < 3; i++) {
1016 gradientFace[iterator][i] =
1017 dproduct[i] * phiSubs1 * phiSubs2[n2] +
1018 product * dphiSubs1 * dsubs1[i] * phiSubs2[n2] +
1019 product * phiSubs1 * dsubs2[i] * dphiSubs2[n2];
1030 int const &flag1,
int const &flag2,
int const &flag3,
int const &faceNumber,
1031 const std::vector<double> &quadFaceFunctionsAllOrientation,
1032 const std::vector<double> &triFaceFunctionsAllOrientation,
1033 std::vector<double> &fTableCopy)
1035 if(faceNumber < 3) {
1037 for(
int i = 0; i < faceNumber; i++) {
1040 int numFaceFunctions =
1044 int offset2 = iterator + numFaceFunctions;
1045 for(
int i = iterator; i < offset2; i++) {
1046 fTableCopy[i] = quadFaceFunctionsAllOrientation[i + offset];
1051 int numface = faceNumber - 3;
1052 for(
int i = 0; i < numface; i++) {
1055 int numFaceFunctions =
1059 int offset2 = iterator + numFaceFunctions;
1060 for(
int i = iterator; i < offset2; i++) {
1061 fTableCopy[i] = triFaceFunctionsAllOrientation[i + offset];
1067 int const &flag1,
int const &flag2,
int const &flag3,
int const &faceNumber,
1068 const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
1069 const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
1070 std::vector<std::vector<double> > &fTableCopy)
1072 if(faceNumber < 3) {
1074 for(
int i = 0; i < faceNumber; i++) {
1077 int numFaceFunctions =
1081 int offset2 = iterator + numFaceFunctions;
1082 for(
int i = iterator; i < offset2; i++) {
1083 fTableCopy[i][0] = quadFaceFunctionsAllOrientation[i + offset][0];
1084 fTableCopy[i][1] = quadFaceFunctionsAllOrientation[i + offset][1];
1085 fTableCopy[i][2] = quadFaceFunctionsAllOrientation[i + offset][2];
1090 int numface = faceNumber - 3;
1091 for(
int i = 0; i < numface; i++) {
1094 int numFaceFunctions =
1098 int offset2 = iterator + numFaceFunctions;
1099 for(
int i = iterator; i < offset2; i++) {
1100 fTableCopy[i][0] = triFaceFunctionsAllOrientation[i + offset][0];
1101 fTableCopy[i][1] = triFaceFunctionsAllOrientation[i + offset][1];
1102 fTableCopy[i][2] = triFaceFunctionsAllOrientation[i + offset][2];
1108 std::vector<int> &orderInfo)
1110 for(
int i = 0; i < 6; i++) {
1111 functionTypeInfo[i] = 0;
1115 for(
int numEdge = 0; numEdge < 9; numEdge++) {
1117 functionTypeInfo[it] = 1;
1126 functionTypeInfo[it] = 2;
1127 orderInfo[it] = std::max(n1, n2);
1134 for(
int n2 = 1; n2 <=
_pOrderTriFace[iFace - 3] - 1 - n1; n2++) {
1135 functionTypeInfo[it] = 2;
1136 orderInfo[it] = n1 + n2 + 1;
1142 for(
int n1 = 1; n1 <
_pb1 - 1; n1++) {
1143 for(
int n2 = 1; n2 <=
_pb1 - 1 - n1; n2++) {
1144 for(
int n3 = 2; n3 <=
_pb2; n3++) {
1145 functionTypeInfo[it] = 3;
1146 orderInfo[it] = std::max(n1 + n2 + 1, n3);