41 template <
int spacedim>
43 get_dof_sign_change_h_div(
44 const typename ::Triangulation<1, spacedim>::cell_iterator &,
46 const std::vector<MappingKind> &,
47 std::vector<double> &)
59 template <
int spacedim>
61 get_dof_sign_change_h_div(
62 const typename ::Triangulation<2, spacedim>::cell_iterator &cell,
64 const std::vector<MappingKind> &mapping_kind,
65 std::vector<double> & face_sign)
67 const unsigned int dim = 2;
71 f < GeometryInfo<dim>::faces_per_cell;
74 typename ::Triangulation<dim, spacedim>::face_iterator face =
76 if (!face->at_boundary())
78 const unsigned int nn = cell->neighbor_face_no(f);
87 Assert(mapping_kind.size() == 1 ||
88 cell_j < mapping_kind.size(),
93 if ((mapping_kind.size() > 1 ?
94 mapping_kind[cell_j] :
104 template <
int spacedim>
106 get_dof_sign_change_h_div(
107 const typename ::Triangulation<3, spacedim>::cell_iterator
110 const std::vector<MappingKind> & ,
111 std::vector<double> & )
117 template <
int spacedim>
119 get_dof_sign_change_nedelec(
120 const typename ::Triangulation<1, spacedim>::cell_iterator
123 const std::vector<MappingKind> & ,
124 std::vector<double> & )
131 template <
int spacedim>
133 get_dof_sign_change_nedelec(
134 const typename ::Triangulation<2, spacedim>::cell_iterator
137 const std::vector<MappingKind> & ,
138 std::vector<double> & )
144 template <
int spacedim>
146 get_dof_sign_change_nedelec(
147 const typename ::Triangulation<3, spacedim>::cell_iterator &cell,
149 const std::vector<MappingKind> &mapping_kind,
150 std::vector<double> & line_dof_sign)
152 const unsigned int dim = 3;
155 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
156 if (!(cell->line_orientation(
l)) &&
158 line_dof_sign[
l] = -1.0;
165template <
int dim,
int spacedim>
169 const std::vector<bool> & restriction_is_additive_flags,
170 const std::vector<ComponentMask> &nonzero_components)
172 restriction_is_additive_flags,
175 , poly_space(polynomials.clone())
177 cached_point(0) = -1;
185 for (
unsigned int comp = 0; comp < this->n_components(); ++comp)
186 this->component_to_base_table[comp].
first.second = comp;
190 adjust_quad_dof_sign_for_face_orientation_table.resize(
191 this->n_unique_quads());
193 for (
unsigned int f = 0; f < this->n_unique_quads(); ++f)
195 adjust_quad_dof_sign_for_face_orientation_table[f] =
201 adjust_quad_dof_sign_for_face_orientation_table[f].fill(
false);
208template <
int dim,
int spacedim>
211 , mapping_kind(fe.mapping_kind)
212 , adjust_quad_dof_sign_for_face_orientation_table(
213 fe.adjust_quad_dof_sign_for_face_orientation_table)
214 , poly_space(fe.poly_space->clone())
215 , inverse_node_matrix(fe.inverse_node_matrix)
220template <
int dim,
int spacedim>
224 return mapping_kind.size() == 1;
228template <
int dim,
int spacedim>
231 const unsigned int index,
232 const unsigned int face,
233 const bool face_orientation,
234 const bool face_flip,
235 const bool face_rotation)
const
248 Assert(adjust_quad_dof_sign_for_face_orientation_table
249 [this->n_unique_quads() == 1 ? 0 : face]
254 this->n_dofs_per_quad(face),
257 return adjust_quad_dof_sign_for_face_orientation_table
258 [this->n_unique_quads() == 1 ? 0 : face](index,
259 4 * face_orientation +
260 2 * face_flip + face_rotation);
264template <
int dim,
int spacedim>
268 if (single_mapping_kind())
269 return mapping_kind[0];
272 return mapping_kind[i];
277template <
int dim,
int spacedim>
289template <
int dim,
int spacedim>
292 const unsigned int i,
294 const unsigned int component)
const
299 std::lock_guard<std::mutex> lock(cache_mutex);
301 if (cached_point != p || cached_values.size() == 0)
304 cached_values.resize(poly_space->n());
306 std::vector<Tensor<4, dim>> dummy1;
307 std::vector<Tensor<5, dim>> dummy2;
308 poly_space->evaluate(
309 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
313 if (inverse_node_matrix.n_cols() == 0)
314 return cached_values[i][component];
316 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
317 s += inverse_node_matrix(j, i) * cached_values[j][component];
323template <
int dim,
int spacedim>
334template <
int dim,
int spacedim>
337 const unsigned int i,
339 const unsigned int component)
const
344 std::lock_guard<std::mutex> lock(cache_mutex);
346 if (cached_point != p || cached_grads.size() == 0)
349 cached_grads.resize(poly_space->n());
351 std::vector<Tensor<4, dim>> dummy1;
352 std::vector<Tensor<5, dim>> dummy2;
353 poly_space->evaluate(
354 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
358 if (inverse_node_matrix.n_cols() == 0)
359 return cached_grads[i][component];
361 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
362 s += inverse_node_matrix(j, i) * cached_grads[j][component];
369template <
int dim,
int spacedim>
380template <
int dim,
int spacedim>
383 const unsigned int i,
385 const unsigned int component)
const
390 std::lock_guard<std::mutex> lock(cache_mutex);
392 if (cached_point != p || cached_grad_grads.size() == 0)
395 cached_grad_grads.resize(poly_space->n());
397 std::vector<Tensor<4, dim>> dummy1;
398 std::vector<Tensor<5, dim>> dummy2;
399 poly_space->evaluate(
400 p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
404 if (inverse_node_matrix.n_cols() == 0)
405 return cached_grad_grads[i][component];
407 for (
unsigned int j = 0; j < inverse_node_matrix.n_cols(); ++j)
408 s += inverse_node_matrix(i, j) * cached_grad_grads[j][component];
418template <
int dim,
int spacedim>
426 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
438 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
440 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
442 const unsigned int n_q_points = quadrature.
size();
445 fe_data.shape_values.size()[0] == this->n_dofs_per_cell(),
447 this->n_dofs_per_cell()));
449 fe_data.shape_values.size()[1] == n_q_points,
457 std::fill(fe_data.dof_sign_change.begin(),
458 fe_data.dof_sign_change.end(),
460 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
463 fe_data.dof_sign_change);
469 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
472 fe_data.dof_sign_change);
475 const unsigned int first_quad_index = this->get_first_quad_index();
477 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
478 const unsigned int n_quad_dofs =
481 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
488 const bool is_quad_dof =
490 (first_quad_index <= dof_index) &&
491 (dof_index < first_quad_index + n_quad_dofs));
501 double dof_sign = 1.0;
504 dof_sign = fe_data.dof_sign_change[dof_index];
512 const unsigned int face_index_from_dof_index =
513 (dof_index - first_quad_index) / (n_dofs_per_quad);
515 const unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
518 if (adjust_quad_dof_sign_for_face_orientation(
519 local_quad_dof_index,
520 face_index_from_dof_index,
521 cell->face_orientation(face_index_from_dof_index),
522 cell->face_flip(face_index_from_dof_index),
523 cell->face_rotation(face_index_from_dof_index)))
527 const MappingKind mapping_kind = get_mapping_kind(dof_index);
529 const unsigned int first =
530 output_data.shape_function_to_row_table
531 [dof_index * this->n_components() +
532 this->get_nonzero_components(dof_index).first_selected_component()];
546 switch (mapping_kind)
550 for (
unsigned int k = 0; k < n_q_points; ++k)
551 for (
unsigned int d = 0;
d < dim; ++
d)
552 output_data.shape_values(
first +
d, k) =
553 fe_data.shape_values[dof_index][k][
d];
566 for (
unsigned int k = 0; k < n_q_points; ++k)
567 for (
unsigned int d = 0;
d < dim; ++
d)
568 output_data.shape_values(
first +
d, k) =
569 fe_data.transformed_shape_values[k][
d];
582 for (
unsigned int k = 0; k < n_q_points; ++k)
583 for (
unsigned int d = 0;
d < dim; ++
d)
584 output_data.shape_values(
first +
d, k) =
585 dof_sign * fe_data.transformed_shape_values[k][
d];
597 for (
unsigned int k = 0; k < n_q_points; ++k)
598 for (
unsigned int d = 0;
d < dim; ++
d)
599 output_data.shape_values(
first +
d, k) =
600 dof_sign * fe_data.transformed_shape_values[k][
d];
618 switch (mapping_kind)
627 for (
unsigned int k = 0; k < n_q_points; ++k)
628 for (
unsigned int d = 0;
d < dim; ++
d)
629 output_data.shape_gradients[
first +
d][k] =
630 fe_data.transformed_shape_grads[k][
d];
641 for (
unsigned int k = 0; k < n_q_points; ++k)
642 for (
unsigned int d = 0;
d < spacedim; ++
d)
643 for (
unsigned int n = 0; n < spacedim; ++n)
644 fe_data.transformed_shape_grads[k][
d] -=
645 output_data.shape_values(
first + n, k) *
646 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
648 for (
unsigned int k = 0; k < n_q_points; ++k)
649 for (
unsigned int d = 0;
d < dim; ++
d)
650 output_data.shape_gradients[
first +
d][k] =
651 fe_data.transformed_shape_grads[k][
d];
657 for (
unsigned int k = 0; k < n_q_points; ++k)
658 fe_data.untransformed_shape_grads[k] =
659 fe_data.shape_grads[dof_index][k];
666 for (
unsigned int k = 0; k < n_q_points; ++k)
667 for (
unsigned int d = 0;
d < spacedim; ++
d)
668 for (
unsigned int n = 0; n < spacedim; ++n)
669 fe_data.transformed_shape_grads[k][
d] +=
670 output_data.shape_values(
first + n, k) *
671 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
674 for (
unsigned int k = 0; k < n_q_points; ++k)
675 for (
unsigned int d = 0;
d < dim; ++
d)
676 output_data.shape_gradients[
first +
d][k] =
677 fe_data.transformed_shape_grads[k][
d];
684 for (
unsigned int k = 0; k < n_q_points; ++k)
685 fe_data.untransformed_shape_grads[k] =
686 fe_data.shape_grads[dof_index][k];
693 for (
unsigned int k = 0; k < n_q_points; ++k)
694 for (
unsigned int d = 0;
d < spacedim; ++
d)
695 for (
unsigned int n = 0; n < spacedim; ++n)
696 fe_data.transformed_shape_grads[k][
d] +=
697 (output_data.shape_values(
first + n, k) *
699 .jacobian_pushed_forward_grads[k][
d][n]) -
700 (output_data.shape_values(
first +
d, k) *
701 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
703 for (
unsigned int k = 0; k < n_q_points; ++k)
704 for (
unsigned int d = 0;
d < dim; ++
d)
705 output_data.shape_gradients[
first +
d][k] =
706 dof_sign * fe_data.transformed_shape_grads[k][
d];
723 for (
unsigned int k = 0; k < n_q_points; ++k)
724 fe_data.untransformed_shape_grads[k] =
725 fe_data.shape_grads[dof_index][k];
733 for (
unsigned int k = 0; k < n_q_points; ++k)
734 for (
unsigned int d = 0;
d < spacedim; ++
d)
735 for (
unsigned int n = 0; n < spacedim; ++n)
736 fe_data.transformed_shape_grads[k][
d] -=
737 output_data.shape_values(
first + n, k) *
738 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
740 for (
unsigned int k = 0; k < n_q_points; ++k)
741 for (
unsigned int d = 0;
d < dim; ++
d)
742 output_data.shape_gradients[
first +
d][k] =
743 dof_sign * fe_data.transformed_shape_grads[k][
d];
761 switch (mapping_kind)
771 for (
unsigned int k = 0; k < n_q_points; ++k)
772 for (
unsigned int d = 0;
d < spacedim; ++
d)
773 for (
unsigned int n = 0; n < spacedim; ++n)
774 fe_data.transformed_shape_hessians[k][
d] -=
775 output_data.shape_gradients[
first +
d][k][n] *
776 mapping_data.jacobian_pushed_forward_grads[k][n];
778 for (
unsigned int k = 0; k < n_q_points; ++k)
779 for (
unsigned int d = 0;
d < dim; ++
d)
780 output_data.shape_hessians[
first +
d][k] =
781 fe_data.transformed_shape_hessians[k][
d];
787 for (
unsigned int k = 0; k < n_q_points; ++k)
788 fe_data.untransformed_shape_hessian_tensors[k] =
789 fe_data.shape_grad_grads[dof_index][k];
793 fe_data.untransformed_shape_hessian_tensors),
798 for (
unsigned int k = 0; k < n_q_points; ++k)
799 for (
unsigned int d = 0;
d < spacedim; ++
d)
800 for (
unsigned int n = 0; n < spacedim; ++n)
801 for (
unsigned int i = 0; i < spacedim; ++i)
802 for (
unsigned int j = 0; j < spacedim; ++j)
804 fe_data.transformed_shape_hessians[k][
d][i][j] -=
805 (output_data.shape_values(
first + n, k) *
807 .jacobian_pushed_forward_2nd_derivatives
809 (output_data.shape_gradients[
first +
d][k][n] *
811 .jacobian_pushed_forward_grads[k][n][i][j]) +
812 (output_data.shape_gradients[
first + n][k][i] *
814 .jacobian_pushed_forward_grads[k][n][
d][j]) +
815 (output_data.shape_gradients[
first + n][k][j] *
817 .jacobian_pushed_forward_grads[k][n][i][
d]);
820 for (
unsigned int k = 0; k < n_q_points; ++k)
821 for (
unsigned int d = 0;
d < dim; ++
d)
822 output_data.shape_hessians[
first +
d][k] =
823 fe_data.transformed_shape_hessians[k][
d];
829 for (
unsigned int k = 0; k < n_q_points; ++k)
830 fe_data.untransformed_shape_hessian_tensors[k] =
831 fe_data.shape_grad_grads[dof_index][k];
835 fe_data.untransformed_shape_hessian_tensors),
840 for (
unsigned int k = 0; k < n_q_points; ++k)
841 for (
unsigned int d = 0;
d < spacedim; ++
d)
842 for (
unsigned int n = 0; n < spacedim; ++n)
843 for (
unsigned int i = 0; i < spacedim; ++i)
844 for (
unsigned int j = 0; j < spacedim; ++j)
846 fe_data.transformed_shape_hessians[k][
d][i][j] +=
847 (output_data.shape_values(
first + n, k) *
849 .jacobian_pushed_forward_2nd_derivatives
851 (output_data.shape_gradients[
first + n][k][i] *
853 .jacobian_pushed_forward_grads[k][
d][n][j]) +
854 (output_data.shape_gradients[
first + n][k][j] *
856 .jacobian_pushed_forward_grads[k][
d][i][n]) -
857 (output_data.shape_gradients[
first +
d][k][n] *
859 .jacobian_pushed_forward_grads[k][n][i][j]);
860 for (
unsigned int m = 0; m < spacedim; ++m)
862 .transformed_shape_hessians[k][
d][i][j] -=
864 .jacobian_pushed_forward_grads[k][
d][i]
867 .jacobian_pushed_forward_grads[k][m][n]
869 output_data.shape_values(
first + n, k)) +
871 .jacobian_pushed_forward_grads[k][
d][m]
874 .jacobian_pushed_forward_grads[k][m][i]
876 output_data.shape_values(
first + n, k));
879 for (
unsigned int k = 0; k < n_q_points; ++k)
880 for (
unsigned int d = 0;
d < dim; ++
d)
881 output_data.shape_hessians[
first +
d][k] =
882 fe_data.transformed_shape_hessians[k][
d];
889 for (
unsigned int k = 0; k < n_q_points; ++k)
890 fe_data.untransformed_shape_hessian_tensors[k] =
891 fe_data.shape_grad_grads[dof_index][k];
895 fe_data.untransformed_shape_hessian_tensors),
900 for (
unsigned int k = 0; k < n_q_points; ++k)
901 for (
unsigned int d = 0;
d < spacedim; ++
d)
902 for (
unsigned int n = 0; n < spacedim; ++n)
903 for (
unsigned int i = 0; i < spacedim; ++i)
904 for (
unsigned int j = 0; j < spacedim; ++j)
906 fe_data.transformed_shape_hessians[k][
d][i][j] +=
907 (output_data.shape_values(
first + n, k) *
909 .jacobian_pushed_forward_2nd_derivatives
911 (output_data.shape_gradients[
first + n][k][i] *
913 .jacobian_pushed_forward_grads[k][
d][n][j]) +
914 (output_data.shape_gradients[
first + n][k][j] *
916 .jacobian_pushed_forward_grads[k][
d][i][n]) -
917 (output_data.shape_gradients[
first +
d][k][n] *
919 .jacobian_pushed_forward_grads[k][n][i][j]);
921 fe_data.transformed_shape_hessians[k][
d][i][j] -=
922 (output_data.shape_values(
first +
d, k) *
924 .jacobian_pushed_forward_2nd_derivatives
926 (output_data.shape_gradients[
first +
d][k][i] *
928 .jacobian_pushed_forward_grads[k][n][n][j]) +
929 (output_data.shape_gradients[
first +
d][k][j] *
931 .jacobian_pushed_forward_grads[k][n][n][i]);
933 for (
unsigned int m = 0; m < spacedim; ++m)
936 .transformed_shape_hessians[k][
d][i][j] -=
938 .jacobian_pushed_forward_grads[k][
d][i]
941 .jacobian_pushed_forward_grads[k][m][n]
943 output_data.shape_values(
first + n, k)) +
945 .jacobian_pushed_forward_grads[k][
d][m]
948 .jacobian_pushed_forward_grads[k][m][i]
950 output_data.shape_values(
first + n, k));
953 .transformed_shape_hessians[k][
d][i][j] +=
955 .jacobian_pushed_forward_grads[k][n][i]
958 .jacobian_pushed_forward_grads[k][m][n]
960 output_data.shape_values(
first +
d, k)) +
962 .jacobian_pushed_forward_grads[k][n][m]
965 .jacobian_pushed_forward_grads[k][m][i]
967 output_data.shape_values(
first +
d, k));
971 for (
unsigned int k = 0; k < n_q_points; ++k)
972 for (
unsigned int d = 0;
d < dim; ++
d)
973 output_data.shape_hessians[
first +
d][k] =
974 dof_sign * fe_data.transformed_shape_hessians[k][
d];
981 for (
unsigned int k = 0; k < n_q_points; ++k)
982 fe_data.untransformed_shape_hessian_tensors[k] =
983 fe_data.shape_grad_grads[dof_index][k];
987 fe_data.untransformed_shape_hessian_tensors),
992 for (
unsigned int k = 0; k < n_q_points; ++k)
993 for (
unsigned int d = 0;
d < spacedim; ++
d)
994 for (
unsigned int n = 0; n < spacedim; ++n)
995 for (
unsigned int i = 0; i < spacedim; ++i)
996 for (
unsigned int j = 0; j < spacedim; ++j)
998 fe_data.transformed_shape_hessians[k][
d][i][j] -=
999 (output_data.shape_values(
first + n, k) *
1001 .jacobian_pushed_forward_2nd_derivatives
1003 (output_data.shape_gradients[
first +
d][k][n] *
1005 .jacobian_pushed_forward_grads[k][n][i][j]) +
1006 (output_data.shape_gradients[
first + n][k][i] *
1008 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1009 (output_data.shape_gradients[
first + n][k][j] *
1011 .jacobian_pushed_forward_grads[k][n][i][
d]);
1014 for (
unsigned int k = 0; k < n_q_points; ++k)
1015 for (
unsigned int d = 0;
d < dim; ++
d)
1016 output_data.shape_hessians[
first +
d][k] =
1017 dof_sign * fe_data.transformed_shape_hessians[k][
d];
1041template <
int dim,
int spacedim>
1045 const unsigned int face_no,
1049 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
1063 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
1065 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
1067 const unsigned int n_q_points = quadrature[0].
size();
1075 cell->face_orientation(face_no),
1076 cell->face_flip(face_no),
1077 cell->face_rotation(face_no),
1087 std::fill(fe_data.dof_sign_change.begin(),
1088 fe_data.dof_sign_change.end(),
1090 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
1093 fe_data.dof_sign_change);
1099 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
1102 fe_data.dof_sign_change);
1105 const unsigned int first_quad_index = this->get_first_quad_index();
1107 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
1108 const unsigned int n_quad_dofs =
1111 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
1118 const bool is_quad_dof =
1120 (first_quad_index <= dof_index) &&
1121 (dof_index < first_quad_index + n_quad_dofs));
1131 double dof_sign = 1.0;
1134 dof_sign = fe_data.dof_sign_change[dof_index];
1142 unsigned int face_index_from_dof_index =
1143 (dof_index - first_quad_index) / (n_dofs_per_quad);
1145 unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
1148 if (adjust_quad_dof_sign_for_face_orientation(
1149 local_quad_dof_index,
1150 face_index_from_dof_index,
1151 cell->face_orientation(face_index_from_dof_index),
1152 cell->face_flip(face_index_from_dof_index),
1153 cell->face_rotation(face_index_from_dof_index)))
1157 const MappingKind mapping_kind = get_mapping_kind(dof_index);
1159 const unsigned int first =
1160 output_data.shape_function_to_row_table
1161 [dof_index * this->n_components() +
1162 this->get_nonzero_components(dof_index).first_selected_component()];
1166 switch (mapping_kind)
1170 for (
unsigned int k = 0; k < n_q_points; ++k)
1171 for (
unsigned int d = 0;
d < dim; ++
d)
1172 output_data.shape_values(
first +
d, k) =
1173 fe_data.shape_values[dof_index][k + offset][
d];
1181 transformed_shape_values =
1191 transformed_shape_values);
1193 for (
unsigned int k = 0; k < n_q_points; ++k)
1194 for (
unsigned int d = 0;
d < dim; ++
d)
1195 output_data.shape_values(
first +
d, k) =
1196 transformed_shape_values[k][
d];
1204 transformed_shape_values =
1214 transformed_shape_values);
1215 for (
unsigned int k = 0; k < n_q_points; ++k)
1216 for (
unsigned int d = 0;
d < dim; ++
d)
1217 output_data.shape_values(
first +
d, k) =
1218 dof_sign * transformed_shape_values[k][
d];
1225 transformed_shape_values =
1235 transformed_shape_values);
1237 for (
unsigned int k = 0; k < n_q_points; ++k)
1238 for (
unsigned int d = 0;
d < dim; ++
d)
1239 output_data.shape_values(
first +
d, k) =
1240 dof_sign * transformed_shape_values[k][
d];
1252 switch (mapping_kind)
1266 transformed_shape_grads);
1267 for (
unsigned int k = 0; k < n_q_points; ++k)
1268 for (
unsigned int d = 0;
d < dim; ++
d)
1269 output_data.shape_gradients[
first +
d][k] =
1270 transformed_shape_grads[k][
d];
1286 transformed_shape_grads);
1288 for (
unsigned int k = 0; k < n_q_points; ++k)
1289 for (
unsigned int d = 0;
d < spacedim; ++
d)
1290 for (
unsigned int n = 0; n < spacedim; ++n)
1291 transformed_shape_grads[k][
d] -=
1292 output_data.shape_values(
first + n, k) *
1293 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1295 for (
unsigned int k = 0; k < n_q_points; ++k)
1296 for (
unsigned int d = 0;
d < dim; ++
d)
1297 output_data.shape_gradients[
first +
d][k] =
1298 transformed_shape_grads[k][
d];
1308 for (
unsigned int k = 0; k < n_q_points; ++k)
1309 fe_data.untransformed_shape_grads[k + offset] =
1310 fe_data.shape_grads[dof_index][k + offset];
1317 transformed_shape_grads);
1319 for (
unsigned int k = 0; k < n_q_points; ++k)
1320 for (
unsigned int d = 0;
d < spacedim; ++
d)
1321 for (
unsigned int n = 0; n < spacedim; ++n)
1322 transformed_shape_grads[k][
d] +=
1323 output_data.shape_values(
first + n, k) *
1324 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
1326 for (
unsigned int k = 0; k < n_q_points; ++k)
1327 for (
unsigned int d = 0;
d < dim; ++
d)
1328 output_data.shape_gradients[
first +
d][k] =
1329 transformed_shape_grads[k][
d];
1341 for (
unsigned int k = 0; k < n_q_points; ++k)
1342 fe_data.untransformed_shape_grads[k + offset] =
1343 fe_data.shape_grads[dof_index][k + offset];
1350 transformed_shape_grads);
1352 for (
unsigned int k = 0; k < n_q_points; ++k)
1353 for (
unsigned int d = 0;
d < spacedim; ++
d)
1354 for (
unsigned int n = 0; n < spacedim; ++n)
1355 transformed_shape_grads[k][
d] +=
1356 (output_data.shape_values(
first + n, k) *
1358 .jacobian_pushed_forward_grads[k][
d][n]) -
1359 (output_data.shape_values(
first +
d, k) *
1360 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
1362 for (
unsigned int k = 0; k < n_q_points; ++k)
1363 for (
unsigned int d = 0;
d < dim; ++
d)
1364 output_data.shape_gradients[
first +
d][k] =
1365 dof_sign * transformed_shape_grads[k][
d];
1382 for (
unsigned int k = 0; k < n_q_points; ++k)
1383 fe_data.untransformed_shape_grads[k + offset] =
1384 fe_data.shape_grads[dof_index][k + offset];
1396 transformed_shape_grads);
1398 for (
unsigned int k = 0; k < n_q_points; ++k)
1399 for (
unsigned int d = 0;
d < spacedim; ++
d)
1400 for (
unsigned int n = 0; n < spacedim; ++n)
1401 transformed_shape_grads[k][
d] -=
1402 output_data.shape_values(
first + n, k) *
1403 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1405 for (
unsigned int k = 0; k < n_q_points; ++k)
1406 for (
unsigned int d = 0;
d < dim; ++
d)
1407 output_data.shape_gradients[
first +
d][k] =
1408 dof_sign * transformed_shape_grads[k][
d];
1420 switch (mapping_kind)
1425 transformed_shape_hessians =
1435 transformed_shape_hessians);
1437 for (
unsigned int k = 0; k < n_q_points; ++k)
1438 for (
unsigned int d = 0;
d < spacedim; ++
d)
1439 for (
unsigned int n = 0; n < spacedim; ++n)
1440 transformed_shape_hessians[k][
d] -=
1441 output_data.shape_gradients[
first +
d][k][n] *
1442 mapping_data.jacobian_pushed_forward_grads[k][n];
1444 for (
unsigned int k = 0; k < n_q_points; ++k)
1445 for (
unsigned int d = 0;
d < dim; ++
d)
1446 output_data.shape_hessians[
first +
d][k] =
1447 transformed_shape_hessians[k][
d];
1453 for (
unsigned int k = 0; k < n_q_points; ++k)
1454 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1455 fe_data.shape_grad_grads[dof_index][k + offset];
1458 transformed_shape_hessians =
1468 transformed_shape_hessians);
1470 for (
unsigned int k = 0; k < n_q_points; ++k)
1471 for (
unsigned int d = 0;
d < spacedim; ++
d)
1472 for (
unsigned int n = 0; n < spacedim; ++n)
1473 for (
unsigned int i = 0; i < spacedim; ++i)
1474 for (
unsigned int j = 0; j < spacedim; ++j)
1476 transformed_shape_hessians[k][
d][i][j] -=
1477 (output_data.shape_values(
first + n, k) *
1479 .jacobian_pushed_forward_2nd_derivatives
1481 (output_data.shape_gradients[
first +
d][k][n] *
1483 .jacobian_pushed_forward_grads[k][n][i][j]) +
1484 (output_data.shape_gradients[
first + n][k][i] *
1486 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1487 (output_data.shape_gradients[
first + n][k][j] *
1489 .jacobian_pushed_forward_grads[k][n][i][
d]);
1492 for (
unsigned int k = 0; k < n_q_points; ++k)
1493 for (
unsigned int d = 0;
d < dim; ++
d)
1494 output_data.shape_hessians[
first +
d][k] =
1495 transformed_shape_hessians[k][
d];
1502 for (
unsigned int k = 0; k < n_q_points; ++k)
1503 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1504 fe_data.shape_grad_grads[dof_index][k + offset];
1507 transformed_shape_hessians =
1517 transformed_shape_hessians);
1519 for (
unsigned int k = 0; k < n_q_points; ++k)
1520 for (
unsigned int d = 0;
d < spacedim; ++
d)
1521 for (
unsigned int n = 0; n < spacedim; ++n)
1522 for (
unsigned int i = 0; i < spacedim; ++i)
1523 for (
unsigned int j = 0; j < spacedim; ++j)
1525 transformed_shape_hessians[k][
d][i][j] +=
1526 (output_data.shape_values(
first + n, k) *
1528 .jacobian_pushed_forward_2nd_derivatives
1530 (output_data.shape_gradients[
first + n][k][i] *
1532 .jacobian_pushed_forward_grads[k][
d][n][j]) +
1533 (output_data.shape_gradients[
first + n][k][j] *
1535 .jacobian_pushed_forward_grads[k][
d][i][n]) -
1536 (output_data.shape_gradients[
first +
d][k][n] *
1538 .jacobian_pushed_forward_grads[k][n][i][j]);
1539 for (
unsigned int m = 0; m < spacedim; ++m)
1540 transformed_shape_hessians[k][
d][i][j] -=
1542 .jacobian_pushed_forward_grads[k][
d][i]
1545 .jacobian_pushed_forward_grads[k][m][n]
1547 output_data.shape_values(
first + n, k)) +
1549 .jacobian_pushed_forward_grads[k][
d][m]
1552 .jacobian_pushed_forward_grads[k][m][i]
1554 output_data.shape_values(
first + n, k));
1557 for (
unsigned int k = 0; k < n_q_points; ++k)
1558 for (
unsigned int d = 0;
d < dim; ++
d)
1559 output_data.shape_hessians[
first +
d][k] =
1560 transformed_shape_hessians[k][
d];
1568 for (
unsigned int k = 0; k < n_q_points; ++k)
1569 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1570 fe_data.shape_grad_grads[dof_index][k + offset];
1573 transformed_shape_hessians =
1583 transformed_shape_hessians);
1585 for (
unsigned int k = 0; k < n_q_points; ++k)
1586 for (
unsigned int d = 0;
d < spacedim; ++
d)
1587 for (
unsigned int n = 0; n < spacedim; ++n)
1588 for (
unsigned int i = 0; i < spacedim; ++i)
1589 for (
unsigned int j = 0; j < spacedim; ++j)
1591 transformed_shape_hessians[k][
d][i][j] +=
1592 (output_data.shape_values(
first + n, k) *
1594 .jacobian_pushed_forward_2nd_derivatives
1596 (output_data.shape_gradients[
first + n][k][i] *
1598 .jacobian_pushed_forward_grads[k][
d][n][j]) +
1599 (output_data.shape_gradients[
first + n][k][j] *
1601 .jacobian_pushed_forward_grads[k][
d][i][n]) -
1602 (output_data.shape_gradients[
first +
d][k][n] *
1604 .jacobian_pushed_forward_grads[k][n][i][j]);
1606 transformed_shape_hessians[k][
d][i][j] -=
1607 (output_data.shape_values(
first +
d, k) *
1609 .jacobian_pushed_forward_2nd_derivatives
1611 (output_data.shape_gradients[
first +
d][k][i] *
1613 .jacobian_pushed_forward_grads[k][n][n][j]) +
1614 (output_data.shape_gradients[
first +
d][k][j] *
1616 .jacobian_pushed_forward_grads[k][n][n][i]);
1618 for (
unsigned int m = 0; m < spacedim; ++m)
1620 transformed_shape_hessians[k][
d][i][j] -=
1622 .jacobian_pushed_forward_grads[k][
d][i]
1625 .jacobian_pushed_forward_grads[k][m][n]
1627 output_data.shape_values(
first + n, k)) +
1629 .jacobian_pushed_forward_grads[k][
d][m]
1632 .jacobian_pushed_forward_grads[k][m][i]
1634 output_data.shape_values(
first + n, k));
1636 transformed_shape_hessians[k][
d][i][j] +=
1638 .jacobian_pushed_forward_grads[k][n][i]
1641 .jacobian_pushed_forward_grads[k][m][n]
1643 output_data.shape_values(
first +
d, k)) +
1645 .jacobian_pushed_forward_grads[k][n][m]
1648 .jacobian_pushed_forward_grads[k][m][i]
1650 output_data.shape_values(
first +
d, k));
1654 for (
unsigned int k = 0; k < n_q_points; ++k)
1655 for (
unsigned int d = 0;
d < dim; ++
d)
1656 output_data.shape_hessians[
first +
d][k] =
1657 dof_sign * transformed_shape_hessians[k][
d];
1664 for (
unsigned int k = 0; k < n_q_points; ++k)
1665 fe_data.untransformed_shape_hessian_tensors[k + offset] =
1666 fe_data.shape_grad_grads[dof_index][k + offset];
1669 transformed_shape_hessians =
1679 transformed_shape_hessians);
1681 for (
unsigned int k = 0; k < n_q_points; ++k)
1682 for (
unsigned int d = 0;
d < spacedim; ++
d)
1683 for (
unsigned int n = 0; n < spacedim; ++n)
1684 for (
unsigned int i = 0; i < spacedim; ++i)
1685 for (
unsigned int j = 0; j < spacedim; ++j)
1687 transformed_shape_hessians[k][
d][i][j] -=
1688 (output_data.shape_values(
first + n, k) *
1690 .jacobian_pushed_forward_2nd_derivatives
1692 (output_data.shape_gradients[
first +
d][k][n] *
1694 .jacobian_pushed_forward_grads[k][n][i][j]) +
1695 (output_data.shape_gradients[
first + n][k][i] *
1697 .jacobian_pushed_forward_grads[k][n][
d][j]) +
1698 (output_data.shape_gradients[
first + n][k][j] *
1700 .jacobian_pushed_forward_grads[k][n][i][
d]);
1703 for (
unsigned int k = 0; k < n_q_points; ++k)
1704 for (
unsigned int d = 0;
d < dim; ++
d)
1705 output_data.shape_hessians[
first +
d][k] =
1706 dof_sign * transformed_shape_hessians[k][
d];
1726template <
int dim,
int spacedim>
1730 const unsigned int face_no,
1731 const unsigned int sub_no,
1735 const ::internal::FEValuesImplementation::MappingRelatedData<dim,
1747 Assert(
dynamic_cast<const InternalData *
>(&fe_internal) !=
nullptr,
1749 const InternalData &fe_data =
static_cast<const InternalData &
>(fe_internal);
1751 const unsigned int n_q_points = quadrature.
size();
1760 cell->face_orientation(face_no),
1761 cell->face_flip(face_no),
1762 cell->face_rotation(face_no),
1764 cell->subface_case(face_no));
1773 std::fill(fe_data.dof_sign_change.begin(),
1774 fe_data.dof_sign_change.end(),
1776 internal::FE_PolyTensor::get_dof_sign_change_nedelec(cell,
1779 fe_data.dof_sign_change);
1785 internal::FE_PolyTensor::get_dof_sign_change_h_div(cell,
1788 fe_data.dof_sign_change);
1791 const unsigned int first_quad_index = this->get_first_quad_index();
1793 const unsigned int n_dofs_per_quad = this->n_dofs_per_quad();
1794 const unsigned int n_quad_dofs =
1797 for (
unsigned int dof_index = 0; dof_index < this->n_dofs_per_cell();
1804 const bool is_quad_dof =
1806 (first_quad_index <= dof_index) &&
1807 (dof_index < first_quad_index + n_quad_dofs));
1817 double dof_sign = 1.0;
1820 dof_sign = fe_data.dof_sign_change[dof_index];
1828 unsigned int face_index_from_dof_index =
1829 (dof_index - first_quad_index) / (n_dofs_per_quad);
1831 unsigned int local_quad_dof_index = dof_index % n_dofs_per_quad;
1834 if (adjust_quad_dof_sign_for_face_orientation(
1835 local_quad_dof_index,
1836 face_index_from_dof_index,
1837 cell->face_orientation(face_index_from_dof_index),
1838 cell->face_flip(face_index_from_dof_index),
1839 cell->face_rotation(face_index_from_dof_index)))
1843 const MappingKind mapping_kind = get_mapping_kind(dof_index);
1845 const unsigned int first =
1846 output_data.shape_function_to_row_table
1847 [dof_index * this->n_components() +
1848 this->get_nonzero_components(dof_index).first_selected_component()];
1852 switch (mapping_kind)
1856 for (
unsigned int k = 0; k < n_q_points; ++k)
1857 for (
unsigned int d = 0;
d < dim; ++
d)
1858 output_data.shape_values(
first +
d, k) =
1859 fe_data.shape_values[dof_index][k + offset][
d];
1867 transformed_shape_values =
1877 transformed_shape_values);
1879 for (
unsigned int k = 0; k < n_q_points; ++k)
1880 for (
unsigned int d = 0;
d < dim; ++
d)
1881 output_data.shape_values(
first +
d, k) =
1882 transformed_shape_values[k][
d];
1891 transformed_shape_values =
1902 transformed_shape_values);
1903 for (
unsigned int k = 0; k < n_q_points; ++k)
1904 for (
unsigned int d = 0;
d < dim; ++
d)
1905 output_data.shape_values(
first +
d, k) =
1906 dof_sign * transformed_shape_values[k][
d];
1913 transformed_shape_values =
1924 transformed_shape_values);
1926 for (
unsigned int k = 0; k < n_q_points; ++k)
1927 for (
unsigned int d = 0;
d < dim; ++
d)
1928 output_data.shape_values(
first +
d, k) =
1929 dof_sign * transformed_shape_values[k][
d];
1945 switch (mapping_kind)
1955 transformed_shape_grads);
1956 for (
unsigned int k = 0; k < n_q_points; ++k)
1957 for (
unsigned int d = 0;
d < dim; ++
d)
1958 output_data.shape_gradients[
first +
d][k] =
1959 transformed_shape_grads[k][
d];
1971 transformed_shape_grads);
1973 for (
unsigned int k = 0; k < n_q_points; ++k)
1974 for (
unsigned int d = 0;
d < spacedim; ++
d)
1975 for (
unsigned int n = 0; n < spacedim; ++n)
1976 transformed_shape_grads[k][
d] -=
1977 output_data.shape_values(
first + n, k) *
1978 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1980 for (
unsigned int k = 0; k < n_q_points; ++k)
1981 for (
unsigned int d = 0;
d < dim; ++
d)
1982 output_data.shape_gradients[
first +
d][k] =
1983 transformed_shape_grads[k][
d];
1990 for (
unsigned int k = 0; k < n_q_points; ++k)
1991 fe_data.untransformed_shape_grads[k + offset] =
1992 fe_data.shape_grads[dof_index][k + offset];
2000 transformed_shape_grads);
2002 for (
unsigned int k = 0; k < n_q_points; ++k)
2003 for (
unsigned int d = 0;
d < spacedim; ++
d)
2004 for (
unsigned int n = 0; n < spacedim; ++n)
2005 transformed_shape_grads[k][
d] +=
2006 output_data.shape_values(
first + n, k) *
2007 mapping_data.jacobian_pushed_forward_grads[k][
d][n];
2009 for (
unsigned int k = 0; k < n_q_points; ++k)
2010 for (
unsigned int d = 0;
d < dim; ++
d)
2011 output_data.shape_gradients[
first +
d][k] =
2012 transformed_shape_grads[k][
d];
2020 for (
unsigned int k = 0; k < n_q_points; ++k)
2021 fe_data.untransformed_shape_grads[k + offset] =
2022 fe_data.shape_grads[dof_index][k + offset];
2030 transformed_shape_grads);
2032 for (
unsigned int k = 0; k < n_q_points; ++k)
2033 for (
unsigned int d = 0;
d < spacedim; ++
d)
2034 for (
unsigned int n = 0; n < spacedim; ++n)
2035 transformed_shape_grads[k][
d] +=
2036 (output_data.shape_values(
first + n, k) *
2038 .jacobian_pushed_forward_grads[k][
d][n]) -
2039 (output_data.shape_values(
first +
d, k) *
2040 mapping_data.jacobian_pushed_forward_grads[k][n][n]);
2042 for (
unsigned int k = 0; k < n_q_points; ++k)
2043 for (
unsigned int d = 0;
d < dim; ++
d)
2044 output_data.shape_gradients[
first +
d][k] =
2045 dof_sign * transformed_shape_grads[k][
d];
2061 for (
unsigned int k = 0; k < n_q_points; ++k)
2062 fe_data.untransformed_shape_grads[k + offset] =
2063 fe_data.shape_grads[dof_index][k + offset];
2071 transformed_shape_grads);
2073 for (
unsigned int k = 0; k < n_q_points; ++k)
2074 for (
unsigned int d = 0;
d < spacedim; ++
d)
2075 for (
unsigned int n = 0; n < spacedim; ++n)
2076 transformed_shape_grads[k][
d] -=
2077 output_data.shape_values(
first + n, k) *
2078 mapping_data.jacobian_pushed_forward_grads[k][n][
d];
2080 for (
unsigned int k = 0; k < n_q_points; ++k)
2081 for (
unsigned int d = 0;
d < dim; ++
d)
2082 output_data.shape_gradients[
first +
d][k] =
2083 dof_sign * transformed_shape_grads[k][
d];
2095 switch (mapping_kind)
2100 transformed_shape_hessians =
2110 transformed_shape_hessians);
2112 for (
unsigned int k = 0; k < n_q_points; ++k)
2113 for (
unsigned int d = 0;
d < spacedim; ++
d)
2114 for (
unsigned int n = 0; n < spacedim; ++n)
2115 transformed_shape_hessians[k][
d] -=
2116 output_data.shape_gradients[
first +
d][k][n] *
2117 mapping_data.jacobian_pushed_forward_grads[k][n];
2119 for (
unsigned int k = 0; k < n_q_points; ++k)
2120 for (
unsigned int d = 0;
d < dim; ++
d)
2121 output_data.shape_hessians[
first +
d][k] =
2122 transformed_shape_hessians[k][
d];
2128 for (
unsigned int k = 0; k < n_q_points; ++k)
2129 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2130 fe_data.shape_grad_grads[dof_index][k + offset];
2133 transformed_shape_hessians =
2143 transformed_shape_hessians);
2145 for (
unsigned int k = 0; k < n_q_points; ++k)
2146 for (
unsigned int d = 0;
d < spacedim; ++
d)
2147 for (
unsigned int n = 0; n < spacedim; ++n)
2148 for (
unsigned int i = 0; i < spacedim; ++i)
2149 for (
unsigned int j = 0; j < spacedim; ++j)
2151 transformed_shape_hessians[k][
d][i][j] -=
2152 (output_data.shape_values(
first + n, k) *
2154 .jacobian_pushed_forward_2nd_derivatives
2156 (output_data.shape_gradients[
first +
d][k][n] *
2158 .jacobian_pushed_forward_grads[k][n][i][j]) +
2159 (output_data.shape_gradients[
first + n][k][i] *
2161 .jacobian_pushed_forward_grads[k][n][
d][j]) +
2162 (output_data.shape_gradients[
first + n][k][j] *
2164 .jacobian_pushed_forward_grads[k][n][i][
d]);
2167 for (
unsigned int k = 0; k < n_q_points; ++k)
2168 for (
unsigned int d = 0;
d < dim; ++
d)
2169 output_data.shape_hessians[
first +
d][k] =
2170 transformed_shape_hessians[k][
d];
2177 for (
unsigned int k = 0; k < n_q_points; ++k)
2178 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2179 fe_data.shape_grad_grads[dof_index][k + offset];
2182 transformed_shape_hessians =
2192 transformed_shape_hessians);
2194 for (
unsigned int k = 0; k < n_q_points; ++k)
2195 for (
unsigned int d = 0;
d < spacedim; ++
d)
2196 for (
unsigned int n = 0; n < spacedim; ++n)
2197 for (
unsigned int i = 0; i < spacedim; ++i)
2198 for (
unsigned int j = 0; j < spacedim; ++j)
2200 transformed_shape_hessians[k][
d][i][j] +=
2201 (output_data.shape_values(
first + n, k) *
2203 .jacobian_pushed_forward_2nd_derivatives
2205 (output_data.shape_gradients[
first + n][k][i] *
2207 .jacobian_pushed_forward_grads[k][
d][n][j]) +
2208 (output_data.shape_gradients[
first + n][k][j] *
2210 .jacobian_pushed_forward_grads[k][
d][i][n]) -
2211 (output_data.shape_gradients[
first +
d][k][n] *
2213 .jacobian_pushed_forward_grads[k][n][i][j]);
2214 for (
unsigned int m = 0; m < spacedim; ++m)
2215 transformed_shape_hessians[k][
d][i][j] -=
2217 .jacobian_pushed_forward_grads[k][
d][i]
2220 .jacobian_pushed_forward_grads[k][m][n]
2222 output_data.shape_values(
first + n, k)) +
2224 .jacobian_pushed_forward_grads[k][
d][m]
2227 .jacobian_pushed_forward_grads[k][m][i]
2229 output_data.shape_values(
first + n, k));
2232 for (
unsigned int k = 0; k < n_q_points; ++k)
2233 for (
unsigned int d = 0;
d < dim; ++
d)
2234 output_data.shape_hessians[
first +
d][k] =
2235 transformed_shape_hessians[k][
d];
2243 for (
unsigned int k = 0; k < n_q_points; ++k)
2244 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2245 fe_data.shape_grad_grads[dof_index][k + offset];
2248 transformed_shape_hessians =
2258 transformed_shape_hessians);
2260 for (
unsigned int k = 0; k < n_q_points; ++k)
2261 for (
unsigned int d = 0;
d < spacedim; ++
d)
2262 for (
unsigned int n = 0; n < spacedim; ++n)
2263 for (
unsigned int i = 0; i < spacedim; ++i)
2264 for (
unsigned int j = 0; j < spacedim; ++j)
2266 transformed_shape_hessians[k][
d][i][j] +=
2267 (output_data.shape_values(
first + n, k) *
2269 .jacobian_pushed_forward_2nd_derivatives
2271 (output_data.shape_gradients[
first + n][k][i] *
2273 .jacobian_pushed_forward_grads[k][
d][n][j]) +
2274 (output_data.shape_gradients[
first + n][k][j] *
2276 .jacobian_pushed_forward_grads[k][
d][i][n]) -
2277 (output_data.shape_gradients[
first +
d][k][n] *
2279 .jacobian_pushed_forward_grads[k][n][i][j]);
2281 transformed_shape_hessians[k][
d][i][j] -=
2282 (output_data.shape_values(
first +
d, k) *
2284 .jacobian_pushed_forward_2nd_derivatives
2286 (output_data.shape_gradients[
first +
d][k][i] *
2288 .jacobian_pushed_forward_grads[k][n][n][j]) +
2289 (output_data.shape_gradients[
first +
d][k][j] *
2291 .jacobian_pushed_forward_grads[k][n][n][i]);
2292 for (
unsigned int m = 0; m < spacedim; ++m)
2294 transformed_shape_hessians[k][
d][i][j] -=
2296 .jacobian_pushed_forward_grads[k][
d][i]
2299 .jacobian_pushed_forward_grads[k][m][n]
2301 output_data.shape_values(
first + n, k)) +
2303 .jacobian_pushed_forward_grads[k][
d][m]
2306 .jacobian_pushed_forward_grads[k][m][i]
2308 output_data.shape_values(
first + n, k));
2310 transformed_shape_hessians[k][
d][i][j] +=
2312 .jacobian_pushed_forward_grads[k][n][i]
2315 .jacobian_pushed_forward_grads[k][m][n]
2317 output_data.shape_values(
first +
d, k)) +
2319 .jacobian_pushed_forward_grads[k][n][m]
2322 .jacobian_pushed_forward_grads[k][m][i]
2324 output_data.shape_values(
first +
d, k));
2328 for (
unsigned int k = 0; k < n_q_points; ++k)
2329 for (
unsigned int d = 0;
d < dim; ++
d)
2330 output_data.shape_hessians[
first +
d][k] =
2331 dof_sign * transformed_shape_hessians[k][
d];
2338 for (
unsigned int k = 0; k < n_q_points; ++k)
2339 fe_data.untransformed_shape_hessian_tensors[k + offset] =
2340 fe_data.shape_grad_grads[dof_index][k + offset];
2343 transformed_shape_hessians =
2353 transformed_shape_hessians);
2355 for (
unsigned int k = 0; k < n_q_points; ++k)
2356 for (
unsigned int d = 0;
d < spacedim; ++
d)
2357 for (
unsigned int n = 0; n < spacedim; ++n)
2358 for (
unsigned int i = 0; i < spacedim; ++i)
2359 for (
unsigned int j = 0; j < spacedim; ++j)
2361 transformed_shape_hessians[k][
d][i][j] -=
2362 (output_data.shape_values(
first + n, k) *
2364 .jacobian_pushed_forward_2nd_derivatives
2366 (output_data.shape_gradients[
first +
d][k][n] *
2368 .jacobian_pushed_forward_grads[k][n][i][j]) +
2369 (output_data.shape_gradients[
first + n][k][i] *
2371 .jacobian_pushed_forward_grads[k][n][
d][j]) +
2372 (output_data.shape_gradients[
first + n][k][j] *
2374 .jacobian_pushed_forward_grads[k][n][i][
d]);
2377 for (
unsigned int k = 0; k < n_q_points; ++k)
2378 for (
unsigned int d = 0;
d < dim; ++
d)
2379 output_data.shape_hessians[
first +
d][k] =
2380 dof_sign * transformed_shape_hessians[k][
d];
2400template <
int dim,
int spacedim>
2407 for (
unsigned int i = 0; i < this->n_dofs_per_cell(); ++i)
2409 const MappingKind mapping_kind = get_mapping_kind(i);
2411 switch (mapping_kind)
2502#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
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)
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)
constexpr const ReferenceCell Quadrilateral