51 get_embedding_computation_tolerance(
const unsigned int p)
106 deallog <<
"Face Embedding" << std::endl;
113 const unsigned int face_no = 0;
115 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
119 FETools::compute_face_embedding_matrices<dim, double>(
124 internal::FE_Nedelec::get_embedding_computation_tolerance(order));
139 for (
unsigned int i = 0; i < GeometryInfo<2>::max_children_per_face;
145 k) = face_embeddings[i](j, k);
156 unsigned int target_row = 0;
158 for (
unsigned int i = 0; i < 2; ++i)
159 for (
unsigned int j = this->
degree; j < 2 * this->
degree;
163 face_embeddings[2 * i](j, k);
165 for (
unsigned int i = 0; i < 2; ++i)
166 for (
unsigned int j = 3 * this->degree;
167 j < GeometryInfo<3>::lines_per_face * this->
degree;
171 face_embeddings[i](j, k);
173 for (
unsigned int i = 0; i < 2; ++i)
174 for (
unsigned int j = 0; j < 2; ++j)
175 for (
unsigned int k = i * this->degree;
176 k < (i + 1) * this->degree;
181 face_embeddings[i + 2 * j](k,
l);
183 for (
unsigned int i = 0; i < 2; ++i)
184 for (
unsigned int j = 0; j < 2; ++j)
185 for (
unsigned int k = (i + 2) * this->
degree;
186 k < (i + 3) * this->degree;
191 face_embeddings[2 * i + j](k,
l);
193 for (
unsigned int i = 0; i < GeometryInfo<3>::max_children_per_face;
195 for (
unsigned int j =
201 face_embeddings[i](j, k);
240 std::ostringstream namebuf;
241 namebuf <<
"FE_Nedelec<" << dim <<
">(" << this->degree - 1 <<
")";
243 return namebuf.str();
248std::unique_ptr<FiniteElement<dim, dim>>
251 return std::make_unique<FE_Nedelec<dim>>(*this);
284 const unsigned int face_no = 0;
287 const std::vector<Polynomials::Polynomial<double>> &lobatto_polynomials =
289 std::vector<Polynomials::Polynomial<double>> lobatto_polynomials_grad(order +
292 for (
unsigned int i = 0; i < lobatto_polynomials_grad.size(); ++i)
293 lobatto_polynomials_grad[i] = lobatto_polynomials[i + 1].derivative();
297 const QGauss<dim - 1> reference_edge_quadrature(order + 1);
298 const unsigned int n_edge_points = reference_edge_quadrature.size();
299 const unsigned int n_boundary_points =
303 reference_edge_quadrature);
305 this->generalized_face_support_points[face_no].resize(n_edge_points);
308 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
309 this->generalized_face_support_points[face_no][q_point] =
310 reference_edge_quadrature.point(q_point);
318 const unsigned int n_interior_points = quadrature.
size();
320 this->generalized_support_points.resize(n_boundary_points +
322 boundary_weights.reinit(n_edge_points, order);
324 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
326 for (
unsigned int line = 0; line < GeometryInfo<dim>::lines_per_cell;
328 this->generalized_support_points[line * n_edge_points + q_point] =
329 edge_quadrature.
point(
338 for (
unsigned int i = 0; i < order; ++i)
339 boundary_weights(q_point, i) =
340 reference_edge_quadrature.weight(q_point) *
341 lobatto_polynomials_grad[i + 1].value(
342 this->generalized_face_support_points[face_no][q_point](0));
345 for (
unsigned int q_point = 0; q_point < n_interior_points; ++q_point)
346 this->generalized_support_points[q_point + n_boundary_points] =
347 quadrature.
point(q_point);
354 this->generalized_support_points.resize(n_boundary_points);
356 for (
unsigned int line = 0; line < GeometryInfo<dim>::lines_per_cell;
358 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
359 this->generalized_support_points[line * n_edge_points + q_point] =
360 edge_quadrature.
point(
382 const unsigned int face_no = 0;
385 const std::vector<Polynomials::Polynomial<double>> &lobatto_polynomials =
387 std::vector<Polynomials::Polynomial<double>> lobatto_polynomials_grad(order +
390 for (
unsigned int i = 0; i < lobatto_polynomials_grad.size(); ++i)
391 lobatto_polynomials_grad[i] = lobatto_polynomials[i + 1].derivative();
395 const QGauss<1> reference_edge_quadrature(order + 1);
396 const unsigned int n_edge_points = reference_edge_quadrature.
size();
399 ReferenceCells::get_hypercube<dim - 1>(), reference_edge_quadrature);
406 const QGauss<dim - 1> reference_face_quadrature(order + 1);
407 const unsigned int n_face_points = reference_face_quadrature.size();
408 const unsigned int n_boundary_points =
412 const unsigned int n_interior_points = quadrature.
size();
414 boundary_weights.reinit(n_edge_points + n_face_points,
415 2 * (order + 1) * order);
416 this->generalized_face_support_points[face_no].resize(4 * n_edge_points +
418 this->generalized_support_points.resize(n_boundary_points +
422 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
424 for (
unsigned int line = 0;
428 ->generalized_face_support_points[face_no][line * n_edge_points +
430 edge_quadrature.point(
432 ReferenceCells::get_hypercube<dim - 1>(),
440 for (
unsigned int i = 0; i < 2; ++i)
441 for (
unsigned int j = 0; j < 2; ++j)
443 this->generalized_support_points[q_point +
444 (i + 4 * j) * n_edge_points] =
446 this->generalized_support_points[q_point + (i + 4 * j + 2) *
449 this->generalized_support_points[q_point + (i + 2 * (j + 4)) *
454 for (
unsigned int i = 0; i < order; ++i)
455 boundary_weights(q_point, i) =
456 reference_edge_quadrature.
weight(q_point) *
457 lobatto_polynomials_grad[i + 1].value(
458 this->generalized_face_support_points[face_no][q_point](1));
462 for (
unsigned int q_point = 0; q_point < n_face_points; ++q_point)
464 this->generalized_face_support_points[face_no]
465 [q_point + 4 * n_edge_points] =
466 reference_face_quadrature.point(q_point);
468 for (
unsigned int i = 0; i <= order; ++i)
469 for (
unsigned int j = 0; j < order; ++j)
471 boundary_weights(q_point + n_edge_points, 2 * (i * order + j)) =
472 reference_face_quadrature.weight(q_point) *
473 lobatto_polynomials_grad[i].value(
474 this->generalized_face_support_points
475 [face_no][q_point + 4 * n_edge_points](0)) *
476 lobatto_polynomials[j + 2].value(
477 this->generalized_face_support_points
478 [face_no][q_point + 4 * n_edge_points](1));
479 boundary_weights(q_point + n_edge_points,
480 2 * (i * order + j) + 1) =
481 reference_face_quadrature.weight(q_point) *
482 lobatto_polynomials_grad[i].value(
483 this->generalized_face_support_points
484 [face_no][q_point + 4 * n_edge_points](1)) *
485 lobatto_polynomials[j + 2].value(
486 this->generalized_face_support_points
487 [face_no][q_point + 4 * n_edge_points](0));
493 reference_face_quadrature);
496 for (
unsigned int q_point = 0; q_point < n_face_points; ++q_point)
498 this->generalized_support_points[face * n_face_points + q_point +
501 face_quadrature.
point(
512 for (
unsigned int q_point = 0; q_point < n_interior_points; ++q_point)
513 this->generalized_support_points[q_point + n_boundary_points] =
514 quadrature.
point(q_point);
519 this->generalized_face_support_points[face_no].resize(4 * n_edge_points);
520 this->generalized_support_points.resize(
523 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
525 for (
unsigned int line = 0;
529 ->generalized_face_support_points[face_no][line * n_edge_points +
531 edge_quadrature.point(
533 ReferenceCells::get_hypercube<dim - 1>(),
541 for (
unsigned int i = 0; i < 2; ++i)
542 for (
unsigned int j = 0; j < 2; ++j)
544 this->generalized_support_points[q_point +
545 (i + 4 * j) * n_edge_points] =
547 this->generalized_support_points[q_point + (i + 4 * j + 2) *
550 this->generalized_support_points[q_point + (i + 2 * (j + 4)) *
567 for (
unsigned int i = 0; i < GeometryInfo<1>::max_children_per_cell; ++i)
568 this->restriction[0][i].
reinit(0, 0);
584 const QGauss<1> edge_quadrature(2 * this->degree);
585 const std::vector<Point<1>> &edge_quadrature_points =
587 const unsigned int n_edge_quadrature_points = edge_quadrature.
size();
598 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
599 for (
unsigned int q_point = 0; q_point < n_edge_quadrature_points;
602 const double weight = 2.0 * edge_quadrature.
weight(q_point);
604 if (edge_quadrature_points[q_point](0) < 0.5)
607 0.0, 2.0 * edge_quadrature_points[q_point](0));
609 this->restriction[index][0](0, dof) +=
611 this->shape_value_component(dof, quadrature_point, 1);
612 quadrature_point(0) = 1.0;
613 this->restriction[index][1](this->degree, dof) +=
615 this->shape_value_component(dof, quadrature_point, 1);
616 quadrature_point(0) = quadrature_point(1);
617 quadrature_point(1) = 0.0;
618 this->restriction[index][0](2 * this->degree, dof) +=
620 this->shape_value_component(dof, quadrature_point, 0);
621 quadrature_point(1) = 1.0;
622 this->restriction[index][2](3 * this->degree, dof) +=
624 this->shape_value_component(dof, quadrature_point, 0);
630 0.0, 2.0 * edge_quadrature_points[q_point](0) - 1.0);
632 this->restriction[index][2](0, dof) +=
634 this->shape_value_component(dof, quadrature_point, 1);
635 quadrature_point(0) = 1.0;
636 this->restriction[index][3](this->degree, dof) +=
638 this->shape_value_component(dof, quadrature_point, 1);
639 quadrature_point(0) = quadrature_point(1);
640 quadrature_point(1) = 0.0;
641 this->restriction[index][1](2 * this->degree, dof) +=
643 this->shape_value_component(dof, quadrature_point, 0);
644 quadrature_point(1) = 1.0;
645 this->restriction[index][3](3 * this->degree, dof) +=
647 this->shape_value_component(dof, quadrature_point, 0);
655 if (this->degree > 1)
657 const unsigned int deg = this->degree - 1;
658 const std::vector<Polynomials::Polynomial<double>>
659 &legendre_polynomials =
665 n_edge_quadrature_points);
667 for (
unsigned int q_point = 0;
668 q_point < n_edge_quadrature_points;
671 const double weight =
674 for (
unsigned int i = 0; i < deg; ++i)
675 assembling_matrix(i, q_point) =
676 weight * legendre_polynomials[i + 1].value(
677 edge_quadrature_points[q_point](0));
682 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
683 system_matrix_inv.
invert(system_matrix);
690 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
691 for (
unsigned int i = 0; i < 2; ++i)
695 for (
unsigned int q_point = 0;
696 q_point < n_edge_quadrature_points;
699 const double weight = edge_quadrature.
weight(q_point);
701 i, edge_quadrature_points[q_point](0));
703 edge_quadrature_points[q_point](0), i);
705 if (edge_quadrature_points[q_point](0) < 0.5)
708 i, 2.0 * edge_quadrature_points[q_point](0));
712 (2.0 * this->shape_value_component(
713 dof, quadrature_point_2, 1) -
714 this->restriction[index][i](i * this->degree,
716 this->shape_value_component(i * this->degree,
721 this->restriction[index][i + 2](i * this->degree,
723 this->shape_value_component(i * this->degree,
727 2.0 * edge_quadrature_points[q_point](0), i);
730 (2.0 * this->shape_value_component(
731 dof, quadrature_point_2, 0) -
732 this->restriction[index][2 * i]((i + 2) *
735 this->shape_value_component((i + 2) *
741 this->restriction[index][2 * i + 1](
742 (i + 2) * this->degree, dof) *
743 this->shape_value_component(
744 (i + 2) * this->degree, quadrature_point_1, 0);
751 this->restriction[index][i](i * this->degree,
753 this->shape_value_component(i * this->degree,
759 2.0 * edge_quadrature_points[q_point](0) - 1.0);
763 (2.0 * this->shape_value_component(
764 dof, quadrature_point_2, 1) -
765 this->restriction[index][i + 2](i * this->degree,
767 this->shape_value_component(i * this->degree,
772 this->restriction[index][2 * i]((i + 2) *
775 this->shape_value_component(
776 (i + 2) * this->degree, quadrature_point_1, 0);
778 2.0 * edge_quadrature_points[q_point](0) - 1.0,
782 (2.0 * this->shape_value_component(
783 dof, quadrature_point_2, 0) -
784 this->restriction[index][2 * i + 1](
785 (i + 2) * this->degree, dof) *
786 this->shape_value_component((i + 2) *
792 for (
unsigned int j = 0; j < this->degree - 1; ++j)
795 legendre_polynomials[j + 1].value(
796 edge_quadrature_points[q_point](0));
798 for (
unsigned int k = 0; k < tmp.
size(); ++k)
799 system_rhs(j, k) += tmp(k) * L_j;
803 system_matrix_inv.
mmult(solution, system_rhs);
805 for (
unsigned int j = 0; j < this->degree - 1; ++j)
806 for (
unsigned int k = 0; k < 2; ++k)
809 this->restriction[index][i + 2 * k](
810 i * this->degree + j + 1, dof) = solution(j, k);
812 if (
std::abs(solution(j, k + 2)) > 1
e-14)
813 this->restriction[index][2 * i + k](
814 (i + 2) * this->degree + j + 1, dof) =
822 const std::vector<Polynomials::Polynomial<double>>
823 &lobatto_polynomials =
825 const unsigned int n_boundary_dofs =
827 const unsigned int n_quadrature_points = quadrature.
size();
832 n_quadrature_points);
834 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
839 for (
unsigned int i = 0; i < this->degree; ++i)
842 weight * legendre_polynomials[i].value(
845 for (
unsigned int j = 0; j < this->degree - 1; ++j)
846 assembling_matrix(i * (this->degree - 1) + j,
848 L_i * lobatto_polynomials[j + 2].value(
854 assembling_matrix.
m());
856 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
857 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
858 system_matrix_inv.
invert(system_matrix);
861 solution.reinit(system_matrix_inv.
m(), 8);
862 system_rhs.reinit(system_matrix_inv.
m(), 8);
865 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
869 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
882 tmp(0) += 2.0 * this->shape_value_component(
883 dof, quadrature_point, 0);
884 tmp(1) += 2.0 * this->shape_value_component(
885 dof, quadrature_point, 1);
894 tmp(4) += 2.0 * this->shape_value_component(
895 dof, quadrature_point, 0);
896 tmp(5) += 2.0 * this->shape_value_component(
897 dof, quadrature_point, 1);
908 2.0 * this->shape_value_component(dof,
912 2.0 * this->shape_value_component(dof,
924 2.0 * this->shape_value_component(dof,
928 2.0 * this->shape_value_component(dof,
933 for (
unsigned int i = 0; i < 2; ++i)
934 for (
unsigned int j = 0; j < this->degree; ++j)
937 this->restriction[index][i](j + 2 * this->degree,
939 this->shape_value_component(
940 j + 2 * this->degree,
944 this->restriction[index][i](i * this->degree + j,
946 this->shape_value_component(
947 i * this->degree + j,
950 tmp(2 * (i + 2)) -= this->restriction[index][i + 2](
951 j + 3 * this->degree, dof) *
952 this->shape_value_component(
953 j + 3 * this->degree,
956 tmp(2 * i + 5) -= this->restriction[index][i + 2](
957 i * this->degree + j, dof) *
958 this->shape_value_component(
959 i * this->degree + j,
964 tmp *= quadrature.
weight(q_point);
966 for (
unsigned int i = 0; i < this->degree; ++i)
968 const double L_i_0 = legendre_polynomials[i].value(
970 const double L_i_1 = legendre_polynomials[i].value(
973 for (
unsigned int j = 0; j < this->degree - 1; ++j)
976 L_i_0 * lobatto_polynomials[j + 2].value(
979 L_i_1 * lobatto_polynomials[j + 2].value(
982 for (
unsigned int k = 0; k < 4; ++k)
984 system_rhs(i * (this->degree - 1) + j,
985 2 * k) += tmp(2 * k) * l_j_0;
986 system_rhs(i * (this->degree - 1) + j,
988 tmp(2 * k + 1) * l_j_1;
994 system_matrix_inv.
mmult(solution, system_rhs);
996 for (
unsigned int i = 0; i < this->degree; ++i)
997 for (
unsigned int j = 0; j < this->degree - 1; ++j)
998 for (
unsigned int k = 0; k < 4; ++k)
1000 if (
std::abs(solution(i * (this->degree - 1) + j,
1002 this->restriction[index][k](i * (this->degree - 1) +
1003 j + n_boundary_dofs,
1005 solution(i * (this->degree - 1) + j, 2 * k);
1007 if (
std::abs(solution(i * (this->degree - 1) + j,
1008 2 * k + 1)) > 1
e-14)
1009 this->restriction[index][k](
1010 i + (this->degree - 1 + j) * this->degree +
1013 solution(i * (this->degree - 1) + j, 2 * k + 1);
1027 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
1028 for (
unsigned int q_point = 0; q_point < n_edge_quadrature_points;
1031 const double weight = 2.0 * edge_quadrature.
weight(q_point);
1033 if (edge_quadrature_points[q_point](0) < 0.5)
1034 for (
unsigned int i = 0; i < 2; ++i)
1035 for (
unsigned int j = 0; j < 2; ++j)
1038 i, 2.0 * edge_quadrature_points[q_point](0), j);
1040 this->restriction[index][i + 4 * j]((i + 4 * j) *
1044 this->shape_value_component(dof, quadrature_point, 1);
1046 Point<dim>(2.0 * edge_quadrature_points[q_point](0),
1049 this->restriction[index][2 * (i + 2 * j)](
1050 (i + 4 * j + 2) * this->degree, dof) +=
1052 this->shape_value_component(dof, quadrature_point, 0);
1056 2.0 * edge_quadrature_points[q_point](0));
1057 this->restriction[index][i + 2 * j]((i + 2 * (j + 4)) *
1061 this->shape_value_component(dof, quadrature_point, 2);
1065 for (
unsigned int i = 0; i < 2; ++i)
1066 for (
unsigned int j = 0; j < 2; ++j)
1069 i, 2.0 * edge_quadrature_points[q_point](0) - 1.0, j);
1071 this->restriction[index][i + 4 * j + 2]((i + 4 * j) *
1075 this->shape_value_component(dof, quadrature_point, 1);
1077 2.0 * edge_quadrature_points[q_point](0) - 1.0, i, j);
1078 this->restriction[index][2 * (i + 2 * j) + 1](
1079 (i + 4 * j + 2) * this->degree, dof) +=
1081 this->shape_value_component(dof, quadrature_point, 0);
1083 i, j, 2.0 * edge_quadrature_points[q_point](0) - 1.0);
1084 this->restriction[index][i + 2 * (j + 2)](
1085 (i + 2 * (j + 4)) * this->degree, dof) +=
1087 this->shape_value_component(dof, quadrature_point, 2);
1095 if (this->degree > 1)
1097 const unsigned int deg = this->degree - 1;
1098 const std::vector<Polynomials::Polynomial<double>>
1099 &legendre_polynomials =
1105 n_edge_quadrature_points);
1107 for (
unsigned int q_point = 0;
1108 q_point < n_edge_quadrature_points;
1111 const double weight =
1114 for (
unsigned int i = 0; i < deg; ++i)
1115 assembling_matrix(i, q_point) =
1116 weight * legendre_polynomials[i + 1].value(
1117 edge_quadrature_points[q_point](0));
1122 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
1123 system_matrix_inv.
invert(system_matrix);
1130 for (
unsigned int i = 0; i < 2; ++i)
1131 for (
unsigned int j = 0; j < 2; ++j)
1132 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell();
1137 for (
unsigned int q_point = 0;
1138 q_point < n_edge_quadrature_points;
1141 const double weight = edge_quadrature.
weight(q_point);
1143 i, edge_quadrature_points[q_point](0), j);
1145 edge_quadrature_points[q_point](0), i, j);
1147 i, j, edge_quadrature_points[q_point](0));
1149 if (edge_quadrature_points[q_point](0) < 0.5)
1152 i, 2.0 * edge_quadrature_points[q_point](0), j);
1155 weight * (2.0 * this->shape_value_component(
1156 dof, quadrature_point_3, 1) -
1157 this->restriction[index][i + 4 * j](
1158 (i + 4 * j) * this->degree, dof) *
1159 this->shape_value_component(
1160 (i + 4 * j) * this->degree,
1165 this->restriction[index][i + 4 * j + 2](
1166 (i + 4 * j) * this->degree, dof) *
1167 this->shape_value_component((i + 4 * j) *
1172 2.0 * edge_quadrature_points[q_point](0), i, j);
1175 (2.0 * this->shape_value_component(
1176 dof, quadrature_point_3, 0) -
1177 this->restriction[index][2 * (i + 2 * j)](
1178 (i + 4 * j + 2) * this->degree, dof) *
1179 this->shape_value_component(
1180 (i + 4 * j + 2) * this->degree,
1185 this->restriction[index][2 * (i + 2 * j) + 1](
1186 (i + 4 * j + 2) * this->degree, dof) *
1187 this->shape_value_component((i + 4 * j + 2) *
1192 i, j, 2.0 * edge_quadrature_points[q_point](0));
1195 (2.0 * this->shape_value_component(
1196 dof, quadrature_point_3, 2) -
1197 this->restriction[index][i + 2 * j](
1198 (i + 2 * (j + 4)) * this->degree, dof) *
1199 this->shape_value_component(
1200 (i + 2 * (j + 4)) * this->degree,
1205 this->restriction[index][i + 2 * (j + 2)](
1206 (i + 2 * (j + 4)) * this->degree, dof) *
1207 this->shape_value_component((i + 2 * (j + 4)) *
1217 this->restriction[index][i + 4 * j](
1218 (i + 4 * j) * this->degree, dof) *
1219 this->shape_value_component((i + 4 * j) *
1226 2.0 * edge_quadrature_points[q_point](0) - 1.0,
1230 (2.0 * this->shape_value_component(
1231 dof, quadrature_point_3, 1) -
1232 this->restriction[index][i + 4 * j + 2](
1233 (i + 4 * j) * this->degree, dof) *
1234 this->shape_value_component(
1235 (i + 4 * j) * this->degree,
1240 this->restriction[index][2 * (i + 2 * j)](
1241 (i + 4 * j + 2) * this->degree, dof) *
1242 this->shape_value_component((i + 4 * j + 2) *
1247 2.0 * edge_quadrature_points[q_point](0) - 1.0,
1252 (2.0 * this->shape_value_component(
1253 dof, quadrature_point_3, 0) -
1254 this->restriction[index][2 * (i + 2 * j) + 1](
1255 (i + 4 * j + 2) * this->degree, dof) *
1256 this->shape_value_component(
1257 (i + 4 * j + 2) * this->degree,
1262 this->restriction[index][i + 2 * j](
1263 (i + 2 * (j + 4)) * this->degree, dof) *
1264 this->shape_value_component((i + 2 * (j + 4)) *
1271 2.0 * edge_quadrature_points[q_point](0) - 1.0);
1274 (2.0 * this->shape_value_component(
1275 dof, quadrature_point_3, 2) -
1276 this->restriction[index][i + 2 * (j + 2)](
1277 (i + 2 * (j + 4)) * this->degree, dof) *
1278 this->shape_value_component(
1279 (i + 2 * (j + 4)) * this->degree,
1284 for (
unsigned int k = 0; k < deg; ++k)
1287 legendre_polynomials[k + 1].value(
1288 edge_quadrature_points[q_point](0));
1290 for (
unsigned int l = 0;
l < tmp.
size(); ++
l)
1291 system_rhs(k,
l) += tmp(
l) * L_k;
1295 system_matrix_inv.
mmult(solution, system_rhs);
1297 for (
unsigned int k = 0; k < 2; ++k)
1298 for (
unsigned int l = 0;
l < deg; ++
l)
1301 this->restriction[index][i + 2 * (2 * j + k)](
1302 (i + 4 * j) * this->degree +
l + 1, dof) =
1306 this->restriction[index][2 * (i + 2 * j) + k](
1307 (i + 4 * j + 2) * this->degree +
l + 1, dof) =
1311 this->restriction[index][i + 2 * (j + 2 * k)](
1312 (i + 2 * (j + 4)) * this->degree +
l + 1, dof) =
1317 const QGauss<2> face_quadrature(2 * this->degree);
1318 const std::vector<Point<2>> &face_quadrature_points =
1320 const std::vector<Polynomials::Polynomial<double>>
1321 &lobatto_polynomials =
1323 const unsigned int n_edge_dofs =
1325 const unsigned int n_face_quadrature_points =
1326 face_quadrature.
size();
1330 n_face_quadrature_points);
1332 for (
unsigned int q_point = 0;
1333 q_point < n_face_quadrature_points;
1336 const double weight =
1339 for (
unsigned int i = 0; i <= deg; ++i)
1342 weight * legendre_polynomials[i].value(
1343 face_quadrature_points[q_point](0));
1345 for (
unsigned int j = 0; j < deg; ++j)
1346 assembling_matrix(i * deg + j, q_point) =
1347 L_i * lobatto_polynomials[j + 2].value(
1348 face_quadrature_points[q_point](1));
1353 assembling_matrix.
m());
1355 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
1356 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
1357 system_matrix_inv.
invert(system_matrix);
1360 solution.reinit(system_matrix_inv.
m(), 24);
1361 system_rhs.reinit(system_matrix_inv.
m(), 24);
1364 for (
unsigned int i = 0; i < 2; ++i)
1365 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
1369 for (
unsigned int q_point = 0;
1370 q_point < n_face_quadrature_points;
1375 if (face_quadrature_points[q_point](0) < 0.5)
1377 if (face_quadrature_points[q_point](1) < 0.5)
1381 2.0 * face_quadrature_points[q_point](0),
1382 2.0 * face_quadrature_points[q_point](1));
1384 tmp(0) += 2.0 * this->shape_value_component(
1385 dof, quadrature_point_0, 1);
1386 tmp(1) += 2.0 * this->shape_value_component(
1387 dof, quadrature_point_0, 2);
1389 2.0 * face_quadrature_points[q_point](0),
1391 2.0 * face_quadrature_points[q_point](1));
1392 tmp(8) += 2.0 * this->shape_value_component(
1393 dof, quadrature_point_0, 2);
1394 tmp(9) += 2.0 * this->shape_value_component(
1395 dof, quadrature_point_0, 0);
1397 2.0 * face_quadrature_points[q_point](0),
1398 2.0 * face_quadrature_points[q_point](1),
1400 tmp(16) += 2.0 * this->shape_value_component(
1401 dof, quadrature_point_0, 0);
1402 tmp(17) += 2.0 * this->shape_value_component(
1403 dof, quadrature_point_0, 1);
1410 2.0 * face_quadrature_points[q_point](0),
1411 2.0 * face_quadrature_points[q_point](1) -
1414 tmp(2) += 2.0 * this->shape_value_component(
1415 dof, quadrature_point_0, 1);
1416 tmp(3) += 2.0 * this->shape_value_component(
1417 dof, quadrature_point_0, 2);
1419 2.0 * face_quadrature_points[q_point](0),
1421 2.0 * face_quadrature_points[q_point](1) -
1423 tmp(10) += 2.0 * this->shape_value_component(
1424 dof, quadrature_point_0, 2);
1425 tmp(11) += 2.0 * this->shape_value_component(
1426 dof, quadrature_point_0, 0);
1428 2.0 * face_quadrature_points[q_point](0),
1429 2.0 * face_quadrature_points[q_point](1) -
1432 tmp(18) += 2.0 * this->shape_value_component(
1433 dof, quadrature_point_0, 0);
1434 tmp(19) += 2.0 * this->shape_value_component(
1435 dof, quadrature_point_0, 1);
1439 else if (face_quadrature_points[q_point](1) < 0.5)
1443 2.0 * face_quadrature_points[q_point](0) - 1.0,
1444 2.0 * face_quadrature_points[q_point](1));
1446 tmp(4) += 2.0 * this->shape_value_component(
1447 dof, quadrature_point_0, 1);
1448 tmp(5) += 2.0 * this->shape_value_component(
1449 dof, quadrature_point_0, 2);
1451 2.0 * face_quadrature_points[q_point](0) - 1.0,
1453 2.0 * face_quadrature_points[q_point](1));
1454 tmp(12) += 2.0 * this->shape_value_component(
1455 dof, quadrature_point_0, 2);
1456 tmp(13) += 2.0 * this->shape_value_component(
1457 dof, quadrature_point_0, 0);
1459 2.0 * face_quadrature_points[q_point](0) - 1.0,
1460 2.0 * face_quadrature_points[q_point](1),
1462 tmp(20) += 2.0 * this->shape_value_component(
1463 dof, quadrature_point_0, 0);
1464 tmp(21) += 2.0 * this->shape_value_component(
1465 dof, quadrature_point_0, 1);
1472 2.0 * face_quadrature_points[q_point](0) - 1.0,
1473 2.0 * face_quadrature_points[q_point](1) - 1.0);
1475 tmp(6) += 2.0 * this->shape_value_component(
1476 dof, quadrature_point_0, 1);
1477 tmp(7) += 2.0 * this->shape_value_component(
1478 dof, quadrature_point_0, 2);
1480 2.0 * face_quadrature_points[q_point](0) - 1.0,
1482 2.0 * face_quadrature_points[q_point](1) - 1.0);
1483 tmp(14) += 2.0 * this->shape_value_component(
1484 dof, quadrature_point_0, 2);
1485 tmp(15) += 2.0 * this->shape_value_component(
1486 dof, quadrature_point_0, 0);
1488 2.0 * face_quadrature_points[q_point](0) - 1.0,
1489 2.0 * face_quadrature_points[q_point](1) - 1.0,
1491 tmp(22) += 2.0 * this->shape_value_component(
1492 dof, quadrature_point_0, 0);
1493 tmp(23) += 2.0 * this->shape_value_component(
1494 dof, quadrature_point_0, 1);
1499 face_quadrature_points[q_point](0),
1500 face_quadrature_points[q_point](1));
1502 face_quadrature_points[q_point](0),
1504 face_quadrature_points[q_point](1));
1506 face_quadrature_points[q_point](0),
1507 face_quadrature_points[q_point](1),
1510 for (
unsigned int j = 0; j < 2; ++j)
1511 for (
unsigned int k = 0; k < 2; ++k)
1512 for (
unsigned int l = 0;
l <= deg; ++
l)
1514 tmp(2 * (j + 2 * k)) -=
1515 this->restriction[index][i + 2 * (2 * j + k)](
1516 (i + 4 * j) * this->degree +
l, dof) *
1517 this->shape_value_component(
1518 (i + 4 * j) * this->degree +
l,
1521 tmp(2 * (j + 2 * k) + 1) -=
1522 this->restriction[index][i + 2 * (2 * j + k)](
1523 (i + 2 * (k + 4)) * this->degree +
l, dof) *
1524 this->shape_value_component(
1525 (i + 2 * (k + 4)) * this->degree +
l,
1528 tmp(2 * (j + 2 * (k + 2))) -=
1529 this->restriction[index][2 * (i + 2 * j) + k](
1530 (2 * (i + 4) + k) * this->degree +
l, dof) *
1531 this->shape_value_component(
1532 (2 * (i + 4) + k) * this->degree +
l,
1535 tmp(2 * (j + 2 * k) + 9) -=
1536 this->restriction[index][2 * (i + 2 * j) + k](
1537 (i + 4 * j + 2) * this->degree +
l, dof) *
1538 this->shape_value_component(
1539 (i + 4 * j + 2) * this->degree +
l,
1542 tmp(2 * (j + 2 * (k + 4))) -=
1543 this->restriction[index][2 * (2 * i + j) + k](
1544 (4 * i + j + 2) * this->degree +
l, dof) *
1545 this->shape_value_component(
1546 (4 * i + j + 2) * this->degree +
l,
1549 tmp(2 * (j + 2 * k) + 17) -=
1550 this->restriction[index][2 * (2 * i + j) + k](
1551 (4 * i + k) * this->degree +
l, dof) *
1552 this->shape_value_component(
1553 (4 * i + k) * this->degree +
l,
1558 tmp *= face_quadrature.
weight(q_point);
1560 for (
unsigned int j = 0; j <= deg; ++j)
1562 const double L_j_0 = legendre_polynomials[j].value(
1563 face_quadrature_points[q_point](0));
1564 const double L_j_1 = legendre_polynomials[j].value(
1565 face_quadrature_points[q_point](1));
1567 for (
unsigned int k = 0; k < deg; ++k)
1569 const double l_k_0 =
1570 L_j_0 * lobatto_polynomials[k + 2].value(
1571 face_quadrature_points[q_point](1));
1572 const double l_k_1 =
1573 L_j_1 * lobatto_polynomials[k + 2].value(
1574 face_quadrature_points[q_point](0));
1576 for (
unsigned int l = 0;
l < 4; ++
l)
1578 system_rhs(j * deg + k, 2 *
l) +=
1580 system_rhs(j * deg + k, 2 *
l + 1) +=
1581 tmp(2 *
l + 1) * l_k_1;
1582 system_rhs(j * deg + k, 2 * (
l + 4)) +=
1583 tmp(2 * (
l + 4)) * l_k_1;
1584 system_rhs(j * deg + k, 2 *
l + 9) +=
1585 tmp(2 *
l + 9) * l_k_0;
1586 system_rhs(j * deg + k, 2 * (
l + 8)) +=
1587 tmp(2 * (
l + 8)) * l_k_0;
1588 system_rhs(j * deg + k, 2 *
l + 17) +=
1589 tmp(2 *
l + 17) * l_k_1;
1595 system_matrix_inv.
mmult(solution, system_rhs);
1597 for (
unsigned int j = 0; j < 2; ++j)
1598 for (
unsigned int k = 0; k < 2; ++k)
1599 for (
unsigned int l = 0;
l <= deg; ++
l)
1600 for (
unsigned int m = 0; m < deg; ++m)
1603 2 * (j + 2 * k))) > 1
e-14)
1604 this->restriction[index][i + 2 * (2 * j + k)](
1605 (2 * i * this->degree +
l) * deg + m +
1607 dof) = solution(
l * deg + m, 2 * (j + 2 * k));
1610 2 * (j + 2 * k) + 1)) >
1612 this->restriction[index][i + 2 * (2 * j + k)](
1613 ((2 * i + 1) * deg + m) * this->degree +
l +
1616 solution(
l * deg + m, 2 * (j + 2 * k) + 1);
1619 2 * (j + 2 * (k + 2)))) >
1621 this->restriction[index][2 * (i + 2 * j) + k](
1622 (2 * (i + 2) * this->degree +
l) * deg + m +
1625 solution(
l * deg + m, 2 * (j + 2 * (k + 2)));
1628 2 * (j + 2 * k) + 9)) >
1630 this->restriction[index][2 * (i + 2 * j) + k](
1631 ((2 * i + 5) * deg + m) * this->degree +
l +
1634 solution(
l * deg + m, 2 * (j + 2 * k) + 9);
1637 2 * (j + 2 * (k + 4)))) >
1639 this->restriction[index][2 * (2 * i + j) + k](
1640 (2 * (i + 4) * this->degree +
l) * deg + m +
1643 solution(
l * deg + m, 2 * (j + 2 * (k + 4)));
1646 2 * (j + 2 * k) + 17)) >
1648 this->restriction[index][2 * (2 * i + j) + k](
1649 ((2 * i + 9) * deg + m) * this->degree +
l +
1652 solution(
l * deg + m, 2 * (j + 2 * k) + 17);
1659 const unsigned int n_boundary_dofs =
1662 const unsigned int n_quadrature_points = quadrature.
size();
1666 n_quadrature_points);
1668 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1673 for (
unsigned int i = 0; i <= deg; ++i)
1676 weight * legendre_polynomials[i].value(
1679 for (
unsigned int j = 0; j < deg; ++j)
1682 L_i * lobatto_polynomials[j + 2].value(
1685 for (
unsigned int k = 0; k < deg; ++k)
1686 assembling_matrix((i * deg + j) * deg + k,
1688 l_j * lobatto_polynomials[k + 2].value(
1695 assembling_matrix.
m());
1697 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
1698 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
1699 system_matrix_inv.
invert(system_matrix);
1702 solution.reinit(system_matrix_inv.
m(), 24);
1703 system_rhs.reinit(system_matrix_inv.
m(), 24);
1706 for (
unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof)
1710 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1726 tmp(0) += 2.0 * this->shape_value_component(
1727 dof, quadrature_point, 0);
1728 tmp(1) += 2.0 * this->shape_value_component(
1729 dof, quadrature_point, 1);
1730 tmp(2) += 2.0 * this->shape_value_component(
1731 dof, quadrature_point, 2);
1741 tmp(3) += 2.0 * this->shape_value_component(
1742 dof, quadrature_point, 0);
1743 tmp(4) += 2.0 * this->shape_value_component(
1744 dof, quadrature_point, 1);
1745 tmp(5) += 2.0 * this->shape_value_component(
1746 dof, quadrature_point, 2);
1757 tmp(6) += 2.0 * this->shape_value_component(
1758 dof, quadrature_point, 0);
1759 tmp(7) += 2.0 * this->shape_value_component(
1760 dof, quadrature_point, 1);
1761 tmp(8) += 2.0 * this->shape_value_component(
1762 dof, quadrature_point, 2);
1772 tmp(9) += 2.0 * this->shape_value_component(
1773 dof, quadrature_point, 0);
1774 tmp(10) += 2.0 * this->shape_value_component(
1775 dof, quadrature_point, 1);
1776 tmp(11) += 2.0 * this->shape_value_component(
1777 dof, quadrature_point, 2);
1790 tmp(12) += 2.0 * this->shape_value_component(
1791 dof, quadrature_point, 0);
1792 tmp(13) += 2.0 * this->shape_value_component(
1793 dof, quadrature_point, 1);
1794 tmp(14) += 2.0 * this->shape_value_component(
1795 dof, quadrature_point, 2);
1805 tmp(15) += 2.0 * this->shape_value_component(
1806 dof, quadrature_point, 0);
1807 tmp(16) += 2.0 * this->shape_value_component(
1808 dof, quadrature_point, 1);
1809 tmp(17) += 2.0 * this->shape_value_component(
1810 dof, quadrature_point, 2);
1822 2.0 * this->shape_value_component(dof,
1826 2.0 * this->shape_value_component(dof,
1830 2.0 * this->shape_value_component(dof,
1843 2.0 * this->shape_value_component(dof,
1847 2.0 * this->shape_value_component(dof,
1851 2.0 * this->shape_value_component(dof,
1856 for (
unsigned int i = 0; i < 2; ++i)
1857 for (
unsigned int j = 0; j < 2; ++j)
1858 for (
unsigned int k = 0; k < 2; ++k)
1859 for (
unsigned int l = 0;
l <= deg; ++
l)
1861 tmp(3 * (i + 2 * (j + 2 * k))) -=
1862 this->restriction[index][2 * (2 * i + j) + k](
1863 (4 * i + j + 2) * this->degree +
l, dof) *
1864 this->shape_value_component(
1865 (4 * i + j + 2) * this->degree +
l,
1868 tmp(3 * (i + 2 * (j + 2 * k)) + 1) -=
1869 this->restriction[index][2 * (2 * i + j) + k](
1870 (4 * i + k) * this->degree +
l, dof) *
1871 this->shape_value_component(
1872 (4 * i + k) * this->degree +
l,
1875 tmp(3 * (i + 2 * (j + 2 * k)) + 2) -=
1876 this->restriction[index][2 * (2 * i + j) + k](
1877 (2 * (j + 4) + k) * this->degree +
l, dof) *
1878 this->shape_value_component(
1879 (2 * (j + 4) + k) * this->degree +
l,
1883 for (
unsigned int m = 0; m < deg; ++m)
1885 tmp(3 * (i + 2 * (j + 2 * k))) -=
1886 this->restriction[index][2 * (2 * i + j) +
1888 ((2 * j + 5) * deg + m) * this->degree +
1891 this->shape_value_component(
1892 ((2 * j + 5) * deg + m) * this->degree +
1896 tmp(3 * (i + 2 * (j + 2 * k))) -=
1897 this->restriction[index][2 * (2 * i + j) +
1899 (2 * (i + 4) * this->degree +
l) * deg +
1902 this->shape_value_component(
1903 (2 * (i + 4) * this->degree +
l) * deg +
1907 tmp(3 * (i + 2 * (j + 2 * k)) + 1) -=
1908 this->restriction[index][2 * (2 * i + j) +
1910 (2 * k * this->degree +
l) * deg + m +
1913 this->shape_value_component(
1914 (2 * k * this->degree +
l) * deg + m +
1918 tmp(3 * (i + 2 * (j + 2 * k)) + 1) -=
1919 this->restriction[index][2 * (2 * i + j) +
1921 ((2 * i + 9) * deg + m) * this->degree +
1924 this->shape_value_component(
1925 ((2 * i + 9) * deg + m) * this->degree +
1929 tmp(3 * (i + 2 * (j + 2 * k)) + 2) -=
1930 this->restriction[index][2 * (2 * i + j) +
1932 ((2 * k + 1) * deg + m) * this->degree +
1935 this->shape_value_component(
1936 ((2 * k + 1) * deg + m) * this->degree +
1940 tmp(3 * (i + 2 * (j + 2 * k)) + 2) -=
1941 this->restriction[index][2 * (2 * i + j) +
1943 (2 * (j + 2) * this->degree +
l) * deg +
1946 this->shape_value_component(
1947 (2 * (j + 2) * this->degree +
l) * deg +
1954 tmp *= quadrature.
weight(q_point);
1956 for (
unsigned int i = 0; i <= deg; ++i)
1958 const double L_i_0 = legendre_polynomials[i].value(
1960 const double L_i_1 = legendre_polynomials[i].value(
1962 const double L_i_2 = legendre_polynomials[i].value(
1965 for (
unsigned int j = 0; j < deg; ++j)
1967 const double l_j_0 =
1968 L_i_0 * lobatto_polynomials[j + 2].value(
1970 const double l_j_1 =
1971 L_i_1 * lobatto_polynomials[j + 2].value(
1973 const double l_j_2 =
1974 L_i_2 * lobatto_polynomials[j + 2].value(
1977 for (
unsigned int k = 0; k < deg; ++k)
1979 const double l_k_0 =
1980 l_j_0 * lobatto_polynomials[k + 2].value(
1982 const double l_k_1 =
1983 l_j_1 * lobatto_polynomials[k + 2].value(
1985 const double l_k_2 =
1986 l_j_2 * lobatto_polynomials[k + 2].value(
1989 for (
unsigned int l = 0;
l < 8; ++
l)
1991 system_rhs((i * deg + j) * deg + k,
1992 3 *
l) += tmp(3 *
l) * l_k_0;
1993 system_rhs((i * deg + j) * deg + k,
1995 tmp(3 *
l + 1) * l_k_1;
1996 system_rhs((i * deg + j) * deg + k,
1998 tmp(3 *
l + 2) * l_k_2;
2005 system_matrix_inv.
mmult(solution, system_rhs);
2007 for (
unsigned int i = 0; i < 2; ++i)
2008 for (
unsigned int j = 0; j < 2; ++j)
2009 for (
unsigned int k = 0; k < 2; ++k)
2010 for (
unsigned int l = 0;
l <= deg; ++
l)
2011 for (
unsigned int m = 0; m < deg; ++m)
2012 for (
unsigned int n = 0; n < deg; ++n)
2015 solution((
l * deg + m) * deg + n,
2016 3 * (i + 2 * (j + 2 * k)))) >
2018 this->restriction[index][2 * (2 * i + j) + k](
2019 (
l * deg + m) * deg + n + n_boundary_dofs,
2020 dof) = solution((
l * deg + m) * deg + n,
2021 3 * (i + 2 * (j + 2 * k)));
2024 solution((
l * deg + m) * deg + n,
2025 3 * (i + 2 * (j + 2 * k)) + 1)) >
2027 this->restriction[index][2 * (2 * i + j) + k](
2028 (
l + (m + deg) * this->degree) * deg + n +
2031 solution((
l * deg + m) * deg + n,
2032 3 * (i + 2 * (j + 2 * k)) + 1);
2035 solution((
l * deg + m) * deg + n,
2036 3 * (i + 2 * (j + 2 * k)) + 2)) >
2038 this->restriction[index][2 * (2 * i + j) + k](
2040 ((m + 2 * deg) * deg + n) * this->degree +
2043 solution((
l * deg + m) * deg + n,
2044 3 * (i + 2 * (j + 2 * k)) + 2);
2060std::vector<unsigned int>
2063 std::vector<unsigned int> dpo;
2067 dpo.resize(dim + 1);
2073 dpo.push_back(degree + 1);
2075 dpo.push_back(2 * degree * (degree + 1));
2077 dpo.push_back(3 * degree * degree * (degree + 1));
2099 const unsigned int face_index)
const
2104 const unsigned int deg = this->degree - 1;
2111 if (!((shape_index > deg) && (shape_index < 2 * this->degree)))
2118 if ((shape_index > deg) &&
2127 if (shape_index < 3 * this->degree)
2134 if (!((shape_index >= 2 * this->degree) &&
2135 (shape_index < 3 * this->degree)))
2152 if (((shape_index > deg) && (shape_index < 2 * this->degree)) ||
2153 ((shape_index >= 5 * this->degree) &&
2154 (shape_index < 6 * this->degree)) ||
2155 ((shape_index >= 9 * this->degree) &&
2156 (shape_index < 10 * this->degree)) ||
2157 ((shape_index >= 11 * this->degree) &&
2183 if (((shape_index > deg) && (shape_index < 4 * this->degree)) ||
2184 ((shape_index >= 5 * this->degree) &&
2185 (shape_index < 8 * this->degree)) ||
2186 ((shape_index >= 9 * this->degree) &&
2187 (shape_index < 10 * this->degree)) ||
2188 ((shape_index >= 11 * this->degree) &&
2214 if ((shape_index < 3 * this->degree) ||
2215 ((shape_index >= 4 * this->degree) &&
2216 (shape_index < 7 * this->degree)) ||
2217 ((shape_index >= 8 * this->degree) &&
2218 (shape_index < 10 * this->degree)) ||
2242 if ((shape_index < 2 * this->degree) ||
2243 ((shape_index >= 3 * this->degree) &&
2244 (shape_index < 6 * this->degree)) ||
2245 ((shape_index >= 7 * this->degree) &&
2246 (shape_index < 8 * this->degree)) ||
2247 ((shape_index >= 10 * this->degree) &&
2273 if ((shape_index < 4 * this->degree) ||
2274 ((shape_index >= 8 * this->degree) &&
2295 if (((shape_index >= 4 * this->degree) &&
2338 const unsigned int codim)
const
2348 if (this->degree < fe_nedelec_other->degree)
2350 else if (this->degree == fe_nedelec_other->degree)
2358 if (fe_nothing->is_dominating())
2379std::vector<std::pair<unsigned int, unsigned int>>
2384 return std::vector<std::pair<unsigned int, unsigned int>>();
2388std::vector<std::pair<unsigned int, unsigned int>>
2403 std::vector<std::pair<unsigned int, unsigned int>> identities;
2405 for (
unsigned int i = 0;
2406 i <
std::min(fe_nedelec_other->degree, this->degree);
2408 identities.emplace_back(i, i);
2419 return std::vector<std::pair<unsigned int, unsigned int>>();
2425 return std::vector<std::pair<unsigned int, unsigned int>>();
2430std::vector<std::pair<unsigned int, unsigned int>>
2432 const unsigned int)
const
2445 const unsigned int p = fe_nedelec_other->degree;
2446 const unsigned int q = this->degree;
2447 const unsigned int p_min =
std::min(p, q);
2448 std::vector<std::pair<unsigned int, unsigned int>> identities;
2450 for (
unsigned int i = 0; i < p_min; ++i)
2451 for (
unsigned int j = 0; j < p_min - 1; ++j)
2453 identities.emplace_back(i * (q - 1) + j, i * (p - 1) + j);
2454 identities.emplace_back(i + (j + q - 1) * q, i + (j + p - 1) * p);
2466 return std::vector<std::pair<unsigned int, unsigned int>>();
2472 return std::vector<std::pair<unsigned int, unsigned int>>();
2488 const unsigned int face_no)
const
2500 Assert(interpolation_matrix.
n() == this->n_dofs_per_face(face_no),
2502 this->n_dofs_per_face(face_no)));
2522 interpolation_matrix = 0;
2526 for (
unsigned int i = 0; i < this->degree; ++i)
2527 interpolation_matrix(i, i) = 1.0;
2537 const unsigned int p = source_fe.
degree;
2538 const unsigned int q = this->degree;
2540 for (
unsigned int i = 0; i < q; ++i)
2542 for (
unsigned int j = 1; j < GeometryInfo<dim>::lines_per_face; ++j)
2543 interpolation_matrix(j * p + i, j * q + i) = 1.0;
2545 for (
unsigned int j = 0; j < q - 1; ++j)
2550 i * (q - 1) + j) = 1.0;
2554 (j + q - 1) * q) = 1.0;
2567 const unsigned int)
const
2594 const unsigned int subface,
2596 const unsigned int face_no)
const
2607 Assert(interpolation_matrix.
n() == this->n_dofs_per_face(face_no),
2609 this->n_dofs_per_face(face_no)));
2629 interpolation_matrix = 0.0;
2633 const std::vector<Point<1>> &edge_quadrature_points =
2635 const unsigned int n_edge_quadrature_points = edge_quadrature.
size();
2641 for (
unsigned int dof = 0; dof < this->n_dofs_per_face(face_no);
2643 for (
unsigned int q_point = 0; q_point < n_edge_quadrature_points;
2647 0.0, 0.5 * (edge_quadrature_points[q_point](0) + subface));
2649 interpolation_matrix(0, dof) +=
2650 0.5 * edge_quadrature.
weight(q_point) *
2651 this->shape_value_component(dof, quadrature_point, 1);
2654 if (source_fe.
degree > 1)
2656 const std::vector<Polynomials::Polynomial<double>>
2657 &legendre_polynomials =
2665 n_edge_quadrature_points);
2667 for (
unsigned int q_point = 0;
2668 q_point < n_edge_quadrature_points;
2671 const double weight =
2674 for (
unsigned int i = 0; i < source_fe.
degree - 1; ++i)
2675 assembling_matrix(i, q_point) =
2676 weight * legendre_polynomials[i + 1].value(
2677 edge_quadrature_points[q_point](0));
2683 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
2684 system_matrix_inv.
invert(system_matrix);
2690 for (
unsigned int dof = 0; dof < this->n_dofs_per_face(face_no);
2695 for (
unsigned int q_point = 0;
2696 q_point < n_edge_quadrature_points;
2701 0.5 * (edge_quadrature_points[q_point](0) + subface));
2703 0.0, edge_quadrature_points[q_point](0));
2705 edge_quadrature.
weight(q_point) *
2706 (0.5 * this->shape_value_component(dof,
2709 interpolation_matrix(0, dof) *
2714 for (
unsigned int i = 0; i < source_fe.
degree - 1; ++i)
2716 tmp * legendre_polynomials[i + 1].value(
2717 edge_quadrature_points[q_point](0));
2720 system_matrix_inv.
vmult(solution, system_rhs);
2722 for (
unsigned int i = 0; i < source_fe.
degree - 1; ++i)
2724 interpolation_matrix(i + 1, dof) = solution(i);
2733 const double shifts[4][2] = {{0.0, 0.0},
2738 for (
unsigned int dof = 0; dof < this->n_dofs_per_face(face_no);
2740 for (
unsigned int q_point = 0; q_point < n_edge_quadrature_points;
2743 const double weight = 0.5 * edge_quadrature.
weight(q_point);
2745 for (
unsigned int i = 0; i < 2; ++i)
2748 0.5 * (i + shifts[subface][0]),
2749 0.5 * (edge_quadrature_points[q_point](0) +
2750 shifts[subface][1]),
2753 interpolation_matrix(i * source_fe.
degree, dof) +=
2755 this->shape_value_component(
2756 this->face_to_cell_index(dof, 4), quadrature_point, 1);
2758 Point<dim>(0.5 * (edge_quadrature_points[q_point](0) +
2759 shifts[subface][0]),
2760 0.5 * (i + shifts[subface][1]),
2762 interpolation_matrix((i + 2) * source_fe.
degree, dof) +=
2764 this->shape_value_component(
2765 this->face_to_cell_index(dof, 4), quadrature_point, 0);
2769 if (source_fe.
degree > 1)
2771 const std::vector<Polynomials::Polynomial<double>>
2772 &legendre_polynomials =
2780 n_edge_quadrature_points);
2782 for (
unsigned int q_point = 0;
2783 q_point < n_edge_quadrature_points;
2786 const double weight =
2789 for (
unsigned int i = 0; i < source_fe.
degree - 1; ++i)
2790 assembling_matrix(i, q_point) =
2791 weight * legendre_polynomials[i + 1].value(
2792 edge_quadrature_points[q_point](0));
2798 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
2799 system_matrix_inv.
invert(system_matrix);
2808 for (
unsigned int dof = 0; dof < this->n_dofs_per_face(face_no);
2813 for (
unsigned int q_point = 0;
2814 q_point < n_edge_quadrature_points;
2817 const double weight = edge_quadrature.
weight(q_point);
2819 for (
unsigned int i = 0; i < 2; ++i)
2822 0.5 * (i + shifts[subface][0]),
2823 0.5 * (edge_quadrature_points[q_point](0) +
2824 shifts[subface][1]),
2827 i, edge_quadrature_points[q_point](0), 0.0);
2831 (0.5 * this->shape_value_component(
2832 this->face_to_cell_index(dof, 4),
2835 interpolation_matrix(i * source_fe.
degree, dof) *
2837 i * source_fe.
degree, quadrature_point_1, 1));
2838 quadrature_point_0 =
2840 (edge_quadrature_points[q_point](0) +
2841 shifts[subface][0]),
2842 0.5 * (i + shifts[subface][1]),
2844 quadrature_point_1 =
2845 Point<dim>(edge_quadrature_points[q_point](0),
2850 (0.5 * this->shape_value_component(
2851 this->face_to_cell_index(dof, 4),
2854 interpolation_matrix((i + 2) * source_fe.
degree,
2857 (i + 2) * source_fe.
degree,
2862 for (
unsigned int i = 0; i < source_fe.
degree - 1; ++i)
2864 const double L_i = legendre_polynomials[i + 1].value(
2865 edge_quadrature_points[q_point](0));
2867 for (
unsigned int j = 0;
2868 j < GeometryInfo<dim>::lines_per_face;
2870 system_rhs(i, j) += tmp(j) * L_i;
2874 system_matrix_inv.
mmult(solution, system_rhs);
2876 for (
unsigned int i = 0;
2877 i < GeometryInfo<dim>::lines_per_face;
2879 for (
unsigned int j = 0; j < source_fe.
degree - 1; ++j)
2881 interpolation_matrix(i * source_fe.
degree + j + 1,
2882 dof) = solution(j, i);
2888 const std::vector<Polynomials::Polynomial<double>>
2889 &lobatto_polynomials =
2892 const unsigned int n_boundary_dofs =
2894 const unsigned int n_quadrature_points = quadrature.
size();
2899 n_quadrature_points);
2901 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
2906 for (
unsigned int i = 0; i < source_fe.
degree; ++i)
2909 weight * legendre_polynomials[i].value(
2912 for (
unsigned int j = 0; j < source_fe.
degree - 1; ++j)
2913 assembling_matrix(i * (source_fe.
degree - 1) + j,
2915 L_i * lobatto_polynomials[j + 2].value(
2921 assembling_matrix.
m());
2923 assembling_matrix.
mTmult(system_matrix, assembling_matrix);
2924 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
2925 system_matrix_inv.
invert(system_matrix);
2928 solution.reinit(system_matrix_inv.
m(), 2);
2929 system_rhs.reinit(system_matrix_inv.
m(), 2);
2932 for (
unsigned int dof = 0; dof < this->n_dofs_per_face(face_no);
2937 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
2946 tmp(0) = 0.5 * this->shape_value_component(
2947 this->face_to_cell_index(dof, 4),
2950 tmp(1) = 0.5 * this->shape_value_component(
2951 this->face_to_cell_index(dof, 4),
2959 for (
unsigned int i = 0; i < 2; ++i)
2960 for (
unsigned int j = 0; j < source_fe.
degree; ++j)
2962 tmp(0) -= interpolation_matrix(
2963 (i + 2) * source_fe.
degree + j, dof) *
2965 (i + 2) * source_fe.
degree + j,
2969 interpolation_matrix(i * source_fe.
degree + j,
2972 i * source_fe.
degree + j, quadrature_point, 1);
2975 tmp *= quadrature.
weight(q_point);
2977 for (
unsigned int i = 0; i < source_fe.
degree; ++i)
2979 const double L_i_0 = legendre_polynomials[i].value(
2981 const double L_i_1 = legendre_polynomials[i].value(
2984 for (
unsigned int j = 0; j < source_fe.
degree - 1;
2987 system_rhs(i * (source_fe.
degree - 1) + j, 0) +=
2989 lobatto_polynomials[j + 2].value(
2991 system_rhs(i * (source_fe.
degree - 1) + j, 1) +=
2993 lobatto_polynomials[j + 2].value(
2999 system_matrix_inv.
mmult(solution, system_rhs);
3001 for (
unsigned int i = 0; i < source_fe.
degree; ++i)
3002 for (
unsigned int j = 0; j < source_fe.
degree - 1; ++j)
3006 interpolation_matrix(i * (source_fe.
degree - 1) + j +
3009 solution(i * (source_fe.
degree - 1) + j, 0);
3013 interpolation_matrix(
3016 dof) = solution(i * (source_fe.
degree - 1) + j, 1);
3032 const unsigned int child,
3039 "Prolongation matrices are only available for refined cells!"));
3043 if (this->prolongation[refinement_case - 1][child].n() == 0)
3045 std::lock_guard<std::mutex> lock(this->mutex);
3048 if (this->prolongation[refinement_case - 1][child].n() ==
3049 this->n_dofs_per_cell())
3050 return this->prolongation[refinement_case - 1][child];
3062 deallog <<
"Embedding" << std::endl;
3070 internal::FE_Nedelec::get_embedding_computation_tolerance(
3073 deallog <<
"Restriction" << std::endl;
3081 return this->prolongation[refinement_case - 1][child];
3087 const unsigned int child,
3094 "Restriction matrices are only available for refined cells!"));
3099 if (this->restriction[refinement_case - 1][child].n() == 0)
3101 std::lock_guard<std::mutex> lock(this->mutex);
3104 if (this->restriction[refinement_case - 1][child].n() ==
3105 this->n_dofs_per_cell())
3106 return this->restriction[refinement_case - 1][child];
3118 deallog <<
"Embedding" << std::endl;
3126 internal::FE_Nedelec::get_embedding_computation_tolerance(
3129 deallog <<
"Restriction" << std::endl;
3137 return this->restriction[refinement_case - 1][child];
3151 std::vector<double> & nodal_values)
const
3156 const unsigned int face_no = 0;
3158 const unsigned int deg = this->degree - 1;
3159 Assert(support_point_values.size() == this->generalized_support_points.size(),
3161 this->generalized_support_points.size()));
3162 Assert(support_point_values[0].size() == this->n_components(),
3164 this->n_components()));
3165 Assert(nodal_values.size() == this->n_dofs_per_cell(),
3167 std::fill(nodal_values.begin(), nodal_values.end(), 0.0);
3175 const QGauss<1> reference_edge_quadrature(this->degree);
3176 const unsigned int n_edge_points = reference_edge_quadrature.
size();
3178 for (
unsigned int i = 0; i < 2; ++i)
3179 for (
unsigned int j = 0; j < 2; ++j)
3181 for (
unsigned int q_point = 0; q_point < n_edge_points;
3183 nodal_values[(i + 2 * j) * this->degree] +=
3184 reference_edge_quadrature.
weight(q_point) *
3185 support_point_values[q_point + (i + 2 * j) * n_edge_points]
3191 if (
std::abs(nodal_values[(i + 2 * j) * this->degree]) < 1
e-14)
3192 nodal_values[(i + 2 * j) * this->degree] = 0.0;
3205 if (this->degree > 1)
3210 const std::vector<Polynomials::Polynomial<double>>
3211 &lobatto_polynomials =
3215 std::vector<Polynomials::Polynomial<double>>
3216 lobatto_polynomials_grad(this->degree);
3218 for (
unsigned int i = 0; i < lobatto_polynomials_grad.size(); ++i)
3219 lobatto_polynomials_grad[i] =
3220 lobatto_polynomials[i + 1].derivative();
3225 for (
unsigned int i = 0; i < system_matrix.
m(); ++i)
3226 for (
unsigned int j = 0; j < system_matrix.
n(); ++j)
3227 for (
unsigned int q_point = 0; q_point < n_edge_points;
3229 system_matrix(i, j) +=
3230 boundary_weights(q_point, j) *
3231 lobatto_polynomials_grad[i + 1].value(
3232 this->generalized_face_support_points[face_no][q_point](
3238 system_matrix_inv.
invert(system_matrix);
3245 for (
unsigned int line = 0;
3246 line < GeometryInfo<dim>::lines_per_cell;
3252 for (
unsigned int q_point = 0; q_point < n_edge_points;
3256 support_point_values[line * n_edge_points + q_point]
3257 [line_coordinate[line]] -
3258 nodal_values[line * this->degree] *
3259 this->shape_value_component(
3260 line * this->degree,
3261 this->generalized_support_points[line *
3264 line_coordinate[line]);
3266 for (
unsigned int i = 0; i < system_rhs.
size(); ++i)
3267 system_rhs(i) += boundary_weights(q_point, i) * tmp;
3270 system_matrix_inv.
vmult(solution, system_rhs);
3276 for (
unsigned int i = 0; i < solution.
size(); ++i)
3278 nodal_values[line * this->degree + i + 1] = solution(i);
3290 const QGauss<dim> reference_quadrature(this->degree);
3291 const unsigned int n_interior_points =
3292 reference_quadrature.
size();
3293 const std::vector<Polynomials::Polynomial<double>>
3294 &legendre_polynomials =
3298 system_matrix.reinit((this->degree - 1) * this->degree,
3299 (this->degree - 1) * this->degree);
3302 for (
unsigned int i = 0; i < this->degree; ++i)
3303 for (
unsigned int j = 0; j < this->degree - 1; ++j)
3304 for (
unsigned int k = 0; k < this->degree; ++k)
3305 for (
unsigned int l = 0;
l < this->degree - 1; ++
l)
3306 for (
unsigned int q_point = 0;
3307 q_point < n_interior_points;
3309 system_matrix(i * (this->degree - 1) + j,
3310 k * (this->degree - 1) +
l) +=
3311 reference_quadrature.
weight(q_point) *
3312 legendre_polynomials[i].value(
3313 this->generalized_support_points
3315 n_edge_points](0)) *
3316 lobatto_polynomials[j + 2].value(
3317 this->generalized_support_points
3319 n_edge_points](1)) *
3320 lobatto_polynomials_grad[k].value(
3321 this->generalized_support_points
3323 n_edge_points](0)) *
3324 lobatto_polynomials[
l + 2].value(
3325 this->generalized_support_points
3329 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
3330 system_matrix_inv.
invert(system_matrix);
3334 system_rhs.
reinit(system_matrix_inv.
m());
3337 for (
unsigned int q_point = 0; q_point < n_interior_points;
3341 support_point_values[q_point +
3345 for (
unsigned int i = 0; i < 2; ++i)
3346 for (
unsigned int j = 0; j <= deg; ++j)
3347 tmp -= nodal_values[(i + 2) * this->degree + j] *
3348 this->shape_value_component(
3349 (i + 2) * this->degree + j,
3350 this->generalized_support_points
3355 for (
unsigned int i = 0; i <= deg; ++i)
3356 for (
unsigned int j = 0; j < deg; ++j)
3357 system_rhs(i * deg + j) +=
3358 reference_quadrature.
weight(q_point) * tmp *
3359 lobatto_polynomials_grad[i].value(
3360 this->generalized_support_points
3362 n_edge_points](0)) *
3363 lobatto_polynomials[j + 2].value(
3364 this->generalized_support_points
3369 solution.
reinit(system_matrix.
m());
3370 system_matrix_inv.
vmult(solution, system_rhs);
3376 for (
unsigned int i = 0; i <= deg; ++i)
3377 for (
unsigned int j = 0; j < deg; ++j)
3378 if (
std::abs(solution(i * deg + j)) > 1
e-14)
3381 solution(i * deg + j);
3388 for (
unsigned int q_point = 0; q_point < n_interior_points;
3392 support_point_values[q_point +
3396 for (
unsigned int i = 0; i < 2; ++i)
3397 for (
unsigned int j = 0; j <= deg; ++j)
3398 tmp -= nodal_values[i * this->degree + j] *
3399 this->shape_value_component(
3400 i * this->degree + j,
3401 this->generalized_support_points
3406 for (
unsigned int i = 0; i <= deg; ++i)
3407 for (
unsigned int j = 0; j < deg; ++j)
3408 system_rhs(i * deg + j) +=
3409 reference_quadrature.
weight(q_point) * tmp *
3410 lobatto_polynomials_grad[i].value(
3411 this->generalized_support_points
3413 n_edge_points](1)) *
3414 lobatto_polynomials[j + 2].value(
3415 this->generalized_support_points
3420 system_matrix_inv.
vmult(solution, system_rhs);
3426 for (
unsigned int i = 0; i <= deg; ++i)
3427 for (
unsigned int j = 0; j < deg; ++j)
3428 if (
std::abs(solution(i * deg + j)) > 1
e-14)
3431 this->degree] = solution(i * deg + j);
3441 const QGauss<1> reference_edge_quadrature(this->degree);
3442 const unsigned int n_edge_points = reference_edge_quadrature.
size();
3444 for (
unsigned int q_point = 0; q_point < n_edge_points; ++q_point)
3446 for (
unsigned int i = 0; i < 4; ++i)
3447 nodal_values[(i + 8) * this->degree] +=
3448 reference_edge_quadrature.
weight(q_point) *
3449 support_point_values[q_point + (i + 8) * n_edge_points][2];
3451 for (
unsigned int i = 0; i < 2; ++i)
3452 for (
unsigned int j = 0; j < 2; ++j)
3453 for (
unsigned int k = 0; k < 2; ++k)
3454 nodal_values[(i + 2 * (2 * j + k)) * this->degree] +=
3455 reference_edge_quadrature.
weight(q_point) *
3456 support_point_values[q_point + (i + 2 * (2 * j + k)) *
3457 n_edge_points][1 - k];
3464 for (
unsigned int i = 0; i < 4; ++i)
3465 if (
std::abs(nodal_values[(i + 8) * this->degree]) < 1
e-14)
3466 nodal_values[(i + 8) * this->degree] = 0.0;
3468 for (
unsigned int i = 0; i < 2; ++i)
3469 for (
unsigned int j = 0; j < 2; ++j)
3470 for (
unsigned int k = 0; k < 2; ++k)
3472 nodal_values[(i + 2 * (2 * j + k)) * this->degree]) <
3474 nodal_values[(i + 2 * (2 * j + k)) * this->degree] = 0.0;
3485 if (this->degree > 1)
3490 const std::vector<Polynomials::Polynomial<double>>
3491 &lobatto_polynomials =
3495 std::vector<Polynomials::Polynomial<double>>
3496 lobatto_polynomials_grad(this->degree);
3498 for (
unsigned int i = 0; i < lobatto_polynomials_grad.size(); ++i)
3499 lobatto_polynomials_grad[i] =
3500 lobatto_polynomials[i + 1].derivative();
3505 for (
unsigned int i = 0; i < system_matrix.
m(); ++i)
3506 for (
unsigned int j = 0; j < system_matrix.
n(); ++j)
3507 for (
unsigned int q_point = 0; q_point < n_edge_points;
3509 system_matrix(i, j) +=
3510 boundary_weights(q_point, j) *
3511 lobatto_polynomials_grad[i + 1].value(
3512 this->generalized_face_support_points[face_no][q_point](
3518 system_matrix_inv.
invert(system_matrix);
3522 1, 1, 0, 0, 1, 1, 0, 0, 2, 2, 2, 2};
3526 for (
unsigned int line = 0;
3527 line < GeometryInfo<dim>::lines_per_cell;
3533 for (
unsigned int q_point = 0; q_point < this->degree;
3537 support_point_values[line * this->degree + q_point]
3538 [line_coordinate[line]] -
3539 nodal_values[line * this->degree] *
3540 this->shape_value_component(
3541 line * this->degree,
3543 ->generalized_support_points[line * this->degree +
3545 line_coordinate[line]);
3547 for (
unsigned int i = 0; i < system_rhs.
size(); ++i)
3548 system_rhs(i) += boundary_weights(q_point, i) * tmp;
3551 system_matrix_inv.
vmult(solution, system_rhs);
3557 for (
unsigned int i = 0; i < solution.
size(); ++i)
3559 nodal_values[line * this->degree + i + 1] = solution(i);
3570 const std::vector<Polynomials::Polynomial<double>>
3571 &legendre_polynomials =
3574 const unsigned int n_face_points = n_edge_points * n_edge_points;
3576 system_matrix.reinit((this->degree - 1) * this->degree,
3577 (this->degree - 1) * this->degree);
3580 for (
unsigned int i = 0; i < this->degree; ++i)
3581 for (
unsigned int j = 0; j < this->degree - 1; ++j)
3582 for (
unsigned int k = 0; k < this->degree; ++k)
3583 for (
unsigned int l = 0;
l < this->degree - 1; ++
l)
3584 for (
unsigned int q_point = 0; q_point < n_face_points;
3586 system_matrix(i * (this->degree - 1) + j,
3587 k * (this->degree - 1) +
l) +=
3588 boundary_weights(q_point + n_edge_points,
3589 2 * (k * (this->degree - 1) +
l)) *
3590 legendre_polynomials[i].value(
3591 this->generalized_face_support_points
3592 [face_no][q_point + 4 * n_edge_points](0)) *
3593 lobatto_polynomials[j + 2].value(
3594 this->generalized_face_support_points
3595 [face_no][q_point + 4 * n_edge_points](1));
3597 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
3598 system_matrix_inv.
invert(system_matrix);
3599 solution.
reinit(system_matrix.
m());
3600 system_rhs.
reinit(system_matrix.
m());
3604 {1, 2}, {1, 2}, {2, 0}, {2, 0}, {0, 1}, {0, 1}};
3621 for (
unsigned int q_point = 0; q_point < n_face_points;
3625 support_point_values[q_point +
3628 [face_coordinates[face][0]];
3630 for (
unsigned int i = 0; i < 2; ++i)
3631 for (
unsigned int j = 0; j <= deg; ++j)
3635 this->shape_value_component(
3637 this->generalized_support_points
3640 face_coordinates[face][0]);
3642 for (
unsigned int i = 0; i <= deg; ++i)
3643 for (
unsigned int j = 0; j < deg; ++j)
3644 system_rhs(i * deg + j) +=
3645 boundary_weights(q_point + n_edge_points,
3646 2 * (i * deg + j)) *
3650 system_matrix_inv.
vmult(solution, system_rhs);
3656 for (
unsigned int i = 0; i <= deg; ++i)
3657 for (
unsigned int j = 0; j < deg; ++j)
3658 if (
std::abs(solution(i * deg + j)) > 1
e-14)
3659 nodal_values[(2 * face * this->degree + i +
3663 solution(i * deg + j);
3670 for (
unsigned int q_point = 0; q_point < n_face_points;
3674 support_point_values[q_point +
3677 [face_coordinates[face][1]];
3679 for (
unsigned int i = 2;
3680 i < GeometryInfo<dim>::lines_per_face;
3682 for (
unsigned int j = 0; j <= deg; ++j)
3686 this->shape_value_component(
3688 this->generalized_support_points
3691 face_coordinates[face][1]);
3693 for (
unsigned int i = 0; i <= deg; ++i)
3694 for (
unsigned int j = 0; j < deg; ++j)
3695 system_rhs(i * deg + j) +=
3696 boundary_weights(q_point + n_edge_points,
3697 2 * (i * deg + j) + 1) *
3701 system_matrix_inv.
vmult(solution, system_rhs);
3707 for (
unsigned int i = 0; i <= deg; ++i)
3708 for (
unsigned int j = 0; j < deg; ++j)
3709 if (
std::abs(solution(i * deg + j)) > 1
e-14)
3710 nodal_values[((2 * face + 1) * deg + j +
3713 i] = solution(i * deg + j);
3721 const QGauss<dim> reference_quadrature(this->degree);
3722 const unsigned int n_interior_points =
3723 reference_quadrature.
size();
3727 system_matrix.reinit(this->degree * deg * deg,
3728 this->degree * deg * deg);
3731 for (
unsigned int i = 0; i <= deg; ++i)
3732 for (
unsigned int j = 0; j < deg; ++j)
3733 for (
unsigned int k = 0; k < deg; ++k)
3734 for (
unsigned int l = 0;
l <= deg; ++
l)
3735 for (
unsigned int m = 0; m < deg; ++m)
3736 for (
unsigned int n = 0; n < deg; ++n)
3737 for (
unsigned int q_point = 0;
3738 q_point < n_interior_points;
3740 system_matrix((i * deg + j) * deg + k,
3741 (
l * deg + m) * deg + n) +=
3742 reference_quadrature.
weight(q_point) *
3743 legendre_polynomials[i].value(
3744 this->generalized_support_points
3749 n_face_points](0)) *
3750 lobatto_polynomials[j + 2].value(
3751 this->generalized_support_points
3756 n_face_points](1)) *
3757 lobatto_polynomials[k + 2].value(
3758 this->generalized_support_points
3763 n_face_points](2)) *
3764 lobatto_polynomials_grad[
l].value(
3765 this->generalized_support_points
3770 n_face_points](0)) *
3771 lobatto_polynomials[m + 2].value(
3772 this->generalized_support_points
3777 n_face_points](1)) *
3778 lobatto_polynomials[n + 2].value(
3779 this->generalized_support_points
3786 system_matrix_inv.reinit(system_matrix.
m(), system_matrix.
m());
3787 system_matrix_inv.
invert(system_matrix);
3789 system_rhs.
reinit(system_matrix.
m());
3792 for (
unsigned int q_point = 0; q_point < n_interior_points;
3796 support_point_values[q_point +
3802 for (
unsigned int i = 0; i <= deg; ++i)
3804 for (
unsigned int j = 0; j < 2; ++j)
3805 for (
unsigned int k = 0; k < 2; ++k)
3807 nodal_values[i + (j + 4 * k + 2) * this->degree] *
3808 this->shape_value_component(
3809 i + (j + 4 * k + 2) * this->degree,
3810 this->generalized_support_points
3818 for (
unsigned int j = 0; j < deg; ++j)
3819 for (
unsigned int k = 0; k < 4; ++k)
3821 nodal_values[(i + 2 * (k + 2) * this->degree +
3826 this->shape_value_component(
3827 (i + 2 * (k + 2) * this->degree +
3831 this->generalized_support_points
3840 for (
unsigned int i = 0; i <= deg; ++i)
3841 for (
unsigned int j = 0; j < deg; ++j)
3842 for (
unsigned int k = 0; k < deg; ++k)
3843 system_rhs((i * deg + j) * deg + k) +=
3844 reference_quadrature.
weight(q_point) * tmp *
3845 lobatto_polynomials_grad[i].value(
3846 this->generalized_support_points
3851 n_face_points](0)) *
3852 lobatto_polynomials[j + 2].value(
3853 this->generalized_support_points
3858 n_face_points](1)) *
3859 lobatto_polynomials[k + 2].value(
3860 this->generalized_support_points
3869 system_matrix_inv.
vmult(solution, system_rhs);
3875 for (
unsigned int i = 0; i <= deg; ++i)
3876 for (
unsigned int j = 0; j < deg; ++j)
3877 for (
unsigned int k = 0; k < deg; ++k)
3878 if (
std::abs(solution((i * deg + j) * deg + k)) > 1
e-14)
3885 solution((i * deg + j) * deg + k);
3890 for (
unsigned int q_point = 0; q_point < n_interior_points;
3894 support_point_values[q_point +
3900 for (
unsigned int i = 0; i <= deg; ++i)
3901 for (
unsigned int j = 0; j < 2; ++j)
3903 for (
unsigned int k = 0; k < 2; ++k)
3904 tmp -= nodal_values[i + (4 * j + k) * this->degree] *
3905 this->shape_value_component(
3906 i + (4 * j + k) * this->degree,
3907 this->generalized_support_points
3915 for (
unsigned int k = 0; k < deg; ++k)
3917 nodal_values[(i + 2 * j * this->degree +
3922 this->shape_value_component(
3923 (i + 2 * j * this->degree +
3927 this->generalized_support_points
3935 ((2 * j + 9) * deg + k +
3938 this->shape_value_component(
3939 i + ((2 * j + 9) * deg + k +
3942 this->generalized_support_points
3951 for (
unsigned int i = 0; i <= deg; ++i)
3952 for (
unsigned int j = 0; j < deg; ++j)
3953 for (
unsigned int k = 0; k < deg; ++k)
3954 system_rhs((i * deg + j) * deg + k) +=
3955 reference_quadrature.
weight(q_point) * tmp *
3956 lobatto_polynomials_grad[i].value(
3957 this->generalized_support_points
3962 n_face_points](1)) *
3963 lobatto_polynomials[j + 2].value(
3964 this->generalized_support_points
3969 n_face_points](0)) *
3970 lobatto_polynomials[k + 2].value(
3971 this->generalized_support_points
3979 system_matrix_inv.
vmult(solution, system_rhs);
3985 for (
unsigned int i = 0; i <= deg; ++i)
3986 for (
unsigned int j = 0; j < deg; ++j)
3987 for (
unsigned int k = 0; k < deg; ++k)
3988 if (
std::abs(solution((i * deg + j) * deg + k)) > 1
e-14)
3989 nodal_values[((i + this->degree +
3996 solution((i * deg + j) * deg + k);
4001 for (
unsigned int q_point = 0; q_point < n_interior_points;
4005 support_point_values[q_point +
4011 for (
unsigned int i = 0; i <= deg; ++i)
4012 for (
unsigned int j = 0; j < 4; ++j)
4014 tmp -= nodal_values[i + (j + 8) * this->degree] *
4015 this->shape_value_component(
4016 i + (j + 8) * this->degree,
4017 this->generalized_support_points
4025 for (
unsigned int k = 0; k < deg; ++k)
4028 ((2 * j + 1) * deg + k +
4031 this->shape_value_component(
4032 i + ((2 * j + 1) * deg + k +
4035 this->generalized_support_points
4044 for (
unsigned int i = 0; i <= deg; ++i)
4045 for (
unsigned int j = 0; j < deg; ++j)
4046 for (
unsigned int k = 0; k < deg; ++k)
4047 system_rhs((i * deg + j) * deg + k) +=
4048 reference_quadrature.
weight(q_point) * tmp *
4049 lobatto_polynomials_grad[i].value(
4050 this->generalized_support_points
4055 n_face_points](2)) *
4056 lobatto_polynomials[j + 2].value(
4057 this->generalized_support_points
4062 n_face_points](0)) *
4063 lobatto_polynomials[k + 2].value(
4064 this->generalized_support_points
4072 system_matrix_inv.
vmult(solution, system_rhs);
4078 for (
unsigned int i = 0; i <= deg; ++i)
4079 for (
unsigned int j = 0; j < deg; ++j)
4080 for (
unsigned int k = 0; k < deg; ++k)
4081 if (
std::abs(solution((i * deg + j) * deg + k)) > 1
e-14)
4087 this->degree] = solution((i * deg + j) * deg + k);
4101std::pair<Table<2, bool>, std::vector<unsigned int>>
4105 for (
unsigned int d = 0;
d < dim; ++
d)
4106 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
4107 constant_modes(
d, i) =
true;
4108 std::vector<unsigned int> components;
4109 for (
unsigned int d = 0;
d < dim; ++
d)
4110 components.push_back(
d);
4111 return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
4129#include "fe_nedelec.inst"
void initialize_quad_dof_index_permutation_and_sign_change()
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim > &fe_other) const override
virtual bool hp_constraints_are_implemented() const override
virtual void get_subface_interpolation_matrix(const FiniteElement< dim > &source, const unsigned int subface, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
void initialize_restriction()
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim > &fe_other, const unsigned int face_no=0) const override
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree, bool dg=false)
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
virtual void get_face_interpolation_matrix(const FiniteElement< dim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
virtual std::unique_ptr< FiniteElement< dim, dim > > clone() const override
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const override
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const override
virtual std::size_t memory_consumption() const override
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
virtual std::string get_name() const override
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim > &fe_other, const unsigned int codim=0) const override final
void initialize_support_points(const unsigned int order)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim > &fe_other) const override
FullMatrix< double > inverse_node_matrix
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
std::vector< MappingKind > mapping_kind
const unsigned int degree
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_unique_faces() const
virtual std::string get_name() const =0
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
FullMatrix< double > interface_constraints
std::vector< std::vector< FullMatrix< double > > > prolongation
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
void invert(const FullMatrix< number2 > &M)
void fill(const FullMatrix< number2 > &src, const size_type dst_offset_i=0, const size_type dst_offset_j=0, const size_type src_offset_i=0, const size_type src_offset_j=0)
void mTmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
static unsigned int n_polynomials(const unsigned int degree)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int p)
static Quadrature< dim > project_to_all_faces(const Quadrature< dim - 1 > &quadrature)
const Point< dim > & point(const unsigned int i) const
double weight(const unsigned int i) const
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
virtual void reinit(const size_type N, const bool omit_zeroing_entries=false)
std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
::VectorizedArray< Number, width > exp(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)