42 template <
int spacedim>
44 get_dof_sign_change_h_div(
45 const typename ::Triangulation<1, spacedim>::cell_iterator &,
47 const std::vector<MappingKind> &,
48 std::vector<double> &)
61 template <
int spacedim>
63 get_dof_sign_change_h_div(
64 const typename ::Triangulation<2, spacedim>::cell_iterator &cell,
66 const std::vector<MappingKind> &mapping_kind,
67 std::vector<double> & face_sign)
69 const unsigned int dim = 2;
72 const CellId this_cell_id = cell->id();
74 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
76 typename ::Triangulation<dim, spacedim>::face_iterator face =
78 if (!face->at_boundary())
80 const unsigned int nn = cell->neighbor_face_no(f);
81 const typename ::Triangulation<dim,
82 spacedim>::cell_iterator
83 neighbor_cell_at_face = cell->neighbor(f);
84 const CellId neigbor_cell_id = neighbor_cell_at_face->id();
88 if (((nn + f) % 2 == 0) && this_cell_id < neigbor_cell_id)
95 Assert(mapping_kind.size() == 1 ||
96 cell_j < mapping_kind.size(),
101 if ((mapping_kind.size() > 1 ?
102 mapping_kind[cell_j] :
112 template <
int spacedim>
114 get_dof_sign_change_h_div(
115 const typename ::Triangulation<3, spacedim>::cell_iterator
118 const std::vector<MappingKind> & ,
119 std::vector<double> & )
125 template <
int spacedim>
127 get_dof_sign_change_nedelec(
128 const typename ::Triangulation<1, spacedim>::cell_iterator
131 const std::vector<MappingKind> & ,
132 std::vector<double> & )
139 template <
int spacedim>
141 get_dof_sign_change_nedelec(
142 const typename ::Triangulation<2, spacedim>::cell_iterator &cell,
144 const std::vector<MappingKind> &mapping_kind,
145 std::vector<double> & line_dof_sign)
147 const unsigned int dim = 2;
149 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
150 if (!(cell->line_orientation(l)) &&
152 line_dof_sign[l] = -1.0;
156 template <
int spacedim>
158 get_dof_sign_change_nedelec(
159 const typename ::Triangulation<3, spacedim>::cell_iterator &cell,
161 const std::vector<MappingKind> &mapping_kind,
162 std::vector<double> & line_dof_sign)
164 const unsigned int dim = 3;
167 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
168 if (!(cell->line_orientation(l)) &&
170 line_dof_sign[l] = -1.0;
177template <
int dim,
int spacedim>
181 const std::vector<bool> & restriction_is_additive_flags,
182 const std::vector<ComponentMask> &nonzero_components)
184 restriction_is_additive_flags,
186 , mapping_kind({MappingKind::mapping_none})
187 , poly_space(polynomials.clone())
189 cached_point(0) = -1;
197 for (
unsigned int comp = 0; comp < this->n_components(); ++comp)
198 this->component_to_base_table[comp].
first.second = comp;
202 adjust_quad_dof_sign_for_face_orientation_table.resize(
203 this->n_unique_quads());
205 for (
unsigned int f = 0; f < this->n_unique_quads(); ++f)
207 adjust_quad_dof_sign_for_face_orientation_table[f] =
213 adjust_quad_dof_sign_for_face_orientation_table[f].fill(
false);
220template <
int dim,
int spacedim>
223 , mapping_kind(fe.mapping_kind)
224 , adjust_quad_dof_sign_for_face_orientation_table(
225 fe.adjust_quad_dof_sign_for_face_orientation_table)
226 , poly_space(fe.poly_space->clone())
227 , inverse_node_matrix(fe.inverse_node_matrix)
232template <
int dim,
int spacedim>
236 return mapping_kind.size() == 1;
240template <
int dim,
int spacedim>
243 const unsigned int index,
244 const unsigned int face,
245 const bool face_orientation,
246 const bool face_flip,
247 const bool face_rotation)
const
260 Assert(adjust_quad_dof_sign_for_face_orientation_table
261 [this->n_unique_quads() == 1 ? 0 : face]
266 this->n_dofs_per_quad(face),
269 return adjust_quad_dof_sign_for_face_orientation_table
270 [this->n_unique_quads() == 1 ? 0 : face](
272 4 *
static_cast<int>(face_orientation) + 2 *
static_cast<int>(face_flip) +
273 static_cast<int>(face_rotation));
277template <
int dim,
int spacedim>
281 if (single_mapping_kind())
282 return mapping_kind[0];
285 return mapping_kind[i];
290template <
int dim,
int spacedim>
302template <
int dim,
int spacedim>
305 const unsigned int i,
307 const unsigned int component)
const
312 std::lock_guard<std::mutex> lock(cache_mutex);
314 if (cached_point != p || cached_values.size() == 0)
317 cached_values.resize(poly_space->n());
319 std::vector<Tensor<4, dim>> dummy1;
320 std::vector<Tensor<5, dim>> dummy2;
321 poly_space->evaluate(
322 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
326 if (inverse_node_matrix.n_cols() == 0)
327 return cached_values[i][component];
329 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
330 s += inverse_node_matrix(j, i) * cached_values[j][component];
336template <
int dim,
int spacedim>
347template <
int dim,
int spacedim>
350 const unsigned int i,
352 const unsigned int component)
const
357 std::lock_guard<std::mutex> lock(cache_mutex);
359 if (cached_point != p || cached_grads.size() == 0)
362 cached_grads.resize(poly_space->n());
364 std::vector<Tensor<4, dim>> dummy1;
365 std::vector<Tensor<5, dim>> dummy2;
366 poly_space->evaluate(
367 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
371 if (inverse_node_matrix.n_cols() == 0)
372 return cached_grads[i][component];
374 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
375 s += inverse_node_matrix(j, i) * cached_grads[j][component];
382template <
int dim,
int spacedim>
393template <
int dim,
int spacedim>
396 const unsigned int i,
398 const unsigned int component)
const
403 std::lock_guard<std::mutex> lock(cache_mutex);
405 if (cached_point != p || cached_grad_grads.size() == 0)
408 cached_grad_grads.resize(poly_space->n());
410 std::vector<Tensor<4, dim>> dummy1;
411 std::vector<Tensor<5, dim>> dummy2;
412 poly_space->evaluate(
413 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
417 if (inverse_node_matrix.n_cols() == 0)
418 return cached_grad_grads[i][component];
420 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
421 s += inverse_node_matrix(i, j) * cached_grad_grads[j][component];
431template <
int dim,
int spacedim>
439 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
451 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
453 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
455 const unsigned int n_q_points = quadrature.
size();
458 fe_data.shape_values.size()[0] == this->n_dofs_per_cell(),
460 this->n_dofs_per_cell()));
462 fe_data.shape_values.size()[1] == n_q_points,
470 std::fill(fe_data.dof_sign_change.begin(),
471 fe_data.dof_sign_change.end(),
473 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
476 fe_data.dof_sign_change);
482 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
485 fe_data.dof_sign_change);
488 const unsigned int first_quad_index = this->get_first_quad_index();
490 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
491 const unsigned int n_quad_dofs =
494 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
501 const bool is_quad_dof =
503 (first_quad_index <= dof_index) &&
504 (dof_index < first_quad_index + n_quad_dofs));
514 double dof_sign = 1.0;
517 dof_sign = fe_data.dof_sign_change[dof_index];
525 const unsigned int face_index_from_dof_index =
526 (dof_index - first_quad_index) / (n_dofs_per_quad);
528 const unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
531 if (adjust_quad_dof_sign_for_face_orientation(
532 local_quad_dof_index,
533 face_index_from_dof_index,
534 cell->face_orientation(face_index_from_dof_index),
535 cell->face_flip(face_index_from_dof_index),
536 cell->face_rotation(face_index_from_dof_index)))
540 const MappingKind mapping_kind = get_mapping_kind(dof_index);
542 const unsigned int first =
543 output_data.shape_function_to_row_table
544 [dof_index * this->n_components() +
545 this->get_nonzero_components(dof_index).first_selected_component()];
559 switch (mapping_kind)
563 for (
unsigned int k = 0; k < n_q_points; ++k)
564 for (
unsigned int d = 0;
d < dim; ++
d)
565 output_data.shape_values(
first + d, k) =
566 fe_data.shape_values[dof_index][k][
d];
579 for (
unsigned int k = 0; k < n_q_points; ++k)
580 for (
unsigned int d = 0;
d < dim; ++
d)
581 output_data.shape_values(
first + d, k) =
582 fe_data.transformed_shape_values[k][
d];
595 for (
unsigned int k = 0; k < n_q_points; ++k)
596 for (
unsigned int d = 0;
d < dim; ++
d)
597 output_data.shape_values(
first + d, k) =
598 dof_sign * fe_data.transformed_shape_values[k][
d];
610 for (
unsigned int k = 0; k < n_q_points; ++k)
611 for (
unsigned int d = 0;
d < dim; ++
d)
612 output_data.shape_values(
first + d, k) =
613 dof_sign * fe_data.transformed_shape_values[k][
d];
631 switch (mapping_kind)
640 for (
unsigned int k = 0; k < n_q_points; ++k)
641 for (
unsigned int d = 0;
d < dim; ++
d)
642 output_data.shape_gradients[
first + d][k] =
643 fe_data.transformed_shape_grads[k][d];
654 for (
unsigned int k = 0; k < n_q_points; ++k)
655 for (
unsigned int d = 0;
d < spacedim; ++
d)
656 for (
unsigned int n = 0; n < spacedim; ++n)
657 fe_data.transformed_shape_grads[k][d] -=
658 output_data.shape_values(
first + n, k) *
659 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
661 for (
unsigned int k = 0; k < n_q_points; ++k)
662 for (
unsigned int d = 0;
d < dim; ++
d)
663 output_data.shape_gradients[
first + d][k] =
664 fe_data.transformed_shape_grads[k][d];
670 for (
unsigned int k = 0; k < n_q_points; ++k)
671 fe_data.untransformed_shape_grads[k] =
672 fe_data.shape_grads[dof_index][k];
679 for (
unsigned int k = 0; k < n_q_points; ++k)
680 for (
unsigned int d = 0;
d < spacedim; ++
d)
681 for (
unsigned int n = 0; n < spacedim; ++n)
682 fe_data.transformed_shape_grads[k][d] +=
683 output_data.shape_values(
first + n, k) *
684 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
687 for (
unsigned int k = 0; k < n_q_points; ++k)
688 for (
unsigned int d = 0;
d < dim; ++
d)
689 output_data.shape_gradients[
first + d][k] =
690 fe_data.transformed_shape_grads[k][d];
697 for (
unsigned int k = 0; k < n_q_points; ++k)
698 fe_data.untransformed_shape_grads[k] =
699 fe_data.shape_grads[dof_index][k];
706 for (
unsigned int k = 0; k < n_q_points; ++k)
707 for (
unsigned int d = 0;
d < spacedim; ++
d)
708 for (
unsigned int n = 0; n < spacedim; ++n)
709 fe_data.transformed_shape_grads[k][d] +=
710 (output_data.shape_values(
first + n, k) *
712 .jacobian_pushed_forward_grads[k][d][n]) -
713 (output_data.shape_values(
first + d, k) *
714 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
716 for (
unsigned int k = 0; k < n_q_points; ++k)
717 for (
unsigned int d = 0;
d < dim; ++
d)
718 output_data.shape_gradients[
first + d][k] =
719 dof_sign * fe_data.transformed_shape_grads[k][d];
736 for (
unsigned int k = 0; k < n_q_points; ++k)
737 fe_data.untransformed_shape_grads[k] =
738 fe_data.shape_grads[dof_index][k];
746 for (
unsigned int k = 0; k < n_q_points; ++k)
747 for (
unsigned int d = 0;
d < spacedim; ++
d)
748 for (
unsigned int n = 0; n < spacedim; ++n)
749 fe_data.transformed_shape_grads[k][d] -=
750 output_data.shape_values(
first + n, k) *
751 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
753 for (
unsigned int k = 0; k < n_q_points; ++k)
754 for (
unsigned int d = 0;
d < dim; ++
d)
755 output_data.shape_gradients[
first + d][k] =
756 dof_sign * fe_data.transformed_shape_grads[k][d];
774 switch (mapping_kind)
784 for (
unsigned int k = 0; k < n_q_points; ++k)
785 for (
unsigned int d = 0;
d < spacedim; ++
d)
786 for (
unsigned int n = 0; n < spacedim; ++n)
787 fe_data.transformed_shape_hessians[k][d] -=
788 output_data.shape_gradients[
first + d][k][n] *
789 mapping_data.jacobian_pushed_forward_grads[k][n];
791 for (
unsigned int k = 0; k < n_q_points; ++k)
792 for (
unsigned int d = 0;
d < dim; ++
d)
793 output_data.shape_hessians[
first + d][k] =
794 fe_data.transformed_shape_hessians[k][d];
800 for (
unsigned int k = 0; k < n_q_points; ++k)
801 fe_data.untransformed_shape_hessian_tensors[k] =
802 fe_data.shape_grad_grads[dof_index][k];
806 fe_data.untransformed_shape_hessian_tensors),
811 for (
unsigned int k = 0; k < n_q_points; ++k)
812 for (
unsigned int d = 0;
d < spacedim; ++
d)
813 for (
unsigned int n = 0; n < spacedim; ++n)
814 for (
unsigned int i = 0; i < spacedim; ++i)
815 for (
unsigned int j = 0; j < spacedim; ++j)
817 fe_data.transformed_shape_hessians[k][
d][i][j] -=
818 (output_data.shape_values(
first + n, k) *
820 .jacobian_pushed_forward_2nd_derivatives
822 (output_data.shape_gradients[
first + d][k][n] *
824 .jacobian_pushed_forward_grads[k][n][i][j]) +
825 (output_data.shape_gradients[
first + n][k][i] *
827 .jacobian_pushed_forward_grads[k][n][
d][j]) +
828 (output_data.shape_gradients[
first + n][k][j] *
830 .jacobian_pushed_forward_grads[k][n][i][d]);
833 for (
unsigned int k = 0; k < n_q_points; ++k)
834 for (
unsigned int d = 0;
d < dim; ++
d)
835 output_data.shape_hessians[
first + d][k] =
836 fe_data.transformed_shape_hessians[k][d];
842 for (
unsigned int k = 0; k < n_q_points; ++k)
843 fe_data.untransformed_shape_hessian_tensors[k] =
844 fe_data.shape_grad_grads[dof_index][k];
848 fe_data.untransformed_shape_hessian_tensors),
853 for (
unsigned int k = 0; k < n_q_points; ++k)
854 for (
unsigned int d = 0;
d < spacedim; ++
d)
855 for (
unsigned int n = 0; n < spacedim; ++n)
856 for (
unsigned int i = 0; i < spacedim; ++i)
857 for (
unsigned int j = 0; j < spacedim; ++j)
859 fe_data.transformed_shape_hessians[k][
d][i][j] +=
860 (output_data.shape_values(
first + n, k) *
862 .jacobian_pushed_forward_2nd_derivatives
864 (output_data.shape_gradients[
first + n][k][i] *
866 .jacobian_pushed_forward_grads[k][d][n][j]) +
867 (output_data.shape_gradients[
first + n][k][j] *
869 .jacobian_pushed_forward_grads[k][
d][i][n]) -
870 (output_data.shape_gradients[
first + d][k][n] *
872 .jacobian_pushed_forward_grads[k][n][i][j]);
873 for (
unsigned int m = 0; m < spacedim; ++m)
875 .transformed_shape_hessians[k][d][i][j] -=
877 .jacobian_pushed_forward_grads[k][d][i]
880 .jacobian_pushed_forward_grads[k][m][n]
882 output_data.shape_values(
first + n, k)) +
884 .jacobian_pushed_forward_grads[k][d][m]
887 .jacobian_pushed_forward_grads[k][m][i]
889 output_data.shape_values(
first + n, k));
892 for (
unsigned int k = 0; k < n_q_points; ++k)
893 for (
unsigned int d = 0;
d < dim; ++
d)
894 output_data.shape_hessians[
first + d][k] =
895 fe_data.transformed_shape_hessians[k][d];
902 for (
unsigned int k = 0; k < n_q_points; ++k)
903 fe_data.untransformed_shape_hessian_tensors[k] =
904 fe_data.shape_grad_grads[dof_index][k];
908 fe_data.untransformed_shape_hessian_tensors),
913 for (
unsigned int k = 0; k < n_q_points; ++k)
914 for (
unsigned int d = 0;
d < spacedim; ++
d)
915 for (
unsigned int n = 0; n < spacedim; ++n)
916 for (
unsigned int i = 0; i < spacedim; ++i)
917 for (
unsigned int j = 0; j < spacedim; ++j)
919 fe_data.transformed_shape_hessians[k][
d][i][j] +=
920 (output_data.shape_values(
first + n, k) *
922 .jacobian_pushed_forward_2nd_derivatives
924 (output_data.shape_gradients[
first + n][k][i] *
926 .jacobian_pushed_forward_grads[k][d][n][j]) +
927 (output_data.shape_gradients[
first + n][k][j] *
929 .jacobian_pushed_forward_grads[k][
d][i][n]) -
930 (output_data.shape_gradients[
first + d][k][n] *
932 .jacobian_pushed_forward_grads[k][n][i][j]);
934 fe_data.transformed_shape_hessians[k][
d][i][j] -=
935 (output_data.shape_values(
first + d, k) *
937 .jacobian_pushed_forward_2nd_derivatives
939 (output_data.shape_gradients[
first + d][k][i] *
941 .jacobian_pushed_forward_grads[k][n][n][j]) +
942 (output_data.shape_gradients[
first +
d][k][j] *
944 .jacobian_pushed_forward_grads[k][n][n][i]);
946 for (
unsigned int m = 0; m < spacedim; ++m)
949 .transformed_shape_hessians[k][
d][i][j] -=
951 .jacobian_pushed_forward_grads[k][
d][i]
954 .jacobian_pushed_forward_grads[k][m][n]
956 output_data.shape_values(
first + n, k)) +
958 .jacobian_pushed_forward_grads[k][d][m]
961 .jacobian_pushed_forward_grads[k][m][i]
963 output_data.shape_values(
first + n, k));
966 .transformed_shape_hessians[k][
d][i][j] +=
968 .jacobian_pushed_forward_grads[k][n][i]
971 .jacobian_pushed_forward_grads[k][m][n]
973 output_data.shape_values(
first + d, k)) +
975 .jacobian_pushed_forward_grads[k][n][m]
978 .jacobian_pushed_forward_grads[k][m][i]
980 output_data.shape_values(
first + d, k));
984 for (
unsigned int k = 0; k < n_q_points; ++k)
985 for (
unsigned int d = 0;
d < dim; ++
d)
986 output_data.shape_hessians[
first + d][k] =
987 dof_sign * fe_data.transformed_shape_hessians[k][d];
994 for (
unsigned int k = 0; k < n_q_points; ++k)
995 fe_data.untransformed_shape_hessian_tensors[k] =
996 fe_data.shape_grad_grads[dof_index][k];
1000 fe_data.untransformed_shape_hessian_tensors),
1005 for (
unsigned int k = 0; k < n_q_points; ++k)
1006 for (
unsigned int d = 0;
d < spacedim; ++
d)
1007 for (
unsigned int n = 0; n < spacedim; ++n)
1008 for (
unsigned int i = 0; i < spacedim; ++i)
1009 for (
unsigned int j = 0; j < spacedim; ++j)
1011 fe_data.transformed_shape_hessians[k][
d][i][j] -=
1012 (output_data.shape_values(
first + n, k) *
1014 .jacobian_pushed_forward_2nd_derivatives
1016 (output_data.shape_gradients[
first + d][k][n] *
1018 .jacobian_pushed_forward_grads[k][n][i][j]) +
1019 (output_data.shape_gradients[
first + n][k][i] *
1021 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1022 (output_data.shape_gradients[
first + n][k][j] *
1024 .jacobian_pushed_forward_grads[k][n][i][d]);
1027 for (
unsigned int k = 0; k < n_q_points; ++k)
1028 for (
unsigned int d = 0;
d < dim; ++
d)
1029 output_data.shape_hessians[
first + d][k] =
1030 dof_sign * fe_data.transformed_shape_hessians[k][d];
1054template <
int dim,
int spacedim>
1058 const unsigned int face_no,
1062 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
1076 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
1078 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
1080 const unsigned int n_q_points = quadrature[0].
size();
1088 cell->face_orientation(face_no),
1089 cell->face_flip(face_no),
1090 cell->face_rotation(face_no),
1100 std::fill(fe_data.dof_sign_change.begin(),
1101 fe_data.dof_sign_change.end(),
1103 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
1106 fe_data.dof_sign_change);
1112 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
1115 fe_data.dof_sign_change);
1118 const unsigned int first_quad_index = this->get_first_quad_index();
1120 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
1121 const unsigned int n_quad_dofs =
1124 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
1131 const bool is_quad_dof =
1133 (first_quad_index <= dof_index) &&
1134 (dof_index < first_quad_index + n_quad_dofs));
1144 double dof_sign = 1.0;
1147 dof_sign = fe_data.dof_sign_change[dof_index];
1155 unsigned int face_index_from_dof_index =
1156 (dof_index - first_quad_index) / (n_dofs_per_quad);
1158 unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
1161 if (adjust_quad_dof_sign_for_face_orientation(
1162 local_quad_dof_index,
1163 face_index_from_dof_index,
1164 cell->face_orientation(face_index_from_dof_index),
1165 cell->face_flip(face_index_from_dof_index),
1166 cell->face_rotation(face_index_from_dof_index)))
1170 const MappingKind mapping_kind = get_mapping_kind(dof_index);
1172 const unsigned int first =
1173 output_data.shape_function_to_row_table
1174 [dof_index * this->n_components() +
1175 this->get_nonzero_components(dof_index).first_selected_component()];
1179 switch (mapping_kind)
1183 for (
unsigned int k = 0; k < n_q_points; ++k)
1184 for (
unsigned int d = 0;
d < dim; ++
d)
1185 output_data.shape_values(
first + d, k) =
1186 fe_data.shape_values[dof_index][k + offset][
d];
1194 transformed_shape_values =
1204 transformed_shape_values);
1206 for (
unsigned int k = 0; k < n_q_points; ++k)
1207 for (
unsigned int d = 0;
d < dim; ++
d)
1208 output_data.shape_values(
first + d, k) =
1209 transformed_shape_values[k][
d];
1217 transformed_shape_values =
1227 transformed_shape_values);
1228 for (
unsigned int k = 0; k < n_q_points; ++k)
1229 for (
unsigned int d = 0;
d < dim; ++
d)
1230 output_data.shape_values(
first + d, k) =
1231 dof_sign * transformed_shape_values[k][
d];
1238 transformed_shape_values =
1248 transformed_shape_values);
1250 for (
unsigned int k = 0; k < n_q_points; ++k)
1251 for (
unsigned int d = 0;
d < dim; ++
d)
1252 output_data.shape_values(
first + d, k) =
1253 dof_sign * transformed_shape_values[k][
d];
1265 switch (mapping_kind)
1279 transformed_shape_grads);
1280 for (
unsigned int k = 0; k < n_q_points; ++k)
1281 for (
unsigned int d = 0;
d < dim; ++
d)
1282 output_data.shape_gradients[
first + d][k] =
1283 transformed_shape_grads[k][d];
1299 transformed_shape_grads);
1301 for (
unsigned int k = 0; k < n_q_points; ++k)
1302 for (
unsigned int d = 0;
d < spacedim; ++
d)
1303 for (
unsigned int n = 0; n < spacedim; ++n)
1304 transformed_shape_grads[k][d] -=
1305 output_data.shape_values(
first + n, k) *
1306 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1308 for (
unsigned int k = 0; k < n_q_points; ++k)
1309 for (
unsigned int d = 0;
d < dim; ++
d)
1310 output_data.shape_gradients[
first + d][k] =
1311 transformed_shape_grads[k][d];
1321 for (
unsigned int k = 0; k < n_q_points; ++k)
1322 fe_data.untransformed_shape_grads[k + offset] =
1323 fe_data.shape_grads[dof_index][k + offset];
1330 transformed_shape_grads);
1332 for (
unsigned int k = 0; k < n_q_points; ++k)
1333 for (
unsigned int d = 0;
d < spacedim; ++
d)
1334 for (
unsigned int n = 0; n < spacedim; ++n)
1335 transformed_shape_grads[k][d] +=
1336 output_data.shape_values(
first + n, k) *
1337 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
1339 for (
unsigned int k = 0; k < n_q_points; ++k)
1340 for (
unsigned int d = 0;
d < dim; ++
d)
1341 output_data.shape_gradients[
first + d][k] =
1342 transformed_shape_grads[k][d];
1354 for (
unsigned int k = 0; k < n_q_points; ++k)
1355 fe_data.untransformed_shape_grads[k + offset] =
1356 fe_data.shape_grads[dof_index][k + offset];
1363 transformed_shape_grads);
1365 for (
unsigned int k = 0; k < n_q_points; ++k)
1366 for (
unsigned int d = 0;
d < spacedim; ++
d)
1367 for (
unsigned int n = 0; n < spacedim; ++n)
1368 transformed_shape_grads[k][d] +=
1369 (output_data.shape_values(
first + n, k) *
1371 .jacobian_pushed_forward_grads[k][d][n]) -
1372 (output_data.shape_values(
first + d, k) *
1373 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
1375 for (
unsigned int k = 0; k < n_q_points; ++k)
1376 for (
unsigned int d = 0;
d < dim; ++
d)
1377 output_data.shape_gradients[
first + d][k] =
1378 dof_sign * transformed_shape_grads[k][d];
1395 for (
unsigned int k = 0; k < n_q_points; ++k)
1396 fe_data.untransformed_shape_grads[k + offset] =
1397 fe_data.shape_grads[dof_index][k + offset];
1409 transformed_shape_grads);
1411 for (
unsigned int k = 0; k < n_q_points; ++k)
1412 for (
unsigned int d = 0;
d < spacedim; ++
d)
1413 for (
unsigned int n = 0; n < spacedim; ++n)
1414 transformed_shape_grads[k][d] -=
1415 output_data.shape_values(
first + n, k) *
1416 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1418 for (
unsigned int k = 0; k < n_q_points; ++k)
1419 for (
unsigned int d = 0;
d < dim; ++
d)
1420 output_data.shape_gradients[
first + d][k] =
1421 dof_sign * transformed_shape_grads[k][d];
1433 switch (mapping_kind)
1438 transformed_shape_hessians =
1448 transformed_shape_hessians);
1450 for (
unsigned int k = 0; k < n_q_points; ++k)
1451 for (
unsigned int d = 0;
d < spacedim; ++
d)
1452 for (
unsigned int n = 0; n < spacedim; ++n)
1453 transformed_shape_hessians[k][d] -=
1454 output_data.shape_gradients[
first + d][k][n] *
1455 mapping_data.jacobian_pushed_forward_grads[k][n];
1457 for (
unsigned int k = 0; k < n_q_points; ++k)
1458 for (
unsigned int d = 0;
d < dim; ++
d)
1459 output_data.shape_hessians[
first + d][k] =
1460 transformed_shape_hessians[k][d];
1466 for (
unsigned int k = 0; k < n_q_points; ++k)
1467 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1468 fe_data.shape_grad_grads[dof_index][k + offset];
1471 transformed_shape_hessians =
1481 transformed_shape_hessians);
1483 for (
unsigned int k = 0; k < n_q_points; ++k)
1484 for (
unsigned int d = 0;
d < spacedim; ++
d)
1485 for (
unsigned int n = 0; n < spacedim; ++n)
1486 for (
unsigned int i = 0; i < spacedim; ++i)
1487 for (
unsigned int j = 0; j < spacedim; ++j)
1489 transformed_shape_hessians[k][
d][i][j] -=
1490 (output_data.shape_values(
first + n, k) *
1492 .jacobian_pushed_forward_2nd_derivatives
1494 (output_data.shape_gradients[
first + d][k][n] *
1496 .jacobian_pushed_forward_grads[k][n][i][j]) +
1497 (output_data.shape_gradients[
first + n][k][i] *
1499 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1500 (output_data.shape_gradients[
first + n][k][j] *
1502 .jacobian_pushed_forward_grads[k][n][i][d]);
1505 for (
unsigned int k = 0; k < n_q_points; ++k)
1506 for (
unsigned int d = 0;
d < dim; ++
d)
1507 output_data.shape_hessians[
first + d][k] =
1508 transformed_shape_hessians[k][d];
1515 for (
unsigned int k = 0; k < n_q_points; ++k)
1516 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1517 fe_data.shape_grad_grads[dof_index][k + offset];
1520 transformed_shape_hessians =
1530 transformed_shape_hessians);
1532 for (
unsigned int k = 0; k < n_q_points; ++k)
1533 for (
unsigned int d = 0;
d < spacedim; ++
d)
1534 for (
unsigned int n = 0; n < spacedim; ++n)
1535 for (
unsigned int i = 0; i < spacedim; ++i)
1536 for (
unsigned int j = 0; j < spacedim; ++j)
1538 transformed_shape_hessians[k][
d][i][j] +=
1539 (output_data.shape_values(
first + n, k) *
1541 .jacobian_pushed_forward_2nd_derivatives
1543 (output_data.shape_gradients[
first + n][k][i] *
1545 .jacobian_pushed_forward_grads[k][d][n][j]) +
1546 (output_data.shape_gradients[
first + n][k][j] *
1548 .jacobian_pushed_forward_grads[k][
d][i][n]) -
1549 (output_data.shape_gradients[
first + d][k][n] *
1551 .jacobian_pushed_forward_grads[k][n][i][j]);
1552 for (
unsigned int m = 0; m < spacedim; ++m)
1553 transformed_shape_hessians[k][d][i][j] -=
1555 .jacobian_pushed_forward_grads[k][d][i]
1558 .jacobian_pushed_forward_grads[k][m][n]
1560 output_data.shape_values(
first + n, k)) +
1562 .jacobian_pushed_forward_grads[k][d][m]
1565 .jacobian_pushed_forward_grads[k][m][i]
1567 output_data.shape_values(
first + n, k));
1570 for (
unsigned int k = 0; k < n_q_points; ++k)
1571 for (
unsigned int d = 0;
d < dim; ++
d)
1572 output_data.shape_hessians[
first + d][k] =
1573 transformed_shape_hessians[k][d];
1581 for (
unsigned int k = 0; k < n_q_points; ++k)
1582 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1583 fe_data.shape_grad_grads[dof_index][k + offset];
1586 transformed_shape_hessians =
1596 transformed_shape_hessians);
1598 for (
unsigned int k = 0; k < n_q_points; ++k)
1599 for (
unsigned int d = 0;
d < spacedim; ++
d)
1600 for (
unsigned int n = 0; n < spacedim; ++n)
1601 for (
unsigned int i = 0; i < spacedim; ++i)
1602 for (
unsigned int j = 0; j < spacedim; ++j)
1604 transformed_shape_hessians[k][
d][i][j] +=
1605 (output_data.shape_values(
first + n, k) *
1607 .jacobian_pushed_forward_2nd_derivatives
1609 (output_data.shape_gradients[
first + n][k][i] *
1611 .jacobian_pushed_forward_grads[k][d][n][j]) +
1612 (output_data.shape_gradients[
first + n][k][j] *
1614 .jacobian_pushed_forward_grads[k][
d][i][n]) -
1615 (output_data.shape_gradients[
first + d][k][n] *
1617 .jacobian_pushed_forward_grads[k][n][i][j]);
1619 transformed_shape_hessians[k][
d][i][j] -=
1620 (output_data.shape_values(
first + d, k) *
1622 .jacobian_pushed_forward_2nd_derivatives
1624 (output_data.shape_gradients[
first + d][k][i] *
1626 .jacobian_pushed_forward_grads[k][n][n][j]) +
1627 (output_data.shape_gradients[
first +
d][k][j] *
1629 .jacobian_pushed_forward_grads[k][n][n][i]);
1631 for (
unsigned int m = 0; m < spacedim; ++m)
1633 transformed_shape_hessians[k][
d][i][j] -=
1635 .jacobian_pushed_forward_grads[k][
d][i]
1638 .jacobian_pushed_forward_grads[k][m][n]
1640 output_data.shape_values(
first + n, k)) +
1642 .jacobian_pushed_forward_grads[k][d][m]
1645 .jacobian_pushed_forward_grads[k][m][i]
1647 output_data.shape_values(
first + n, k));
1649 transformed_shape_hessians[k][
d][i][j] +=
1651 .jacobian_pushed_forward_grads[k][n][i]
1654 .jacobian_pushed_forward_grads[k][m][n]
1656 output_data.shape_values(
first + d, k)) +
1658 .jacobian_pushed_forward_grads[k][n][m]
1661 .jacobian_pushed_forward_grads[k][m][i]
1663 output_data.shape_values(
first + d, k));
1667 for (
unsigned int k = 0; k < n_q_points; ++k)
1668 for (
unsigned int d = 0;
d < dim; ++
d)
1669 output_data.shape_hessians[
first + d][k] =
1670 dof_sign * transformed_shape_hessians[k][d];
1677 for (
unsigned int k = 0; k < n_q_points; ++k)
1678 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1679 fe_data.shape_grad_grads[dof_index][k + offset];
1682 transformed_shape_hessians =
1692 transformed_shape_hessians);
1694 for (
unsigned int k = 0; k < n_q_points; ++k)
1695 for (
unsigned int d = 0;
d < spacedim; ++
d)
1696 for (
unsigned int n = 0; n < spacedim; ++n)
1697 for (
unsigned int i = 0; i < spacedim; ++i)
1698 for (
unsigned int j = 0; j < spacedim; ++j)
1700 transformed_shape_hessians[k][
d][i][j] -=
1701 (output_data.shape_values(
first + n, k) *
1703 .jacobian_pushed_forward_2nd_derivatives
1705 (output_data.shape_gradients[
first + d][k][n] *
1707 .jacobian_pushed_forward_grads[k][n][i][j]) +
1708 (output_data.shape_gradients[
first + n][k][i] *
1710 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1711 (output_data.shape_gradients[
first + n][k][j] *
1713 .jacobian_pushed_forward_grads[k][n][i][d]);
1716 for (
unsigned int k = 0; k < n_q_points; ++k)
1717 for (
unsigned int d = 0;
d < dim; ++
d)
1718 output_data.shape_hessians[
first + d][k] =
1719 dof_sign * transformed_shape_hessians[k][d];
1739template <
int dim,
int spacedim>
1743 const unsigned int face_no,
1744 const unsigned int sub_no,
1748 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
1760 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
1762 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
1764 const unsigned int n_q_points = quadrature.
size();
1773 cell->face_orientation(face_no),
1774 cell->face_flip(face_no),
1775 cell->face_rotation(face_no),
1777 cell->subface_case(face_no));
1786 std::fill(fe_data.dof_sign_change.begin(),
1787 fe_data.dof_sign_change.end(),
1789 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
1792 fe_data.dof_sign_change);
1798 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
1801 fe_data.dof_sign_change);
1804 const unsigned int first_quad_index = this->get_first_quad_index();
1806 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
1807 const unsigned int n_quad_dofs =
1810 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
1817 const bool is_quad_dof =
1819 (first_quad_index <= dof_index) &&
1820 (dof_index < first_quad_index + n_quad_dofs));
1830 double dof_sign = 1.0;
1833 dof_sign = fe_data.dof_sign_change[dof_index];
1841 unsigned int face_index_from_dof_index =
1842 (dof_index - first_quad_index) / (n_dofs_per_quad);
1844 unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
1847 if (adjust_quad_dof_sign_for_face_orientation(
1848 local_quad_dof_index,
1849 face_index_from_dof_index,
1850 cell->face_orientation(face_index_from_dof_index),
1851 cell->face_flip(face_index_from_dof_index),
1852 cell->face_rotation(face_index_from_dof_index)))
1856 const MappingKind mapping_kind = get_mapping_kind(dof_index);
1858 const unsigned int first =
1859 output_data.shape_function_to_row_table
1860 [dof_index * this->n_components() +
1861 this->get_nonzero_components(dof_index).first_selected_component()];
1865 switch (mapping_kind)
1869 for (
unsigned int k = 0; k < n_q_points; ++k)
1870 for (
unsigned int d = 0;
d < dim; ++
d)
1871 output_data.shape_values(
first + d, k) =
1872 fe_data.shape_values[dof_index][k + offset][
d];
1880 transformed_shape_values =
1890 transformed_shape_values);
1892 for (
unsigned int k = 0; k < n_q_points; ++k)
1893 for (
unsigned int d = 0;
d < dim; ++
d)
1894 output_data.shape_values(
first + d, k) =
1895 transformed_shape_values[k][
d];
1904 transformed_shape_values =
1915 transformed_shape_values);
1916 for (
unsigned int k = 0; k < n_q_points; ++k)
1917 for (
unsigned int d = 0;
d < dim; ++
d)
1918 output_data.shape_values(
first + d, k) =
1919 dof_sign * transformed_shape_values[k][
d];
1926 transformed_shape_values =
1937 transformed_shape_values);
1939 for (
unsigned int k = 0; k < n_q_points; ++k)
1940 for (
unsigned int d = 0;
d < dim; ++
d)
1941 output_data.shape_values(
first + d, k) =
1942 dof_sign * transformed_shape_values[k][
d];
1958 switch (mapping_kind)
1968 transformed_shape_grads);
1969 for (
unsigned int k = 0; k < n_q_points; ++k)
1970 for (
unsigned int d = 0;
d < dim; ++
d)
1971 output_data.shape_gradients[
first + d][k] =
1972 transformed_shape_grads[k][d];
1984 transformed_shape_grads);
1986 for (
unsigned int k = 0; k < n_q_points; ++k)
1987 for (
unsigned int d = 0;
d < spacedim; ++
d)
1988 for (
unsigned int n = 0; n < spacedim; ++n)
1989 transformed_shape_grads[k][d] -=
1990 output_data.shape_values(
first + n, k) *
1991 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1993 for (
unsigned int k = 0; k < n_q_points; ++k)
1994 for (
unsigned int d = 0;
d < dim; ++
d)
1995 output_data.shape_gradients[
first + d][k] =
1996 transformed_shape_grads[k][d];
2003 for (
unsigned int k = 0; k < n_q_points; ++k)
2004 fe_data.untransformed_shape_grads[k + offset] =
2005 fe_data.shape_grads[dof_index][k + offset];
2013 transformed_shape_grads);
2015 for (
unsigned int k = 0; k < n_q_points; ++k)
2016 for (
unsigned int d = 0;
d < spacedim; ++
d)
2017 for (
unsigned int n = 0; n < spacedim; ++n)
2018 transformed_shape_grads[k][d] +=
2019 output_data.shape_values(
first + n, k) *
2020 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
2022 for (
unsigned int k = 0; k < n_q_points; ++k)
2023 for (
unsigned int d = 0;
d < dim; ++
d)
2024 output_data.shape_gradients[
first + d][k] =
2025 transformed_shape_grads[k][d];
2033 for (
unsigned int k = 0; k < n_q_points; ++k)
2034 fe_data.untransformed_shape_grads[k + offset] =
2035 fe_data.shape_grads[dof_index][k + offset];
2043 transformed_shape_grads);
2045 for (
unsigned int k = 0; k < n_q_points; ++k)
2046 for (
unsigned int d = 0;
d < spacedim; ++
d)
2047 for (
unsigned int n = 0; n < spacedim; ++n)
2048 transformed_shape_grads[k][d] +=
2049 (output_data.shape_values(
first + n, k) *
2051 .jacobian_pushed_forward_grads[k][d][n]) -
2052 (output_data.shape_values(
first + d, k) *
2053 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
2055 for (
unsigned int k = 0; k < n_q_points; ++k)
2056 for (
unsigned int d = 0;
d < dim; ++
d)
2057 output_data.shape_gradients[
first + d][k] =
2058 dof_sign * transformed_shape_grads[k][d];
2074 for (
unsigned int k = 0; k < n_q_points; ++k)
2075 fe_data.untransformed_shape_grads[k + offset] =
2076 fe_data.shape_grads[dof_index][k + offset];
2084 transformed_shape_grads);
2086 for (
unsigned int k = 0; k < n_q_points; ++k)
2087 for (
unsigned int d = 0;
d < spacedim; ++
d)
2088 for (
unsigned int n = 0; n < spacedim; ++n)
2089 transformed_shape_grads[k][d] -=
2090 output_data.shape_values(
first + n, k) *
2091 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
2093 for (
unsigned int k = 0; k < n_q_points; ++k)
2094 for (
unsigned int d = 0;
d < dim; ++
d)
2095 output_data.shape_gradients[
first + d][k] =
2096 dof_sign * transformed_shape_grads[k][d];
2108 switch (mapping_kind)
2113 transformed_shape_hessians =
2123 transformed_shape_hessians);
2125 for (
unsigned int k = 0; k < n_q_points; ++k)
2126 for (
unsigned int d = 0;
d < spacedim; ++
d)
2127 for (
unsigned int n = 0; n < spacedim; ++n)
2128 transformed_shape_hessians[k][d] -=
2129 output_data.shape_gradients[
first + d][k][n] *
2130 mapping_data.jacobian_pushed_forward_grads[k][n];
2132 for (
unsigned int k = 0; k < n_q_points; ++k)
2133 for (
unsigned int d = 0;
d < dim; ++
d)
2134 output_data.shape_hessians[
first + d][k] =
2135 transformed_shape_hessians[k][d];
2141 for (
unsigned int k = 0; k < n_q_points; ++k)
2142 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2143 fe_data.shape_grad_grads[dof_index][k + offset];
2146 transformed_shape_hessians =
2156 transformed_shape_hessians);
2158 for (
unsigned int k = 0; k < n_q_points; ++k)
2159 for (
unsigned int d = 0;
d < spacedim; ++
d)
2160 for (
unsigned int n = 0; n < spacedim; ++n)
2161 for (
unsigned int i = 0; i < spacedim; ++i)
2162 for (
unsigned int j = 0; j < spacedim; ++j)
2164 transformed_shape_hessians[k][
d][i][j] -=
2165 (output_data.shape_values(
first + n, k) *
2167 .jacobian_pushed_forward_2nd_derivatives
2169 (output_data.shape_gradients[
first + d][k][n] *
2171 .jacobian_pushed_forward_grads[k][n][i][j]) +
2172 (output_data.shape_gradients[
first + n][k][i] *
2174 .jacobian_pushed_forward_grads[k][n][
d][j]) +
2175 (output_data.shape_gradients[
first + n][k][j] *
2177 .jacobian_pushed_forward_grads[k][n][i][d]);
2180 for (
unsigned int k = 0; k < n_q_points; ++k)
2181 for (
unsigned int d = 0;
d < dim; ++
d)
2182 output_data.shape_hessians[
first + d][k] =
2183 transformed_shape_hessians[k][d];
2190 for (
unsigned int k = 0; k < n_q_points; ++k)
2191 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2192 fe_data.shape_grad_grads[dof_index][k + offset];
2195 transformed_shape_hessians =
2205 transformed_shape_hessians);
2207 for (
unsigned int k = 0; k < n_q_points; ++k)
2208 for (
unsigned int d = 0;
d < spacedim; ++
d)
2209 for (
unsigned int n = 0; n < spacedim; ++n)
2210 for (
unsigned int i = 0; i < spacedim; ++i)
2211 for (
unsigned int j = 0; j < spacedim; ++j)
2213 transformed_shape_hessians[k][
d][i][j] +=
2214 (output_data.shape_values(
first + n, k) *
2216 .jacobian_pushed_forward_2nd_derivatives
2218 (output_data.shape_gradients[
first + n][k][i] *
2220 .jacobian_pushed_forward_grads[k][d][n][j]) +
2221 (output_data.shape_gradients[
first + n][k][j] *
2223 .jacobian_pushed_forward_grads[k][
d][i][n]) -
2224 (output_data.shape_gradients[
first + d][k][n] *
2226 .jacobian_pushed_forward_grads[k][n][i][j]);
2227 for (
unsigned int m = 0; m < spacedim; ++m)
2228 transformed_shape_hessians[k][d][i][j] -=
2230 .jacobian_pushed_forward_grads[k][d][i]
2233 .jacobian_pushed_forward_grads[k][m][n]
2235 output_data.shape_values(
first + n, k)) +
2237 .jacobian_pushed_forward_grads[k][d][m]
2240 .jacobian_pushed_forward_grads[k][m][i]
2242 output_data.shape_values(
first + n, k));
2245 for (
unsigned int k = 0; k < n_q_points; ++k)
2246 for (
unsigned int d = 0;
d < dim; ++
d)
2247 output_data.shape_hessians[
first + d][k] =
2248 transformed_shape_hessians[k][d];
2256 for (
unsigned int k = 0; k < n_q_points; ++k)
2257 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2258 fe_data.shape_grad_grads[dof_index][k + offset];
2261 transformed_shape_hessians =
2271 transformed_shape_hessians);
2273 for (
unsigned int k = 0; k < n_q_points; ++k)
2274 for (
unsigned int d = 0;
d < spacedim; ++
d)
2275 for (
unsigned int n = 0; n < spacedim; ++n)
2276 for (
unsigned int i = 0; i < spacedim; ++i)
2277 for (
unsigned int j = 0; j < spacedim; ++j)
2279 transformed_shape_hessians[k][
d][i][j] +=
2280 (output_data.shape_values(
first + n, k) *
2282 .jacobian_pushed_forward_2nd_derivatives
2284 (output_data.shape_gradients[
first + n][k][i] *
2286 .jacobian_pushed_forward_grads[k][d][n][j]) +
2287 (output_data.shape_gradients[
first + n][k][j] *
2289 .jacobian_pushed_forward_grads[k][
d][i][n]) -
2290 (output_data.shape_gradients[
first + d][k][n] *
2292 .jacobian_pushed_forward_grads[k][n][i][j]);
2294 transformed_shape_hessians[k][
d][i][j] -=
2295 (output_data.shape_values(
first + d, k) *
2297 .jacobian_pushed_forward_2nd_derivatives
2299 (output_data.shape_gradients[
first + d][k][i] *
2301 .jacobian_pushed_forward_grads[k][n][n][j]) +
2302 (output_data.shape_gradients[
first +
d][k][j] *
2304 .jacobian_pushed_forward_grads[k][n][n][i]);
2305 for (
unsigned int m = 0; m < spacedim; ++m)
2307 transformed_shape_hessians[k][
d][i][j] -=
2309 .jacobian_pushed_forward_grads[k][
d][i]
2312 .jacobian_pushed_forward_grads[k][m][n]
2314 output_data.shape_values(
first + n, k)) +
2316 .jacobian_pushed_forward_grads[k][d][m]
2319 .jacobian_pushed_forward_grads[k][m][i]
2321 output_data.shape_values(
first + n, k));
2323 transformed_shape_hessians[k][
d][i][j] +=
2325 .jacobian_pushed_forward_grads[k][n][i]
2328 .jacobian_pushed_forward_grads[k][m][n]
2330 output_data.shape_values(
first + d, k)) +
2332 .jacobian_pushed_forward_grads[k][n][m]
2335 .jacobian_pushed_forward_grads[k][m][i]
2337 output_data.shape_values(
first + d, k));
2341 for (
unsigned int k = 0; k < n_q_points; ++k)
2342 for (
unsigned int d = 0;
d < dim; ++
d)
2343 output_data.shape_hessians[
first + d][k] =
2344 dof_sign * transformed_shape_hessians[k][d];
2351 for (
unsigned int k = 0; k < n_q_points; ++k)
2352 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2353 fe_data.shape_grad_grads[dof_index][k + offset];
2356 transformed_shape_hessians =
2366 transformed_shape_hessians);
2368 for (
unsigned int k = 0; k < n_q_points; ++k)
2369 for (
unsigned int d = 0;
d < spacedim; ++
d)
2370 for (
unsigned int n = 0; n < spacedim; ++n)
2371 for (
unsigned int i = 0; i < spacedim; ++i)
2372 for (
unsigned int j = 0; j < spacedim; ++j)
2374 transformed_shape_hessians[k][
d][i][j] -=
2375 (output_data.shape_values(
first + n, k) *
2377 .jacobian_pushed_forward_2nd_derivatives
2379 (output_data.shape_gradients[
first + d][k][n] *
2381 .jacobian_pushed_forward_grads[k][n][i][j]) +
2382 (output_data.shape_gradients[
first + n][k][i] *
2384 .jacobian_pushed_forward_grads[k][n][
d][j]) +
2385 (output_data.shape_gradients[
first + n][k][j] *
2387 .jacobian_pushed_forward_grads[k][n][i][d]);
2390 for (
unsigned int k = 0; k < n_q_points; ++k)
2391 for (
unsigned int d = 0;
d < dim; ++
d)
2392 output_data.shape_hessians[
first + d][k] =
2393 dof_sign * transformed_shape_hessians[k][d];
2413template <
int dim,
int spacedim>
2420 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
2422 const MappingKind mapping_kind = get_mapping_kind(i);
2424 switch (mapping_kind)
2515#include "fe_poly_tensor.inst"
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const override
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const override
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const typename FiniteElement< dim, spacedim >::InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const override
virtual double shape_value(const unsigned int i, const Point< dim > &p) const override
bool adjust_quad_dof_sign_for_face_orientation(const unsigned int index, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation) const
virtual void fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const typename FiniteElement< dim, spacedim >::InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const override
MappingKind get_mapping_kind(const unsigned int i) const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const typename FiniteElement< dim, spacedim >::InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const override
FE_PolyTensor(const TensorPolynomialsBase< dim > &polynomials, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
bool single_mapping_kind() const
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const override
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false) const
Abstract base class for mapping classes.
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const =0
static DataSetDescriptor subface(const unsigned int face_no, const unsigned int subface_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points, const internal::SubfaceCase< dim > ref_case=internal::SubfaceCase< dim >::case_isotropic)
static DataSetDescriptor face(const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points)
unsigned int size() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_contravariant_transformation
Contravariant transformation.
@ update_jacobian_pushed_forward_grads
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_covariant_transformation
Covariant transformation.
@ update_gradients
Shape function gradients.
@ update_default
No update.
@ update_piola
Values needed for Piola transform.
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
@ mapping_covariant_gradient
@ mapping_contravariant_hessian
@ mapping_covariant_hessian
@ mapping_contravariant_gradient
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
constexpr const ReferenceCell Quadrilateral