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 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1777 unsigned int v0_loc =
1779 unsigned int v1_loc =
1781 unsigned int v0_glob = cell->vertex_index(v0_loc);
1782 unsigned int v1_glob = cell->vertex_index(v1_loc);
1784 if (v0_glob > v1_glob)
1787 edge_sign[m] = -1.0;
1798 for (
unsigned int f = 0; f < 6; ++f)
1799 if (cell->face(f)->at_boundary() ==
false)
1800 if (cell->neighbor_is_coarser(f))
1801 for (
unsigned int m = 0; m < 4; ++m)
1803 unsigned int parent_m =
1806 unsigned int v0_loc =
1808 unsigned int v1_loc =
1811 unsigned int v0_glob =
1812 cell->parent()->vertex_index(v0_loc);
1813 unsigned int v1_glob =
1814 cell->parent()->vertex_index(v1_loc);
1816 if (v0_glob > v1_glob)
1820 edge_sign[parent_m] = -1.0;
1826 edge_sign[parent_m] = 1.0;
1856 std::vector<unsigned int> adjacent_faces = {2, 2, 4, 4, 0, 0};
1857 for (
unsigned int f = 0; f < 6; ++f)
1859 if (!cell->face(f)->at_boundary() &&
1860 !cell->face(adjacent_faces[f])->at_boundary())
1861 if (!cell->neighbor_is_coarser(f) &&
1862 !cell->neighbor_is_coarser(adjacent_faces[f]))
1863 if (!cell->neighbor(f)
1864 ->face(adjacent_faces[f])
1866 if (cell->neighbor(f)->neighbor_is_coarser(
1869 unsigned int parent_m =
1871 unsigned int v0_loc =
1874 unsigned int v1_loc =
1877 unsigned int v0_glob =
1878 cell->parent()->vertex_index(v0_loc);
1879 unsigned int v1_glob =
1880 cell->parent()->vertex_index(v1_loc);
1881 if (v0_glob > v1_glob)
1885 edge_sign[parent_m] = -1.0;
1891 edge_sign[parent_m] = 1.0;
1895 if (!cell->face(f)->at_boundary() &&
1896 !cell->face(adjacent_faces[f] + 1)->at_boundary())
1897 if (!cell->neighbor_is_coarser(f) &&
1898 !cell->neighbor_is_coarser(adjacent_faces[f] + 1))
1899 if (!cell->neighbor(f)
1900 ->face(adjacent_faces[f] + 1)
1902 if (cell->neighbor(f)->neighbor_is_coarser(
1903 adjacent_faces[f] + 1))
1905 unsigned int parent_m =
1907 unsigned int v0_loc =
1910 unsigned int v1_loc =
1913 unsigned int v0_glob =
1914 cell->parent()->vertex_index(v0_loc);
1915 unsigned int v1_glob =
1916 cell->parent()->vertex_index(v1_loc);
1917 if (v0_glob > v1_glob)
1921 edge_sign[parent_m] = -1.0;
1927 edge_sign[parent_m] = 1.0;
1969 std::vector<std::vector<double>> edge_sigma_values(
1971 std::vector<std::vector<double>> edge_lambda_values(
1973 std::vector<std::vector<double>> edge_sigma_grads(
1975 std::vector<std::vector<std::vector<double>>> edge_lambda_grads(
1977 std::vector<std::vector<std::vector<double>>>
1981 for (
unsigned int m = 0; m < lines_per_cell; ++m)
1983 std::transform(edge_sigma_values[m].begin(),
1984 edge_sigma_values[m].end(),
1985 edge_sigma_values[m].begin(),
1986 [&](
const double edge_sigma_value) {
1987 return edge_sign[m] * edge_sigma_value;
1989 std::transform(edge_sigma_grads[m].begin(),
1990 edge_sigma_grads[m].end(),
1991 edge_sigma_grads[m].begin(),
1992 [&](
const double edge_sigma_grad) {
1993 return edge_sign[m] * edge_sigma_grad;
2001 const unsigned int poly_length =
2006 std::vector<std::vector<double>> poly(
2007 degree, std::vector<double>(poly_length));
2008 for (
unsigned int m = 0; m < lines_per_cell; ++m)
2010 const unsigned int shift_m(m * this->n_dofs_per_line());
2011 for (
unsigned int q = 0; q < n_q_points; ++q)
2017 for (
unsigned int i = 0; i < degree; ++i)
2019 IntegratedLegendrePolynomials[i + 2].value(
2020 edge_sigma_values[m][q], poly[i]);
2026 for (
unsigned int d = 0; d < dim; ++d)
2029 0.5 * edge_sigma_grads[m][d] *
2030 edge_lambda_values[m][q];
2035 for (
unsigned int i = 0; i < degree; ++i)
2037 const unsigned int dof_index(i + 1 + shift_m);
2038 for (
unsigned int d = 0; d < dim; ++d)
2041 edge_sigma_grads[m][d] * poly[i][1] *
2042 edge_lambda_values[m][q] +
2043 poly[i][0] * edge_lambda_grads[m][q][d];
2051 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2053 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2056 0.5 * edge_sigma_grads[m][d1] *
2057 edge_lambda_grads[m][q][d2];
2063 for (
unsigned int i = 0; i < degree; ++i)
2065 const unsigned int dof_index(i + 1 + shift_m);
2067 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2069 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2073 edge_sigma_grads[m][d1] *
2074 edge_sigma_grads[m][d2] *
2076 edge_lambda_values[m][q] +
2077 (edge_sigma_grads[m][d1] *
2078 edge_lambda_grads[m][q][d2] +
2079 edge_sigma_grads[m][d2] *
2080 edge_lambda_grads[m][q][d1]) *
2082 edge_lambda_gradgrads_3d[m][d1]
2093 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2095 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2097 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2101 0.5 * edge_sigma_grads[m][d1] *
2102 edge_lambda_gradgrads_3d[m][d3][d2];
2110 for (
unsigned int i = 0; i < degree; ++i)
2112 const unsigned int dof_index(i + 1 + shift_m);
2114 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2116 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2118 for (
unsigned int d3 = 0; d3 < dim;
2124 edge_sigma_grads[m][d1] *
2125 edge_sigma_grads[m][d2] *
2126 edge_sigma_grads[m][d3] *
2128 edge_lambda_values[m][q] +
2130 (edge_sigma_grads[m][d1] *
2131 edge_sigma_grads[m][d2] *
2132 edge_lambda_grads[m][q]
2134 edge_sigma_grads[m][d3] *
2135 edge_sigma_grads[m][d1] *
2136 edge_lambda_grads[m][q]
2138 edge_sigma_grads[m][d3] *
2139 edge_sigma_grads[m][d2] *
2140 edge_lambda_grads[m][q]
2143 (edge_sigma_grads[m][d1] *
2144 edge_lambda_gradgrads_3d
2146 edge_sigma_grads[m][d2] *
2147 edge_lambda_gradgrads_3d
2149 edge_sigma_grads[m][d3] *
2150 edge_lambda_gradgrads_3d
2192 const unsigned int degree(
2203 const unsigned int n_q_points = quadrature.
size();
2206 fe_data.
shape_values.size() == this->n_dofs_per_cell(),
2208 this->n_dofs_per_cell()));
2215 const unsigned int vertices_per_face(
2220 const unsigned int n_line_dofs =
2224 std::vector<std::vector<unsigned int>> face_orientation(
2225 faces_per_cell, std::vector<unsigned int>(vertices_per_face));
2235 {1, 2}, {0, 3}, {3, 0}, {2, 1}};
2237 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2240 bool cell_has_coarser_neighbor =
false;
2241 if (cell->face(m)->at_boundary() ==
false)
2242 if (cell->neighbor_is_coarser(m))
2243 cell_has_coarser_neighbor =
true;
2247 unsigned int current_max = 0;
2252 if (cell_has_coarser_neighbor)
2254 unsigned int current_glob = cell->parent()->vertex_index(
2256 for (
unsigned int v = 1; v < vertices_per_face; ++v)
2259 cell->parent()->vertex_index(
2263 current_glob = cell->parent()->vertex_index(
2272 unsigned int current_glob = cell->vertex_index(
2274 for (
unsigned int v = 1; v < vertices_per_face; ++v)
2281 current_glob = cell->vertex_index(
2287 face_orientation[m][0] =
2292 m, vertex_opposite_on_face[current_max]);
2300 if (cell_has_coarser_neighbor)
2302 if (cell->parent()->vertex_index(
2304 m, vertices_adjacent_on_face[current_max][0])) >
2305 cell->parent()->vertex_index(
2307 m, vertices_adjacent_on_face[current_max][1])))
2309 face_orientation[m][1] =
2311 m, vertices_adjacent_on_face[current_max][0]);
2312 face_orientation[m][3] =
2314 m, vertices_adjacent_on_face[current_max][1]);
2318 face_orientation[m][1] =
2320 m, vertices_adjacent_on_face[current_max][1]);
2321 face_orientation[m][3] =
2323 m, vertices_adjacent_on_face[current_max][0]);
2328 if (cell->vertex_index(
2330 m, vertices_adjacent_on_face[current_max][0])) >
2333 m, vertices_adjacent_on_face[current_max][1])))
2335 face_orientation[m][1] =
2337 m, vertices_adjacent_on_face[current_max][0]);
2338 face_orientation[m][3] =
2340 m, vertices_adjacent_on_face[current_max][1]);
2344 face_orientation[m][1] =
2346 m, vertices_adjacent_on_face[current_max][1]);
2347 face_orientation[m][3] =
2349 m, vertices_adjacent_on_face[current_max][0]);
2355 std::vector<std::vector<double>> face_xi_values(
2356 faces_per_cell, std::vector<double>(n_q_points));
2357 std::vector<std::vector<double>> face_xi_grads(
2358 faces_per_cell, std::vector<double>(dim));
2359 std::vector<std::vector<double>> face_eta_values(
2360 faces_per_cell, std::vector<double>(n_q_points));
2361 std::vector<std::vector<double>> face_eta_grads(
2362 faces_per_cell, std::vector<double>(dim));
2364 std::vector<std::vector<double>> face_lambda_values(
2365 faces_per_cell, std::vector<double>(n_q_points));
2366 std::vector<std::vector<double>> face_lambda_grads(
2367 faces_per_cell, std::vector<double>(dim));
2368 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2370 for (
unsigned int q = 0; q < n_q_points; ++q)
2372 face_xi_values[m][q] =
2374 [face_orientation[m][1]];
2375 face_eta_values[m][q] =
2377 [face_orientation[m][3]];
2380 for (
unsigned int d = 0; d < dim; ++d)
2382 face_xi_grads[m][d] =
2384 [face_orientation[m][1]][d];
2385 face_eta_grads[m][d] =
2387 [face_orientation[m][3]][d];
2393 const unsigned int poly_length =
2398 std::vector<std::vector<double>> polyxi(
2399 degree, std::vector<double>(poly_length));
2400 std::vector<std::vector<double>> polyeta(
2401 degree, std::vector<double>(poly_length));
2404 for (
unsigned int m = 0; m < faces_per_cell; ++m)
2407 const unsigned int shift_m(m * this->n_dofs_per_quad(0));
2415 const unsigned int face_type1_offset(n_line_dofs + shift_m);
2425 const unsigned int face_type2_offset(face_type1_offset +
2438 const unsigned int face_type3_offset1(face_type2_offset +
2440 const unsigned int face_type3_offset2(face_type3_offset1 +
2444 for (
unsigned int q = 0; q < n_q_points; ++q)
2453 for (
unsigned int i = 0; i < degree; ++i)
2456 IntegratedLegendrePolynomials[i + 2].value(
2457 face_xi_values[m][q], polyxi[i]);
2458 IntegratedLegendrePolynomials[i + 2].value(
2459 face_eta_values[m][q], polyeta[i]);
2464 for (
unsigned int j = 0; j < degree; ++j)
2466 const unsigned int shift_j(j * degree);
2467 for (
unsigned int i = 0; i < degree; ++i)
2469 const unsigned int shift_ij(shift_j + i);
2471 const unsigned int dof_index1(face_type1_offset +
2473 for (
unsigned int d = 0; d < dim; ++d)
2476 (face_xi_grads[m][d] * polyxi[i][1] *
2478 face_eta_grads[m][d] * polyxi[i][0] *
2480 face_lambda_values[m][q] +
2481 face_lambda_grads[m][d] * polyxi[i][0] *
2485 const unsigned int dof_index2(face_type2_offset +
2487 for (
unsigned int d = 0; d < dim; ++d)
2490 (face_xi_grads[m][d] * polyxi[i][1] *
2492 face_eta_grads[m][d] * polyxi[i][0] *
2494 face_lambda_values[m][q];
2498 const unsigned int dof_index3_1(face_type3_offset1 +
2500 const unsigned int dof_index3_2(face_type3_offset2 +
2502 for (
unsigned int d = 0; d < dim; ++d)
2505 face_xi_grads[m][d] * polyeta[j][0] *
2506 face_lambda_values[m][q];
2509 face_eta_grads[m][d] * polyxi[j][0] *
2510 face_lambda_values[m][q];
2516 for (
unsigned int j = 0; j < degree; ++j)
2518 const unsigned int shift_j(j * degree);
2519 for (
unsigned int i = 0; i < degree; ++i)
2521 const unsigned int shift_ij(shift_j + i);
2523 const unsigned int dof_index1(face_type1_offset +
2525 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2527 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2531 (face_xi_grads[m][d1] *
2532 face_xi_grads[m][d2] * polyxi[i][2] *
2534 (face_xi_grads[m][d1] *
2535 face_eta_grads[m][d2] +
2536 face_xi_grads[m][d2] *
2537 face_eta_grads[m][d1]) *
2538 polyxi[i][1] * polyeta[j][1] +
2539 face_eta_grads[m][d1] *
2540 face_eta_grads[m][d2] *
2541 polyxi[i][0] * polyeta[j][2]) *
2542 face_lambda_values[m][q] +
2543 (face_xi_grads[m][d2] * polyxi[i][1] *
2545 face_eta_grads[m][d2] * polyxi[i][0] *
2547 face_lambda_grads[m][d1] +
2548 (face_xi_grads[m][d1] * polyxi[i][1] *
2550 face_eta_grads[m][d1] * polyxi[i][0] *
2552 face_lambda_grads[m][d2];
2556 const unsigned int dof_index2(face_type2_offset +
2558 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2560 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2564 (face_xi_grads[m][d1] *
2565 face_xi_grads[m][d2] * polyxi[i][2] *
2567 (face_xi_grads[m][d1] *
2568 face_eta_grads[m][d2] -
2569 face_xi_grads[m][d2] *
2570 face_eta_grads[m][d1]) *
2571 polyxi[i][1] * polyeta[j][1] -
2572 face_eta_grads[m][d1] *
2573 face_eta_grads[m][d2] *
2574 polyxi[i][0] * polyeta[j][2]) *
2575 face_lambda_values[m][q] +
2576 (face_xi_grads[m][d1] * polyxi[i][1] *
2578 face_eta_grads[m][d1] * polyxi[i][0] *
2580 face_lambda_grads[m][d2];
2585 const unsigned int dof_index3_1(face_type3_offset1 +
2587 const unsigned int dof_index3_2(face_type3_offset2 +
2589 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2591 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2594 face_xi_grads[m][d1] *
2595 (face_eta_grads[m][d2] * polyeta[j][1] *
2596 face_lambda_values[m][q] +
2597 face_lambda_grads[m][d2] * polyeta[j][0]);
2600 face_eta_grads[m][d1] *
2601 (face_xi_grads[m][d2] * polyxi[j][1] *
2602 face_lambda_values[m][q] +
2603 face_lambda_grads[m][d2] * polyxi[j][0]);
2610 for (
unsigned int j = 0; j < degree; ++j)
2612 const unsigned int shift_j(j * degree);
2613 for (
unsigned int i = 0; i < degree; ++i)
2615 const unsigned int shift_ij(shift_j + i);
2618 const unsigned int dof_index1(face_type1_offset +
2620 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2622 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2624 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2629 face_xi_grads[m][d3] *
2630 (face_eta_grads[m][d1] *
2632 face_eta_grads[m][d2] *
2633 face_lambda_values[m][q] +
2635 face_lambda_grads[m][d2]) +
2637 face_eta_grads[m][d2] *
2638 face_lambda_grads[m][d1]) +
2641 face_eta_grads[m][d1] *
2642 face_eta_grads[m][d2] *
2643 face_eta_grads[m][d3] *
2644 face_lambda_values[m][q] +
2646 (face_eta_grads[m][d1] *
2647 face_eta_grads[m][d2] *
2648 face_lambda_grads[m][d3] +
2649 face_eta_grads[m][d3] *
2650 (face_eta_grads[m][d1] *
2651 face_lambda_grads[m]
2653 face_eta_grads[m][d2] *
2656 (polyxi[i][1] * polyeta[j][1] *
2657 face_eta_grads[m][d3] +
2658 polyxi[i][2] * polyeta[j][0] *
2659 face_xi_grads[m][d3]) *
2660 (face_xi_grads[m][d1] *
2661 face_lambda_grads[m][d2] +
2662 face_xi_grads[m][d2] *
2663 face_lambda_grads[m][d1]) +
2664 face_lambda_grads[m][d3] *
2665 (polyxi[i][2] * polyeta[j][0] *
2666 face_xi_grads[m][d1] *
2667 face_xi_grads[m][d2] +
2668 polyxi[i][1] * polyeta[j][1] *
2669 (face_xi_grads[m][d1] *
2670 face_eta_grads[m][d2] +
2671 face_xi_grads[m][d2] *
2672 face_eta_grads[m][d1])) +
2673 face_lambda_values[m][q] *
2674 (polyxi[i][3] * polyeta[j][0] *
2675 face_xi_grads[m][d1] *
2676 face_xi_grads[m][d2] *
2677 face_xi_grads[m][d3] +
2678 polyxi[i][1] * polyeta[j][2] *
2679 face_eta_grads[m][d3] *
2680 (face_xi_grads[m][d1] *
2681 face_eta_grads[m][d2] +
2682 face_xi_grads[m][d2] *
2683 face_eta_grads[m][d1]) +
2684 polyxi[i][2] * polyeta[j][1] *
2685 (face_xi_grads[m][d3] *
2686 face_xi_grads[m][d2] *
2687 face_eta_grads[m][d1] +
2688 face_xi_grads[m][d1] *
2689 (face_xi_grads[m][d2] *
2690 face_eta_grads[m][d3] +
2691 face_xi_grads[m][d3] *
2692 face_eta_grads[m][d2])));
2698 const unsigned int dof_index2(face_type2_offset +
2700 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2702 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2704 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2708 face_xi_grads[m][d1] *
2709 (polyxi[i][1] * polyeta[j][1] *
2710 (face_eta_grads[m][d2] *
2711 face_lambda_grads[m][d3] +
2712 face_eta_grads[m][d3] *
2713 face_lambda_grads[m][d2]) +
2714 polyxi[i][2] * polyeta[j][0] *
2715 (face_xi_grads[m][d2] *
2716 face_lambda_grads[m][d3] +
2717 face_xi_grads[m][d3] *
2718 face_lambda_grads[m][d2]) +
2719 face_lambda_values[m][q] *
2720 (face_eta_grads[m][d2] *
2723 face_eta_grads[m][d3] +
2726 face_xi_grads[m][d3]) +
2727 face_xi_grads[m][d2] *
2730 face_eta_grads[m][d3] +
2733 face_xi_grads[m][d3]))) -
2735 face_eta_grads[m][d1] *
2736 (face_eta_grads[m][d2] *
2738 face_eta_grads[m][d3] *
2739 face_lambda_values[m][q] +
2741 face_lambda_grads[m][d3]) +
2743 face_eta_grads[m][d3] *
2744 face_lambda_grads[m][d2]) -
2745 face_eta_grads[m][d1] *
2747 face_xi_grads[m][d3] *
2749 face_eta_grads[m][d2] *
2750 face_lambda_values[m][q] +
2752 face_lambda_grads[m][d2]) +
2753 face_xi_grads[m][d2] *
2756 face_eta_grads[m][d3] *
2757 face_lambda_values[m]
2760 face_lambda_grads[m]
2762 polyxi[i][2] * polyeta[j][1] *
2763 face_xi_grads[m][d3] *
2764 face_lambda_values[m][q]));
2770 const unsigned int dof_index3_1(face_type3_offset1 +
2772 const unsigned int dof_index3_2(face_type3_offset2 +
2774 for (
unsigned int d1 = 0; d1 < dim; ++d1)
2776 for (
unsigned int d2 = 0; d2 < dim; ++d2)
2778 for (
unsigned int d3 = 0; d3 < dim; ++d3)
2782 face_xi_grads[m][d1] *
2783 (face_eta_grads[m][d2] *
2785 face_eta_grads[m][d3] *
2786 face_lambda_values[m][q] +
2788 face_lambda_grads[m][d3]) +
2789 face_lambda_grads[m][d2] *
2791 face_eta_grads[m][d3]);
2795 face_eta_grads[m][d1] *
2796 (face_xi_grads[m][d2] *
2798 face_xi_grads[m][d3] *
2799 face_lambda_values[m][q] +
2801 face_lambda_grads[m][d3]) +
2802 face_lambda_grads[m][d2] *
2803 polyxi[j][1] * face_xi_grads[m][d3]);