268 typename ::FiniteElement<dim, spacedim>::InternalDataBase> &data_ptr)
272 data.update_each = requires_update_flags(update_flags);
275 const unsigned int degree(this->degree - 1);
281 const unsigned int n_line_dofs = this->n_dofs_per_line() * lines_per_cell;
283 const unsigned int n_face_dofs = this->n_dofs_per_quad(0) * faces_per_cell;
285 const unsigned int n_q_points = p_list.size();
290 data.sigma_imj_values.resize(
292 std::vector<std::vector<double>>(vertices_per_cell,
293 std::vector<double>(vertices_per_cell)));
295 data.sigma_imj_grads.resize(vertices_per_cell,
296 std::vector<std::vector<double>>(
297 vertices_per_cell, std::vector<double>(dim)));
301 data.shape_values.resize(this->n_dofs_per_cell(),
305 data.shape_grads.resize(this->n_dofs_per_cell(),
310 data.shape_hessians.resize(this->n_dofs_per_cell(),
316 std::vector<std::vector<double>> sigma(n_q_points,
317 std::vector<double>(lines_per_cell));
318 std::vector<std::vector<double>> lambda(n_q_points,
319 std::vector<double>(lines_per_cell));
325 for (
unsigned int q = 0; q < n_q_points; ++q)
327 sigma[q][0] = (1.0 - p_list[q][0]) + (1.0 - p_list[q][1]);
328 sigma[q][1] = p_list[q][0] + (1.0 - p_list[q][1]);
329 sigma[q][2] = (1.0 - p_list[q][0]) + p_list[q][1];
330 sigma[q][3] = p_list[q][0] + p_list[q][1];
332 lambda[q][0] = (1.0 - p_list[q][0]) * (1.0 - p_list[q][1]);
333 lambda[q][1] = p_list[q][0] * (1.0 - p_list[q][1]);
334 lambda[q][2] = (1.0 - p_list[q][0]) * p_list[q][1];
335 lambda[q][3] = p_list[q][0] * p_list[q][1];
336 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
337 for (
unsigned int j = 0; j < vertices_per_cell; ++j)
338 data.sigma_imj_values[q][i][j] = sigma[q][i] - sigma[q][j];
349 {-1, -1}, {1, -1}, {-1, 1}, {1, 1}};
350 int sigma_imj_sign[vertices_per_cell][vertices_per_cell];
351 unsigned int sigma_imj_component[vertices_per_cell]
354 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
355 for (
unsigned int j = 0; j < vertices_per_cell; ++j)
362 sigma_imj_sign[i][j] = (i < j) ? -1 : 1;
363 sigma_imj_sign[i][j] = (i == j) ? 0 : sigma_imj_sign[i][j];
367 sigma_imj_component[i][j] = 0;
368 for (
unsigned int d = 0; d < dim; ++d)
371 sigma_comp_signs[i][d] - sigma_comp_signs[j][d];
376 sigma_imj_component[i][j] = d;
383 data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
384 2.0 * sigma_imj_sign[i][j];
391 data.edge_sigma_values.resize(lines_per_cell,
392 std::vector<double>(n_q_points));
393 data.edge_sigma_grads.resize(lines_per_cell,
394 std::vector<double>(dim));
403 data.edge_lambda_values.resize(lines_per_cell,
404 std::vector<double>(n_q_points));
406 data.edge_lambda_grads_2d.resize(lines_per_cell,
407 std::vector<double>(dim));
409 for (
unsigned int m = 0; m < lines_per_cell; ++m)
414 const unsigned int e1(
416 const unsigned int e2(
418 for (
unsigned int q = 0; q < n_q_points; ++q)
420 data.edge_sigma_values[m][q] =
421 data.sigma_imj_values[q][e2][e1];
422 data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
425 data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
428 data.edge_lambda_grads_2d[0] = {-1.0, 0.0};
429 data.edge_lambda_grads_2d[1] = {1.0, 0.0};
430 data.edge_lambda_grads_2d[2] = {0.0, -1.0};
431 data.edge_lambda_grads_2d[3] = {0.0, 1.0};
497 const unsigned int cell_type1_offset = n_line_dofs;
504 const unsigned int cell_type2_offset =
505 cell_type1_offset + degree * degree;
513 const unsigned int cell_type3_offset1 =
514 cell_type2_offset + degree * degree;
515 const unsigned int cell_type3_offset2 = cell_type3_offset1 + degree;
520 std::vector<Point<dim>> cell_points(n_q_points);
521 for (
unsigned int q = 0; q < n_q_points; ++q)
522 for (
unsigned int d = 0; d < dim; ++d)
523 cell_points[q][d] = 2.0 * p_list[q][d] - 1.0;
526 for (
unsigned int q = 0; q < n_q_points; ++q)
538 const unsigned int poly_length =
543 std::vector<std::vector<double>> polyx(
544 degree, std::vector<double>(poly_length));
545 std::vector<std::vector<double>> polyy(
546 degree, std::vector<double>(poly_length));
547 for (
unsigned int i = 0; i < degree; ++i)
552 IntegratedLegendrePolynomials[i + 2].value(
553 cell_points[q][0], polyx[i]);
554 IntegratedLegendrePolynomials[i + 2].value(
555 cell_points[q][1], polyy[i]);
560 for (
unsigned int j = 0; j < degree; ++j)
562 const unsigned int shift_j(j * degree);
563 for (
unsigned int i = 0; i < degree; ++i)
565 const unsigned int shift_ij(i + shift_j);
568 const unsigned int dof_index1(cell_type1_offset +
570 data.shape_values[dof_index1][q][0] =
571 2.0 * polyx[i][1] * polyy[j][0];
572 data.shape_values[dof_index1][q][1] =
573 2.0 * polyx[i][0] * polyy[j][1];
576 const unsigned int dof_index2(cell_type2_offset +
578 data.shape_values[dof_index2][q][0] =
579 data.shape_values[dof_index1][q][0];
580 data.shape_values[dof_index2][q][1] =
581 -1.0 *
data.shape_values[dof_index1][q][1];
584 const unsigned int dof_index3_1(cell_type3_offset1 +
586 data.shape_values[dof_index3_1][q][0] = polyy[j][0];
587 data.shape_values[dof_index3_1][q][1] = 0.0;
589 const unsigned int dof_index3_2(cell_type3_offset2 +
591 data.shape_values[dof_index3_2][q][0] = 0.0;
592 data.shape_values[dof_index3_2][q][1] = polyx[j][0];
597 for (
unsigned int j = 0; j < degree; ++j)
599 const unsigned int shift_j(j * degree);
600 for (
unsigned int i = 0; i < degree; ++i)
602 const unsigned int shift_ij(i + shift_j);
605 const unsigned int dof_index1(cell_type1_offset +
607 data.shape_grads[dof_index1][q][0][0] =
608 4.0 * polyx[i][2] * polyy[j][0];
609 data.shape_grads[dof_index1][q][0][1] =
610 4.0 * polyx[i][1] * polyy[j][1];
611 data.shape_grads[dof_index1][q][1][0] =
612 data.shape_grads[dof_index1][q][0][1];
613 data.shape_grads[dof_index1][q][1][1] =
614 4.0 * polyx[i][0] * polyy[j][2];
617 const unsigned int dof_index2(cell_type2_offset +
619 data.shape_grads[dof_index2][q][0][0] =
620 data.shape_grads[dof_index1][q][0][0];
621 data.shape_grads[dof_index2][q][0][1] =
622 data.shape_grads[dof_index1][q][0][1];
623 data.shape_grads[dof_index2][q][1][0] =
624 -1.0 *
data.shape_grads[dof_index1][q][1][0];
625 data.shape_grads[dof_index2][q][1][1] =
626 -1.0 *
data.shape_grads[dof_index1][q][1][1];
629 const unsigned int dof_index3_1(cell_type3_offset1 +
631 data.shape_grads[dof_index3_1][q][0][0] = 0.0;
632 data.shape_grads[dof_index3_1][q][0][1] =
634 data.shape_grads[dof_index3_1][q][1][0] = 0.0;
635 data.shape_grads[dof_index3_1][q][1][1] = 0.0;
637 const unsigned int dof_index3_2(cell_type3_offset2 +
639 data.shape_grads[dof_index3_2][q][0][0] = 0.0;
640 data.shape_grads[dof_index3_2][q][0][1] = 0.0;
641 data.shape_grads[dof_index3_2][q][1][0] =
643 data.shape_grads[dof_index3_2][q][1][1] = 0.0;
648 for (
unsigned int j = 0; j < degree; ++j)
650 const unsigned int shift_j(j * degree);
651 for (
unsigned int i = 0; i < degree; ++i)
653 const unsigned int shift_ij(i + shift_j);
656 const unsigned int dof_index1(cell_type1_offset +
658 data.shape_hessians[dof_index1][q][0][0][0] =
659 8.0 * polyx[i][3] * polyy[j][0];
660 data.shape_hessians[dof_index1][q][1][0][0] =
661 8.0 * polyx[i][2] * polyy[j][1];
663 data.shape_hessians[dof_index1][q][0][1][0] =
664 data.shape_hessians[dof_index1][q][1][0][0];
665 data.shape_hessians[dof_index1][q][1][1][0] =
666 8.0 * polyx[i][1] * polyy[j][2];
668 data.shape_hessians[dof_index1][q][0][0][1] =
669 data.shape_hessians[dof_index1][q][1][0][0];
670 data.shape_hessians[dof_index1][q][1][0][1] =
671 data.shape_hessians[dof_index1][q][1][1][0];
673 data.shape_hessians[dof_index1][q][0][1][1] =
674 data.shape_hessians[dof_index1][q][1][1][0];
675 data.shape_hessians[dof_index1][q][1][1][1] =
676 8.0 * polyx[i][0] * polyy[j][3];
681 const unsigned int dof_index2(cell_type2_offset +
683 for (
unsigned int d = 0; d < dim; ++d)
685 data.shape_hessians[dof_index2][q][0][0][d] =
686 data.shape_hessians[dof_index1][q][0][0][d];
687 data.shape_hessians[dof_index2][q][0][1][d] =
688 data.shape_hessians[dof_index1][q][0][1][d];
689 data.shape_hessians[dof_index2][q][1][0][d] =
691 data.shape_hessians[dof_index1][q][1][0][d];
692 data.shape_hessians[dof_index2][q][1][1][d] =
694 data.shape_hessians[dof_index1][q][1][1][d];
698 const unsigned int dof_index3_1(cell_type3_offset1 +
700 data.shape_hessians[dof_index3_1][q][0][0][0] = 0.0;
701 data.shape_hessians[dof_index3_1][q][0][0][1] = 0.0;
702 data.shape_hessians[dof_index3_1][q][0][1][0] = 0.0;
703 data.shape_hessians[dof_index3_1][q][0][1][1] =
705 data.shape_hessians[dof_index3_1][q][1][0][0] = 0.0;
706 data.shape_hessians[dof_index3_1][q][1][0][1] = 0.0;
707 data.shape_hessians[dof_index3_1][q][1][1][0] = 0.0;
708 data.shape_hessians[dof_index3_1][q][1][1][1] = 0.0;
710 const unsigned int dof_index3_2(cell_type3_offset2 +
712 data.shape_hessians[dof_index3_2][q][0][0][0] = 0.0;
713 data.shape_hessians[dof_index3_2][q][0][0][1] = 0.0;
714 data.shape_hessians[dof_index3_2][q][0][1][0] = 0.0;
715 data.shape_hessians[dof_index3_2][q][0][1][1] = 0.0;
716 data.shape_hessians[dof_index3_2][q][1][0][0] =
718 data.shape_hessians[dof_index3_2][q][1][0][1] = 0.0;
719 data.shape_hessians[dof_index3_2][q][1][1][0] = 0.0;
720 data.shape_hessians[dof_index3_2][q][1][1][1] = 0.0;
730 for (
unsigned int q = 0; q < n_q_points; ++q)
732 sigma[q][0] = (1.0 - p_list[q][0]) + (1.0 - p_list[q][1]) +
735 p_list[q][0] + (1.0 - p_list[q][1]) + (1 - p_list[q][2]);
737 (1.0 - p_list[q][0]) + p_list[q][1] + (1 - p_list[q][2]);
738 sigma[q][3] = p_list[q][0] + p_list[q][1] + (1 - p_list[q][2]);
740 (1.0 - p_list[q][0]) + (1.0 - p_list[q][1]) + p_list[q][2];
741 sigma[q][5] = p_list[q][0] + (1.0 - p_list[q][1]) + p_list[q][2];
742 sigma[q][6] = (1.0 - p_list[q][0]) + p_list[q][1] + p_list[q][2];
743 sigma[q][7] = p_list[q][0] + p_list[q][1] + p_list[q][2];
745 lambda[q][0] = (1.0 - p_list[q][0]) * (1.0 - p_list[q][1]) *
746 (1.0 - p_list[q][2]);
748 p_list[q][0] * (1.0 - p_list[q][1]) * (1.0 - p_list[q][2]);
750 (1.0 - p_list[q][0]) * p_list[q][1] * (1.0 - p_list[q][2]);
751 lambda[q][3] = p_list[q][0] * p_list[q][1] * (1.0 - p_list[q][2]);
753 (1.0 - p_list[q][0]) * (1.0 - p_list[q][1]) * p_list[q][2];
754 lambda[q][5] = p_list[q][0] * (1.0 - p_list[q][1]) * p_list[q][2];
755 lambda[q][6] = (1.0 - p_list[q][0]) * p_list[q][1] * p_list[q][2];
756 lambda[q][7] = p_list[q][0] * p_list[q][1] * p_list[q][2];
760 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
761 for (
unsigned int j = 0; j < vertices_per_cell; ++j)
762 data.sigma_imj_values[q][i][j] = sigma[q][i] - sigma[q][j];
793 int sigma_imj_sign[vertices_per_cell][vertices_per_cell];
794 unsigned int sigma_imj_component[vertices_per_cell]
797 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
798 for (
unsigned int j = 0; j < vertices_per_cell; ++j)
805 sigma_imj_sign[i][j] = (i < j) ? -1 : 1;
806 sigma_imj_sign[i][j] = (i == j) ? 0 : sigma_imj_sign[i][j];
810 sigma_imj_component[i][j] = 0;
811 for (
unsigned int d = 0; d < dim; ++d)
814 sigma_comp_signs[i][d] - sigma_comp_signs[j][d];
819 sigma_imj_component[i][j] = d;
826 data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
827 2.0 * sigma_imj_sign[i][j];
834 data.edge_sigma_values.resize(lines_per_cell,
835 std::vector<double>(n_q_points));
836 data.edge_lambda_values.resize(lines_per_cell,
837 std::vector<double>(n_q_points));
838 data.edge_sigma_grads.resize(lines_per_cell,
839 std::vector<double>(dim));
840 data.edge_lambda_grads_3d.resize(
842 std::vector<std::vector<double>>(n_q_points,
843 std::vector<double>(dim)));
844 data.edge_lambda_gradgrads_3d.resize(
846 std::vector<std::vector<double>>(dim, std::vector<double>(dim)));
851 1, 1, 0, 0, 1, 1, 0, 0, 2, 2, 2, 2};
853 for (
unsigned int m = 0; m < lines_per_cell; ++m)
858 const unsigned int e1(
860 const unsigned int e2(
863 for (
unsigned int q = 0; q < n_q_points; ++q)
865 data.edge_sigma_values[m][q] =
866 data.sigma_imj_values[q][e2][e1];
867 data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
870 data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
874 for (
unsigned int q = 0; q < n_q_points; ++q)
876 double x(p_list[q][0]);
877 double y(p_list[q][1]);
878 double z(p_list[q][2]);
879 data.edge_lambda_grads_3d[0][q] = {z - 1.0, 0.0, x - 1.0};
880 data.edge_lambda_grads_3d[1][q] = {1.0 - z, 0.0, -x};
881 data.edge_lambda_grads_3d[2][q] = {0.0, z - 1.0, y - 1.0};
882 data.edge_lambda_grads_3d[3][q] = {0.0, 1.0 - z, -y};
883 data.edge_lambda_grads_3d[4][q] = {-z, 0.0, 1.0 - x};
884 data.edge_lambda_grads_3d[5][q] = {z, 0.0, x};
885 data.edge_lambda_grads_3d[6][q] = {0.0, -z, 1.0 - y};
886 data.edge_lambda_grads_3d[7][q] = {0.0, z, y};
887 data.edge_lambda_grads_3d[8][q] = {y - 1.0, x - 1.0, 0.0};
888 data.edge_lambda_grads_3d[9][q] = {1.0 - y, -x, 0.0};
889 data.edge_lambda_grads_3d[10][q] = {-y, 1.0 - x, 0.0};
890 data.edge_lambda_grads_3d[11][q] = {y, x, 0.0};
895 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1};
914 for (
unsigned int m = 0; m < lines_per_cell; ++m)
916 data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][0]]
917 [edge_lambda_directions[m][1]] =
919 data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][1]]
920 [edge_lambda_directions[m][0]] =
929 data.face_lambda_values.resize(faces_per_cell,
930 std::vector<double>(n_q_points));
931 data.face_lambda_grads.resize(faces_per_cell,
932 std::vector<double>(dim));
935 for (
unsigned int q = 0; q < n_q_points; ++q)
937 double x(p_list[q][0]);
938 double y(p_list[q][1]);
939 double z(p_list[q][2]);
940 data.face_lambda_values[0][q] = 1.0 - x;
941 data.face_lambda_values[1][q] = x;
942 data.face_lambda_values[2][q] = 1.0 - y;
943 data.face_lambda_values[3][q] = y;
944 data.face_lambda_values[4][q] = 1.0 - z;
945 data.face_lambda_values[5][q] = z;
949 data.face_lambda_grads[0] = {-1.0, 0.0, 0.0};
950 data.face_lambda_grads[1] = {1.0, 0.0, 0.0};
951 data.face_lambda_grads[2] = {0.0, -1.0, 0.0};
952 data.face_lambda_grads[3] = {0.0, 1.0, 0.0};
953 data.face_lambda_grads[4] = {0.0, 0.0, -1.0};
954 data.face_lambda_grads[5] = {0.0, 0.0, 1.0};
967 const unsigned int cell_type1_offset(n_line_dofs + n_face_dofs);
979 const unsigned int cell_type2_offset1(cell_type1_offset +
980 degree * degree * degree);
981 const unsigned int cell_type2_offset2(cell_type2_offset1 +
982 degree * degree * degree);
992 const unsigned int cell_type3_offset1(cell_type2_offset2 +
993 degree * degree * degree);
994 const unsigned int cell_type3_offset2(cell_type3_offset1 +
996 const unsigned int cell_type3_offset3(cell_type3_offset2 +
1000 std::vector<Point<dim>> cell_points(n_q_points);
1001 for (
unsigned int q = 0; q < n_q_points; ++q)
1003 for (
unsigned int d = 0; d < dim; ++d)
1005 cell_points[q][d] = 2.0 * p_list[q][d] - 1.0;
1013 const unsigned int poly_length =
1019 for (
unsigned int q = 0; q < n_q_points; ++q)
1027 std::vector<std::vector<double>> polyx(
1028 degree, std::vector<double>(poly_length));
1029 std::vector<std::vector<double>> polyy(
1030 degree, std::vector<double>(poly_length));
1031 std::vector<std::vector<double>> polyz(
1032 degree, std::vector<double>(poly_length));
1033 for (
unsigned int i = 0; i < degree; ++i)
1036 IntegratedLegendrePolynomials[i + 2].value(
1037 cell_points[q][0], polyx[i]);
1038 IntegratedLegendrePolynomials[i + 2].value(
1039 cell_points[q][1], polyy[i]);
1040 IntegratedLegendrePolynomials[i + 2].value(
1041 cell_points[q][2], polyz[i]);
1046 for (
unsigned int k = 0; k < degree; ++k)
1048 const unsigned int shift_k(k * degree * degree);
1049 const unsigned int shift_j(
1052 for (
unsigned int j = 0; j < degree; ++j)
1054 const unsigned int shift_jk(j * degree + shift_k);
1055 for (
unsigned int i = 0; i < degree; ++i)
1057 const unsigned int shift_ijk(shift_jk + i);
1060 const unsigned int dof_index1(
1061 cell_type1_offset + shift_ijk);
1063 data.shape_values[dof_index1][q][0] =
1064 2.0 * polyx[i][1] * polyy[j][0] *
1066 data.shape_values[dof_index1][q][1] =
1067 2.0 * polyx[i][0] * polyy[j][1] *
1069 data.shape_values[dof_index1][q][2] =
1070 2.0 * polyx[i][0] * polyy[j][0] *
1074 const unsigned int dof_index2_1(
1075 cell_type2_offset1 + shift_ijk);
1076 const unsigned int dof_index2_2(
1077 cell_type2_offset2 + shift_ijk);
1079 data.shape_values[dof_index2_1][q][0] =
1080 data.shape_values[dof_index1][q][0];
1081 data.shape_values[dof_index2_1][q][1] =
1082 -1.0 *
data.shape_values[dof_index1][q][1];
1083 data.shape_values[dof_index2_1][q][2] =
1084 data.shape_values[dof_index1][q][2];
1086 data.shape_values[dof_index2_2][q][0] =
1087 data.shape_values[dof_index1][q][0];
1088 data.shape_values[dof_index2_2][q][1] =
1089 -1.0 *
data.shape_values[dof_index1][q][1];
1090 data.shape_values[dof_index2_2][q][2] =
1091 -1.0 *
data.shape_values[dof_index1][q][2];
1095 const unsigned int shift_ij(
1098 const unsigned int dof_index3_1(
1099 cell_type3_offset1 + shift_ij);
1100 const unsigned int dof_index3_2(
1101 cell_type3_offset2 + shift_ij);
1102 const unsigned int dof_index3_3(
1103 cell_type3_offset3 + shift_ij);
1105 data.shape_values[dof_index3_1][q][0] =
1106 polyy[j][0] * polyz[k][0];
1107 data.shape_values[dof_index3_1][q][1] = 0.0;
1108 data.shape_values[dof_index3_1][q][2] = 0.0;
1110 data.shape_values[dof_index3_2][q][0] = 0.0;
1111 data.shape_values[dof_index3_2][q][1] =
1112 polyx[j][0] * polyz[k][0];
1113 data.shape_values[dof_index3_2][q][2] = 0.0;
1115 data.shape_values[dof_index3_3][q][0] = 0.0;
1116 data.shape_values[dof_index3_3][q][1] = 0.0;
1117 data.shape_values[dof_index3_3][q][2] =
1118 polyx[j][0] * polyy[k][0];
1124 for (
unsigned int k = 0; k < degree; ++k)
1126 const unsigned int shift_k(k * degree * degree);
1127 const unsigned int shift_j(
1130 for (
unsigned int j = 0; j < degree; ++j)
1132 const unsigned int shift_jk(j * degree + shift_k);
1133 for (
unsigned int i = 0; i < degree; ++i)
1135 const unsigned int shift_ijk(shift_jk + i);
1138 const unsigned int dof_index1(
1139 cell_type1_offset + shift_ijk);
1141 data.shape_grads[dof_index1][q][0][0] =
1142 4.0 * polyx[i][2] * polyy[j][0] *
1144 data.shape_grads[dof_index1][q][0][1] =
1145 4.0 * polyx[i][1] * polyy[j][1] *
1147 data.shape_grads[dof_index1][q][0][2] =
1148 4.0 * polyx[i][1] * polyy[j][0] *
1151 data.shape_grads[dof_index1][q][1][0] =
1152 data.shape_grads[dof_index1][q][0][1];
1153 data.shape_grads[dof_index1][q][1][1] =
1154 4.0 * polyx[i][0] * polyy[j][2] *
1156 data.shape_grads[dof_index1][q][1][2] =
1157 4.0 * polyx[i][0] * polyy[j][1] *
1160 data.shape_grads[dof_index1][q][2][0] =
1161 data.shape_grads[dof_index1][q][0][2];
1162 data.shape_grads[dof_index1][q][2][1] =
1163 data.shape_grads[dof_index1][q][1][2];
1164 data.shape_grads[dof_index1][q][2][2] =
1165 4.0 * polyx[i][0] * polyy[j][0] *
1169 const unsigned int dof_index2_1(
1170 cell_type2_offset1 + shift_ijk);
1171 const unsigned int dof_index2_2(
1172 cell_type2_offset2 + shift_ijk);
1174 for (
unsigned int d = 0; d < dim; ++d)
1176 data.shape_grads[dof_index2_1][q][0][d] =
1177 data.shape_grads[dof_index1][q][0][d];
1178 data.shape_grads[dof_index2_1][q][1][d] =
1180 data.shape_grads[dof_index1][q][1][d];
1181 data.shape_grads[dof_index2_1][q][2][d] =
1182 data.shape_grads[dof_index1][q][2][d];
1184 data.shape_grads[dof_index2_2][q][0][d] =
1185 data.shape_grads[dof_index1][q][0][d];
1186 data.shape_grads[dof_index2_2][q][1][d] =
1188 data.shape_grads[dof_index1][q][1][d];
1189 data.shape_grads[dof_index2_2][q][2][d] =
1191 data.shape_grads[dof_index1][q][2][d];
1196 const unsigned int shift_ij(
1199 const unsigned int dof_index3_1(
1200 cell_type3_offset1 + shift_ij);
1201 const unsigned int dof_index3_2(
1202 cell_type3_offset2 + shift_ij);
1203 const unsigned int dof_index3_3(
1204 cell_type3_offset3 + shift_ij);
1205 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1207 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1210 .shape_grads[dof_index3_1][q][d1][d2] =
1213 .shape_grads[dof_index3_2][q][d1][d2] =
1216 .shape_grads[dof_index3_3][q][d1][d2] =
1220 data.shape_grads[dof_index3_1][q][0][1] =
1221 2.0 * polyy[j][1] * polyz[k][0];
1222 data.shape_grads[dof_index3_1][q][0][2] =
1223 2.0 * polyy[j][0] * polyz[k][1];
1225 data.shape_grads[dof_index3_2][q][1][0] =
1226 2.0 * polyx[j][1] * polyz[k][0];
1227 data.shape_grads[dof_index3_2][q][1][2] =
1228 2.0 * polyx[j][0] * polyz[k][1];
1230 data.shape_grads[dof_index3_3][q][2][0] =
1231 2.0 * polyx[j][1] * polyy[k][0];
1232 data.shape_grads[dof_index3_3][q][2][1] =
1233 2.0 * polyx[j][0] * polyy[k][1];
1239 for (
unsigned int k = 0; k < degree; ++k)
1241 const unsigned int shift_k(k * degree * degree);
1242 const unsigned int shift_j(
1246 for (
unsigned int j = 0; j < degree; ++j)
1248 const unsigned int shift_jk(j * degree + shift_k);
1249 for (
unsigned int i = 0; i < degree; ++i)
1251 const unsigned int shift_ijk(shift_jk + i);
1254 const unsigned int dof_index1(
1255 cell_type1_offset + shift_ijk);
1257 data.shape_hessians[dof_index1][q][0][0][0] =
1258 8.0 * polyx[i][3] * polyy[j][0] *
1260 data.shape_hessians[dof_index1][q][1][0][0] =
1261 8.0 * polyx[i][2] * polyy[j][1] *
1263 data.shape_hessians[dof_index1][q][2][0][0] =
1264 8.0 * polyx[i][2] * polyy[j][0] *
1267 data.shape_hessians[dof_index1][q][0][1][0] =
1268 data.shape_hessians[dof_index1][q][1][0][0];
1269 data.shape_hessians[dof_index1][q][1][1][0] =
1270 8.0 * polyx[i][1] * polyy[j][2] *
1272 data.shape_hessians[dof_index1][q][2][1][0] =
1273 8.0 * polyx[i][1] * polyy[j][1] *
1276 data.shape_hessians[dof_index1][q][0][2][0] =
1277 data.shape_hessians[dof_index1][q][2][0][0];
1278 data.shape_hessians[dof_index1][q][1][2][0] =
1279 data.shape_hessians[dof_index1][q][2][1][0];
1280 data.shape_hessians[dof_index1][q][2][2][0] =
1281 8.0 * polyx[i][1] * polyy[j][0] *
1285 data.shape_hessians[dof_index1][q][0][0][1] =
1286 data.shape_hessians[dof_index1][q][1][0][0];
1287 data.shape_hessians[dof_index1][q][1][0][1] =
1288 data.shape_hessians[dof_index1][q][1][1][0];
1289 data.shape_hessians[dof_index1][q][2][0][1] =
1290 data.shape_hessians[dof_index1][q][2][1][0];
1292 data.shape_hessians[dof_index1][q][0][1][1] =
1293 data.shape_hessians[dof_index1][q][1][1][0];
1294 data.shape_hessians[dof_index1][q][1][1][1] =
1295 8.0 * polyx[i][0] * polyy[j][3] *
1297 data.shape_hessians[dof_index1][q][2][1][1] =
1298 8.0 * polyx[i][0] * polyy[j][2] *
1301 data.shape_hessians[dof_index1][q][0][2][1] =
1302 data.shape_hessians[dof_index1][q][2][1][0];
1303 data.shape_hessians[dof_index1][q][1][2][1] =
1304 data.shape_hessians[dof_index1][q][2][1][1];
1305 data.shape_hessians[dof_index1][q][2][2][1] =
1306 8.0 * polyx[i][0] * polyy[j][1] *
1310 data.shape_hessians[dof_index1][q][0][0][2] =
1311 data.shape_hessians[dof_index1][q][2][0][0];
1312 data.shape_hessians[dof_index1][q][1][0][2] =
1313 data.shape_hessians[dof_index1][q][2][1][0];
1314 data.shape_hessians[dof_index1][q][2][0][2] =
1315 data.shape_hessians[dof_index1][q][2][2][0];
1317 data.shape_hessians[dof_index1][q][0][1][2] =
1318 data.shape_hessians[dof_index1][q][2][1][0];
1319 data.shape_hessians[dof_index1][q][1][1][2] =
1320 data.shape_hessians[dof_index1][q][2][1][1];
1321 data.shape_hessians[dof_index1][q][2][1][2] =
1322 data.shape_hessians[dof_index1][q][2][2][1];
1324 data.shape_hessians[dof_index1][q][0][2][2] =
1325 data.shape_hessians[dof_index1][q][2][2][0];
1326 data.shape_hessians[dof_index1][q][1][2][2] =
1327 data.shape_hessians[dof_index1][q][2][2][1];
1328 data.shape_hessians[dof_index1][q][2][2][2] =
1329 8.0 * polyx[i][0] * polyy[j][0] *
1334 const unsigned int dof_index2_1(
1335 cell_type2_offset1 + shift_ijk);
1336 const unsigned int dof_index2_2(
1337 cell_type2_offset2 + shift_ijk);
1339 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1341 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1343 data.shape_hessians[dof_index2_1][q]
1345 data.shape_hessians[dof_index1][q]
1347 data.shape_hessians[dof_index2_1][q]
1350 data.shape_hessians[dof_index1][q]
1352 data.shape_hessians[dof_index2_1][q]
1354 data.shape_hessians[dof_index1][q]
1357 data.shape_hessians[dof_index2_2][q]
1359 data.shape_hessians[dof_index1][q]
1361 data.shape_hessians[dof_index2_2][q]
1364 data.shape_hessians[dof_index1][q]
1366 data.shape_hessians[dof_index2_2][q]
1369 data.shape_hessians[dof_index1][q]
1376 const unsigned int shift_ij(
1379 const unsigned int dof_index3_1(
1380 cell_type3_offset1 + shift_ij);
1381 const unsigned int dof_index3_2(
1382 cell_type3_offset2 + shift_ij);
1383 const unsigned int dof_index3_3(
1384 cell_type3_offset3 + shift_ij);
1385 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1387 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1389 for (
unsigned int d3 = 0; d3 < dim; ++d3)
1391 data.shape_hessians[dof_index3_1][q]
1393 data.shape_hessians[dof_index3_2][q]
1395 data.shape_hessians[dof_index3_3][q]
1400 data.shape_hessians[dof_index3_1][q][0][1][1] =
1401 4.0 * polyy[j][2] * polyz[k][0];
1402 data.shape_hessians[dof_index3_1][q][0][1][2] =
1403 4.0 * polyy[j][1] * polyz[k][1];
1405 data.shape_hessians[dof_index3_1][q][0][2][1] =
1406 data.shape_hessians[dof_index3_1][q][0][1][2];
1407 data.shape_hessians[dof_index3_1][q][0][2][2] =
1408 4.0 * polyy[j][0] * polyz[k][2];
1411 data.shape_hessians[dof_index3_2][q][1][0][0] =
1412 4.0 * polyx[j][2] * polyz[k][0];
1413 data.shape_hessians[dof_index3_2][q][1][0][2] =
1414 4.0 * polyx[j][1] * polyz[k][1];
1416 data.shape_hessians[dof_index3_2][q][1][2][0] =
1417 data.shape_hessians[dof_index3_2][q][1][0][2];
1418 data.shape_hessians[dof_index3_2][q][1][2][2] =
1419 4.0 * polyx[j][0] * polyz[k][2];
1422 data.shape_hessians[dof_index3_3][q][2][0][0] =
1423 4.0 * polyx[j][2] * polyy[k][0];
1424 data.shape_hessians[dof_index3_3][q][2][0][1] =
1425 4.0 * polyx[j][1] * polyy[k][1];
1427 data.shape_hessians[dof_index3_3][q][2][1][0] =
1428 data.shape_hessians[dof_index3_3][q][2][0][1];
1429 data.shape_hessians[dof_index3_3][q][2][1][1] =
1430 4.0 * polyx[j][0] * polyy[k][2];
1495 const unsigned int n_q_points = quadrature.
size();
1498 fe_data.
shape_values.size() == this->n_dofs_per_cell(),
1500 this->n_dofs_per_cell()));
1506 const unsigned int degree(
1511 const unsigned int vertices_per_line(2);
1515 std::vector<std::vector<unsigned int>> edge_order(
1516 lines_per_cell, std::vector<unsigned int>(vertices_per_line));
1528 std::vector<int> edge_sign(lines_per_cell);
1529 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1531 unsigned int v0_loc =
1533 unsigned int v1_loc =
1535 unsigned int v0_glob = cell->vertex_index(v0_loc);
1536 unsigned int v1_glob = cell->vertex_index(v1_loc);
1541 if (cell->face(m)->at_boundary() ==
false)
1542 if (cell->neighbor_is_coarser(m))
1544 v0_glob = cell->parent()->vertex_index(v0_loc);
1545 v1_glob = cell->parent()->vertex_index(v1_loc);
1548 if (v0_glob > v1_glob)
1551 edge_sign[m] = -1.0;
1595 std::vector<std::vector<double>> edge_sigma_values(
1597 std::vector<std::vector<double>> edge_sigma_grads(
1600 std::vector<std::vector<double>> edge_lambda_values(
1602 std::vector<std::vector<double>> edge_lambda_grads(
1606 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1608 std::transform(edge_sigma_values[m].
begin(),
1609 edge_sigma_values[m].
end(),
1610 edge_sigma_values[m].
begin(),
1611 [&](
const double edge_sigma_value) {
1612 return edge_sign[m] * edge_sigma_value;
1615 std::transform(edge_sigma_grads[m].
begin(),
1616 edge_sigma_grads[m].
end(),
1617 edge_sigma_grads[m].
begin(),
1618 [&](
const double edge_sigma_grad) {
1619 return edge_sign[m] * edge_sigma_grad;
1626 const unsigned int poly_length =
1632 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1634 const unsigned int shift_m(m * this->n_dofs_per_line());
1635 for (
unsigned int q = 0; q < n_q_points; ++q)
1638 std::vector<std::vector<double>> poly(
1639 degree, std::vector<double>(poly_length));
1640 for (
unsigned int i = 1; i < degree + 1; ++i)
1645 IntegratedLegendrePolynomials[i + 1].value(
1646 edge_sigma_values[m][q], poly[i - 1]);
1651 for (
unsigned int d = 0; d < dim; ++d)
1654 0.5 * edge_sigma_grads[m][d] *
1655 edge_lambda_values[m][q];
1658 for (
unsigned int i = 1; i < degree + 1; ++i)
1660 const unsigned int poly_index = i - 1;
1661 const unsigned int dof_index(i + shift_m);
1662 for (
unsigned int d = 0; d < dim; ++d)
1665 edge_sigma_grads[m][d] *
1666 poly[poly_index][1] *
1667 edge_lambda_values[m][q] +
1668 poly[poly_index][0] *
1669 edge_lambda_grads[m][d];
1676 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1678 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1683 0.5 * edge_sigma_grads[m][d1] *
1684 edge_lambda_grads[m][d2];
1688 for (
unsigned int i = 1; i < degree + 1; ++i)
1690 const unsigned int poly_index = i - 1;
1691 const unsigned int dof_index(i + shift_m);
1694 edge_sigma_grads[m][0] *
1695 edge_sigma_grads[m][0] *
1696 edge_lambda_values[m][q] * poly[poly_index][2];
1699 (edge_sigma_grads[m][0] *
1700 edge_lambda_grads[m][1] +
1701 edge_sigma_grads[m][1] *
1702 edge_lambda_grads[m][0]) *
1703 poly[poly_index][1];
1709 edge_sigma_grads[m][1] *
1710 edge_sigma_grads[m][1] *
1711 edge_lambda_values[m][q] * poly[poly_index][2];
1717 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1719 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1721 for (
unsigned int d3 = 0; d3 < dim; ++d3)
1730 for (
unsigned int i = 0; i < degree; ++i)
1732 const unsigned int dof_index(i + 1 + shift_m);
1734 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1736 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1738 for (
unsigned int d3 = 0; d3 < dim; ++d3)
1742 edge_sigma_grads[m][d1] *
1743 edge_sigma_grads[m][d2] *
1744 edge_sigma_grads[m][d3] *
1746 edge_lambda_values[m][q] +
1748 (edge_sigma_grads[m][d1] *
1749 edge_sigma_grads[m][d2] *
1750 edge_lambda_grads[m][d3] +
1751 edge_sigma_grads[m][d3] *
1752 edge_sigma_grads[m][d1] *
1753 edge_lambda_grads[m][d2] +
1754 edge_sigma_grads[m][d3] *
1755 edge_sigma_grads[m][d2] *
1756 edge_lambda_grads[m][d1]);
1774 std::vector<int> edge_sign(lines_per_cell);
1775 std::vector<bool> line_neighbor_is_coarser(
1780 for (
unsigned int f : cell->face_indices())
1781 if (!cell->face(f)->at_boundary())
1782 if (cell->neighbor_is_coarser(f))
1783 for (
unsigned int m = 0;
1784 m < GeometryInfo<dim>::lines_per_face;
1786 line_neighbor_is_coarser
1817 if (cell->is_active())
1818 for (
unsigned int line : cell->line_indices())
1823 if (line_neighbor_is_coarser[line])
1826 const int cell_level = cell->level();
1827 for (
auto &neighbor_cell :
1828 cell->get_cells_adjacent_to_line(line))
1829 if (neighbor_cell->level() != cell_level)
1831 line_neighbor_is_coarser[line] =
true;
1836 for (
unsigned int line : cell->line_indices())
1838 const unsigned int v0_loc =
1840 const unsigned int v1_loc =
1844 unsigned int v0_glob;
1845 unsigned int v1_glob;
1846 if (line_neighbor_is_coarser[line])
1849 v0_glob = cell->parent()->vertex_index(v0_loc);
1850 v1_glob = cell->parent()->vertex_index(v1_loc);
1855 v0_glob = cell->vertex_index(v0_loc);
1856 v1_glob = cell->vertex_index(v1_loc);
1860 if (v0_glob > v1_glob)
1863 edge_sign[line] = -1.0;
1868 edge_sign[line] = 1.0;
1909 std::vector<std::vector<double>> edge_sigma_values(
1911 std::vector<std::vector<double>> edge_lambda_values(
1913 std::vector<std::vector<double>> edge_sigma_grads(
1915 std::vector<std::vector<std::vector<double>>> edge_lambda_grads(
1917 std::vector<std::vector<std::vector<double>>>
1921 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1923 std::transform(edge_sigma_values[m].
begin(),
1924 edge_sigma_values[m].
end(),
1925 edge_sigma_values[m].
begin(),
1926 [&](
const double edge_sigma_value) {
1927 return edge_sign[m] * edge_sigma_value;
1929 std::transform(edge_sigma_grads[m].
begin(),
1930 edge_sigma_grads[m].
end(),
1931 edge_sigma_grads[m].
begin(),
1932 [&](
const double edge_sigma_grad) {
1933 return edge_sign[m] * edge_sigma_grad;
1941 const unsigned int poly_length =
1946 std::vector<std::vector<double>> poly(
1947 degree, std::vector<double>(poly_length));
1948 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1950 const unsigned int shift_m(m * this->n_dofs_per_line());
1951 for (
unsigned int q = 0; q < n_q_points; ++q)
1957 for (
unsigned int i = 0; i < degree; ++i)
1959 IntegratedLegendrePolynomials[i + 2].value(
1960 edge_sigma_values[m][q], poly[i]);
1966 for (
unsigned int d = 0; d < dim; ++d)
1969 0.5 * edge_sigma_grads[m][d] *
1970 edge_lambda_values[m][q];
1975 for (
unsigned int i = 0; i < degree; ++i)
1977 const unsigned int dof_index(i + 1 + shift_m);
1978 for (
unsigned int d = 0; d < dim; ++d)
1981 edge_sigma_grads[m][d] * poly[i][1] *
1982 edge_lambda_values[m][q] +
1983 poly[i][0] * edge_lambda_grads[m][q][d];
1991 for (
unsigned int d1 = 0; d1 < dim; ++d1)
1993 for (
unsigned int d2 = 0; d2 < dim; ++d2)
1996 0.5 * edge_sigma_grads[m][d1] *
1997 edge_lambda_grads[m][q][d2];
2003 for (
unsigned int i = 0; i < degree; ++i)
2005 const unsigned int dof_index(i + 1 + shift_m);
2007 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2009 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2013 edge_sigma_grads[m][d1] *
2014 edge_sigma_grads[m][d2] *
2016 edge_lambda_values[m][q] +
2017 (edge_sigma_grads[m][d1] *
2018 edge_lambda_grads[m][q][d2] +
2019 edge_sigma_grads[m][d2] *
2020 edge_lambda_grads[m][q][d1]) *
2022 edge_lambda_gradgrads_3d[m][d1]
2033 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2035 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2037 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2041 0.5 * edge_sigma_grads[m][d1] *
2042 edge_lambda_gradgrads_3d[m][d3][d2];
2050 for (
unsigned int i = 0; i < degree; ++i)
2052 const unsigned int dof_index(i + 1 + shift_m);
2054 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2056 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2058 for (
unsigned int d3 = 0; d3 < dim;
2064 edge_sigma_grads[m][d1] *
2065 edge_sigma_grads[m][d2] *
2066 edge_sigma_grads[m][d3] *
2068 edge_lambda_values[m][q] +
2070 (edge_sigma_grads[m][d1] *
2071 edge_sigma_grads[m][d2] *
2072 edge_lambda_grads[m][q]
2074 edge_sigma_grads[m][d3] *
2075 edge_sigma_grads[m][d1] *
2076 edge_lambda_grads[m][q]
2078 edge_sigma_grads[m][d3] *
2079 edge_sigma_grads[m][d2] *
2080 edge_lambda_grads[m][q]
2083 (edge_sigma_grads[m][d1] *
2084 edge_lambda_gradgrads_3d
2086 edge_sigma_grads[m][d2] *
2087 edge_lambda_gradgrads_3d
2089 edge_sigma_grads[m][d3] *
2090 edge_lambda_gradgrads_3d
2132 const unsigned int degree(
2143 const unsigned int n_q_points = quadrature.
size();
2146 fe_data.
shape_values.size() == this->n_dofs_per_cell(),
2148 this->n_dofs_per_cell()));
2155 const unsigned int vertices_per_face(
2160 const unsigned int n_line_dofs =
2164 std::vector<std::vector<unsigned int>> face_orientation(
2165 faces_per_cell, std::vector<unsigned int>(vertices_per_face));
2175 {1, 2}, {0, 3}, {3, 0}, {2, 1}};
2177 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2180 bool cell_has_coarser_neighbor =
false;
2181 if (cell->face(m)->at_boundary() ==
false)
2182 if (cell->neighbor_is_coarser(m))
2183 cell_has_coarser_neighbor =
true;
2187 unsigned int current_max = 0;
2192 if (cell_has_coarser_neighbor)
2194 unsigned int current_glob = cell->parent()->vertex_index(
2196 for (
unsigned int v = 1; v < vertices_per_face; ++v)
2199 cell->parent()->vertex_index(
2203 current_glob = cell->parent()->vertex_index(
2212 unsigned int current_glob = cell->vertex_index(
2214 for (
unsigned int v = 1; v < vertices_per_face; ++v)
2221 current_glob = cell->vertex_index(
2227 face_orientation[m][0] =
2232 m, vertex_opposite_on_face[current_max]);
2240 if (cell_has_coarser_neighbor)
2242 if (cell->parent()->vertex_index(
2244 m, vertices_adjacent_on_face[current_max][0])) >
2245 cell->parent()->vertex_index(
2247 m, vertices_adjacent_on_face[current_max][1])))
2249 face_orientation[m][1] =
2251 m, vertices_adjacent_on_face[current_max][0]);
2252 face_orientation[m][3] =
2254 m, vertices_adjacent_on_face[current_max][1]);
2258 face_orientation[m][1] =
2260 m, vertices_adjacent_on_face[current_max][1]);
2261 face_orientation[m][3] =
2263 m, vertices_adjacent_on_face[current_max][0]);
2268 if (cell->vertex_index(
2270 m, vertices_adjacent_on_face[current_max][0])) >
2273 m, vertices_adjacent_on_face[current_max][1])))
2275 face_orientation[m][1] =
2277 m, vertices_adjacent_on_face[current_max][0]);
2278 face_orientation[m][3] =
2280 m, vertices_adjacent_on_face[current_max][1]);
2284 face_orientation[m][1] =
2286 m, vertices_adjacent_on_face[current_max][1]);
2287 face_orientation[m][3] =
2289 m, vertices_adjacent_on_face[current_max][0]);
2295 std::vector<std::vector<double>> face_xi_values(
2296 faces_per_cell, std::vector<double>(n_q_points));
2297 std::vector<std::vector<double>> face_xi_grads(
2298 faces_per_cell, std::vector<double>(dim));
2299 std::vector<std::vector<double>> face_eta_values(
2300 faces_per_cell, std::vector<double>(n_q_points));
2301 std::vector<std::vector<double>> face_eta_grads(
2302 faces_per_cell, std::vector<double>(dim));
2304 std::vector<std::vector<double>> face_lambda_values(
2305 faces_per_cell, std::vector<double>(n_q_points));
2306 std::vector<std::vector<double>> face_lambda_grads(
2307 faces_per_cell, std::vector<double>(dim));
2308 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2310 for (
unsigned int q = 0; q < n_q_points; ++q)
2312 face_xi_values[m][q] =
2314 [face_orientation[m][1]];
2315 face_eta_values[m][q] =
2317 [face_orientation[m][3]];
2320 for (
unsigned int d = 0; d < dim; ++d)
2322 face_xi_grads[m][d] =
2324 [face_orientation[m][1]][d];
2325 face_eta_grads[m][d] =
2327 [face_orientation[m][3]][d];
2333 const unsigned int poly_length =
2338 std::vector<std::vector<double>> polyxi(
2339 degree, std::vector<double>(poly_length));
2340 std::vector<std::vector<double>> polyeta(
2341 degree, std::vector<double>(poly_length));
2344 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2347 const unsigned int shift_m(m * this->n_dofs_per_quad(0));
2355 const unsigned int face_type1_offset(n_line_dofs + shift_m);
2365 const unsigned int face_type2_offset(face_type1_offset +
2378 const unsigned int face_type3_offset1(face_type2_offset +
2380 const unsigned int face_type3_offset2(face_type3_offset1 +
2384 for (
unsigned int q = 0; q < n_q_points; ++q)
2393 for (
unsigned int i = 0; i < degree; ++i)
2396 IntegratedLegendrePolynomials[i + 2].value(
2397 face_xi_values[m][q], polyxi[i]);
2398 IntegratedLegendrePolynomials[i + 2].value(
2399 face_eta_values[m][q], polyeta[i]);
2404 for (
unsigned int j = 0; j < degree; ++j)
2406 const unsigned int shift_j(j * degree);
2407 for (
unsigned int i = 0; i < degree; ++i)
2409 const unsigned int shift_ij(shift_j + i);
2411 const unsigned int dof_index1(face_type1_offset +
2413 for (
unsigned int d = 0; d < dim; ++d)
2416 (face_xi_grads[m][d] * polyxi[i][1] *
2418 face_eta_grads[m][d] * polyxi[i][0] *
2420 face_lambda_values[m][q] +
2421 face_lambda_grads[m][d] * polyxi[i][0] *
2425 const unsigned int dof_index2(face_type2_offset +
2427 for (
unsigned int d = 0; d < dim; ++d)
2430 (face_xi_grads[m][d] * polyxi[i][1] *
2432 face_eta_grads[m][d] * polyxi[i][0] *
2434 face_lambda_values[m][q];
2438 const unsigned int dof_index3_1(face_type3_offset1 +
2440 const unsigned int dof_index3_2(face_type3_offset2 +
2442 for (
unsigned int d = 0; d < dim; ++d)
2445 face_xi_grads[m][d] * polyeta[j][0] *
2446 face_lambda_values[m][q];
2449 face_eta_grads[m][d] * polyxi[j][0] *
2450 face_lambda_values[m][q];
2456 for (
unsigned int j = 0; j < degree; ++j)
2458 const unsigned int shift_j(j * degree);
2459 for (
unsigned int i = 0; i < degree; ++i)
2461 const unsigned int shift_ij(shift_j + i);
2463 const unsigned int dof_index1(face_type1_offset +
2465 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2467 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2471 (face_xi_grads[m][d1] *
2472 face_xi_grads[m][d2] * polyxi[i][2] *
2474 (face_xi_grads[m][d1] *
2475 face_eta_grads[m][d2] +
2476 face_xi_grads[m][d2] *
2477 face_eta_grads[m][d1]) *
2478 polyxi[i][1] * polyeta[j][1] +
2479 face_eta_grads[m][d1] *
2480 face_eta_grads[m][d2] *
2481 polyxi[i][0] * polyeta[j][2]) *
2482 face_lambda_values[m][q] +
2483 (face_xi_grads[m][d2] * polyxi[i][1] *
2485 face_eta_grads[m][d2] * polyxi[i][0] *
2487 face_lambda_grads[m][d1] +
2488 (face_xi_grads[m][d1] * polyxi[i][1] *
2490 face_eta_grads[m][d1] * polyxi[i][0] *
2492 face_lambda_grads[m][d2];
2496 const unsigned int dof_index2(face_type2_offset +
2498 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2500 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2504 (face_xi_grads[m][d1] *
2505 face_xi_grads[m][d2] * polyxi[i][2] *
2507 (face_xi_grads[m][d1] *
2508 face_eta_grads[m][d2] -
2509 face_xi_grads[m][d2] *
2510 face_eta_grads[m][d1]) *
2511 polyxi[i][1] * polyeta[j][1] -
2512 face_eta_grads[m][d1] *
2513 face_eta_grads[m][d2] *
2514 polyxi[i][0] * polyeta[j][2]) *
2515 face_lambda_values[m][q] +
2516 (face_xi_grads[m][d1] * polyxi[i][1] *
2518 face_eta_grads[m][d1] * polyxi[i][0] *
2520 face_lambda_grads[m][d2];
2525 const unsigned int dof_index3_1(face_type3_offset1 +
2527 const unsigned int dof_index3_2(face_type3_offset2 +
2529 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2531 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2534 face_xi_grads[m][d1] *
2535 (face_eta_grads[m][d2] * polyeta[j][1] *
2536 face_lambda_values[m][q] +
2537 face_lambda_grads[m][d2] * polyeta[j][0]);
2540 face_eta_grads[m][d1] *
2541 (face_xi_grads[m][d2] * polyxi[j][1] *
2542 face_lambda_values[m][q] +
2543 face_lambda_grads[m][d2] * polyxi[j][0]);
2550 for (
unsigned int j = 0; j < degree; ++j)
2552 const unsigned int shift_j(j * degree);
2553 for (
unsigned int i = 0; i < degree; ++i)
2555 const unsigned int shift_ij(shift_j + i);
2558 const unsigned int dof_index1(face_type1_offset +
2560 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2562 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2564 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2569 face_xi_grads[m][d3] *
2570 (face_eta_grads[m][d1] *
2572 face_eta_grads[m][d2] *
2573 face_lambda_values[m][q] +
2575 face_lambda_grads[m][d2]) +
2577 face_eta_grads[m][d2] *
2578 face_lambda_grads[m][d1]) +
2581 face_eta_grads[m][d1] *
2582 face_eta_grads[m][d2] *
2583 face_eta_grads[m][d3] *
2584 face_lambda_values[m][q] +
2586 (face_eta_grads[m][d1] *
2587 face_eta_grads[m][d2] *
2588 face_lambda_grads[m][d3] +
2589 face_eta_grads[m][d3] *
2590 (face_eta_grads[m][d1] *
2591 face_lambda_grads[m]
2593 face_eta_grads[m][d2] *
2596 (polyxi[i][1] * polyeta[j][1] *
2597 face_eta_grads[m][d3] +
2598 polyxi[i][2] * polyeta[j][0] *
2599 face_xi_grads[m][d3]) *
2600 (face_xi_grads[m][d1] *
2601 face_lambda_grads[m][d2] +
2602 face_xi_grads[m][d2] *
2603 face_lambda_grads[m][d1]) +
2604 face_lambda_grads[m][d3] *
2605 (polyxi[i][2] * polyeta[j][0] *
2606 face_xi_grads[m][d1] *
2607 face_xi_grads[m][d2] +
2608 polyxi[i][1] * polyeta[j][1] *
2609 (face_xi_grads[m][d1] *
2610 face_eta_grads[m][d2] +
2611 face_xi_grads[m][d2] *
2612 face_eta_grads[m][d1])) +
2613 face_lambda_values[m][q] *
2614 (polyxi[i][3] * polyeta[j][0] *
2615 face_xi_grads[m][d1] *
2616 face_xi_grads[m][d2] *
2617 face_xi_grads[m][d3] +
2618 polyxi[i][1] * polyeta[j][2] *
2619 face_eta_grads[m][d3] *
2620 (face_xi_grads[m][d1] *
2621 face_eta_grads[m][d2] +
2622 face_xi_grads[m][d2] *
2623 face_eta_grads[m][d1]) +
2624 polyxi[i][2] * polyeta[j][1] *
2625 (face_xi_grads[m][d3] *
2626 face_xi_grads[m][d2] *
2627 face_eta_grads[m][d1] +
2628 face_xi_grads[m][d1] *
2629 (face_xi_grads[m][d2] *
2630 face_eta_grads[m][d3] +
2631 face_xi_grads[m][d3] *
2632 face_eta_grads[m][d2])));
2638 const unsigned int dof_index2(face_type2_offset +
2640 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2642 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2644 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2648 face_xi_grads[m][d1] *
2649 (polyxi[i][1] * polyeta[j][1] *
2650 (face_eta_grads[m][d2] *
2651 face_lambda_grads[m][d3] +
2652 face_eta_grads[m][d3] *
2653 face_lambda_grads[m][d2]) +
2654 polyxi[i][2] * polyeta[j][0] *
2655 (face_xi_grads[m][d2] *
2656 face_lambda_grads[m][d3] +
2657 face_xi_grads[m][d3] *
2658 face_lambda_grads[m][d2]) +
2659 face_lambda_values[m][q] *
2660 (face_eta_grads[m][d2] *
2663 face_eta_grads[m][d3] +
2666 face_xi_grads[m][d3]) +
2667 face_xi_grads[m][d2] *
2670 face_eta_grads[m][d3] +
2673 face_xi_grads[m][d3]))) -
2675 face_eta_grads[m][d1] *
2676 (face_eta_grads[m][d2] *
2678 face_eta_grads[m][d3] *
2679 face_lambda_values[m][q] +
2681 face_lambda_grads[m][d3]) +
2683 face_eta_grads[m][d3] *
2684 face_lambda_grads[m][d2]) -
2685 face_eta_grads[m][d1] *
2687 face_xi_grads[m][d3] *
2689 face_eta_grads[m][d2] *
2690 face_lambda_values[m][q] +
2692 face_lambda_grads[m][d2]) +
2693 face_xi_grads[m][d2] *
2696 face_eta_grads[m][d3] *
2697 face_lambda_values[m]
2700 face_lambda_grads[m]
2702 polyxi[i][2] * polyeta[j][1] *
2703 face_xi_grads[m][d3] *
2704 face_lambda_values[m][q]));
2710 const unsigned int dof_index3_1(face_type3_offset1 +
2712 const unsigned int dof_index3_2(face_type3_offset2 +
2714 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2716 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2718 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2722 face_xi_grads[m][d1] *
2723 (face_eta_grads[m][d2] *
2725 face_eta_grads[m][d3] *
2726 face_lambda_values[m][q] +
2728 face_lambda_grads[m][d3]) +
2729 face_lambda_grads[m][d2] *
2731 face_eta_grads[m][d3]);
2735 face_eta_grads[m][d1] *
2736 (face_xi_grads[m][d2] *
2738 face_xi_grads[m][d3] *
2739 face_lambda_values[m][q] +
2741 face_lambda_grads[m][d3]) +
2742 face_lambda_grads[m][d2] *
2743 polyxi[j][1] * face_xi_grads[m][d3]);