17 #include <deal.II/base/derivative_form.h> 18 #include <deal.II/base/qprojector.h> 19 #include <deal.II/base/polynomials_bdm.h> 20 #include <deal.II/base/polynomials_raviart_thomas.h> 21 #include <deal.II/base/polynomials_abf.h> 22 #include <deal.II/base/polynomials_nedelec.h> 23 #include <deal.II/fe/fe_poly_tensor.h> 24 #include <deal.II/fe/fe_values.h> 25 #include <deal.II/fe/mapping_cartesian.h> 27 DEAL_II_NAMESPACE_OPEN
45 std::vector<double> &face_sign)
48 std::fill (face_sign.begin (), face_sign.end (), 1.0);
55 const unsigned int dofs_per_face,
56 std::vector<double> &face_sign)
58 const unsigned int dim = 2;
59 const unsigned int spacedim = 2;
63 std::fill (face_sign.begin (), face_sign.end (), 1.0);
66 f < GeometryInfo<dim>::faces_per_cell; ++f)
69 if (!face->at_boundary ())
71 const unsigned int nn = cell->neighbor_face_no(f);
74 for (
unsigned int j = 0; j < dofs_per_face; ++j)
76 Assert (f * dofs_per_face + j < face_sign.size(),
80 face_sign[f * dofs_per_face + j] = -1.0;
91 std::vector<double> &face_sign)
93 std::fill (face_sign.begin (), face_sign.end (), 1.0);
100 std::vector<double> &face_sign)
103 std::fill (face_sign.begin (), face_sign.end (), 1.0);
111 std::vector<double> &face_sign)
113 std::fill (face_sign.begin (), face_sign.end (), 1.0);
121 std::vector<double> &face_sign)
123 const unsigned int dim = 3;
124 std::fill (face_sign.begin (), face_sign.end (), 1.0);
126 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
127 if (!(cell->line_orientation (l)))
134 template <
class PolynomialType,
int dim,
int spacedim>
136 (
const unsigned int degree,
138 const std::vector<bool> &restriction_is_additive_flags,
139 const std::vector<ComponentMask> &nonzero_components)
142 restriction_is_additive_flags,
144 poly_space(PolynomialType(degree))
146 cached_point(0) = -1;
154 for (
unsigned int comp=0; comp<this->
n_components() ; ++comp)
155 this->component_to_base_table[comp].first.second = comp;
160 template <
class PolynomialType,
int dim,
int spacedim>
173 template <
class PolynomialType,
int dim,
int spacedim>
176 (
const unsigned int i,
178 const unsigned int component)
const 185 if (cached_point != p || cached_values.size() == 0)
188 cached_values.resize(poly_space.n());
190 std::vector<Tensor<4,dim> > dummy1;
191 std::vector<Tensor<5,dim> > dummy2;
192 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
196 if (inverse_node_matrix.n_cols() == 0)
197 return cached_values[i][component];
199 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
200 s += inverse_node_matrix(j,i) * cached_values[j][component];
206 template <
class PolynomialType,
int dim,
int spacedim>
218 template <
class PolynomialType,
int dim,
int spacedim>
221 (
const unsigned int i,
223 const unsigned int component)
const 230 if (cached_point != p || cached_grads.size() == 0)
233 cached_grads.resize(poly_space.n());
235 std::vector<Tensor<4,dim> > dummy1;
236 std::vector<Tensor<5,dim> > dummy2;
237 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
241 if (inverse_node_matrix.n_cols() == 0)
242 return cached_grads[i][component];
244 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
245 s += inverse_node_matrix(j,i) * cached_grads[j][component];
252 template <
class PolynomialType,
int dim,
int spacedim>
265 template <
class PolynomialType,
int dim,
int spacedim>
268 (
const unsigned int i,
270 const unsigned int component)
const 277 if (cached_point != p || cached_grad_grads.size() == 0)
280 cached_grad_grads.resize(poly_space.n());
282 std::vector<Tensor<4,dim> > dummy1;
283 std::vector<Tensor<5,dim> > dummy2;
284 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
288 if (inverse_node_matrix.n_cols() == 0)
289 return cached_grad_grads[i][component];
291 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
292 s += inverse_node_matrix(i,j) * cached_grad_grads[j][component];
302 template <
class PolynomialType,
int dim,
int spacedim>
311 const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
319 Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
321 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
323 const unsigned int n_q_points = quadrature.
size();
325 Assert(!(fe_data.update_each &
update_values) || fe_data.shape_values.size()[0] == this->dofs_per_cell,
327 Assert(!(fe_data.update_each &
update_values) || fe_data.shape_values.size()[1] == n_q_points,
335 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
338 get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
340 get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
343 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
346 this->get_nonzero_components(i).first_selected_component()];
360 switch (mapping_type)
364 for (
unsigned int k=0; k<n_q_points; ++k)
365 for (
unsigned int d=0; d<dim; ++d)
366 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k][d];
378 for (
unsigned int k=0; k<n_q_points; ++k)
379 for (
unsigned int d=0;
d<dim; ++
d)
380 output_data.
shape_values(first+d,k) = fe_data.transformed_shape_values[k][
d];
392 for (
unsigned int k=0; k<n_q_points; ++k)
393 for (
unsigned int d=0;
d<dim; ++
d)
395 = fe_data.sign_change[i] * fe_data.transformed_shape_values[k][
d];
406 for (
unsigned int k = 0; k < n_q_points; ++k)
407 for (
unsigned int d = 0;
d < dim; ++
d)
408 output_data.
shape_values(first+d,k) = fe_data.sign_change[i]
409 * fe_data.transformed_shape_values[k][
d];
428 switch (mapping_type)
436 for (
unsigned int k=0; k<n_q_points; ++k)
437 for (
unsigned int d=0;
d<dim; ++
d)
438 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
448 for (
unsigned int k=0; k<n_q_points; ++k)
449 for (
unsigned int d=0;
d<spacedim; ++
d)
450 for (
unsigned int n=0; n<spacedim; ++n)
451 fe_data.transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
452 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
454 for (
unsigned int k=0; k<n_q_points; ++k)
455 for (
unsigned int d=0;
d<dim; ++
d)
456 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
462 for (
unsigned int k=0; k<n_q_points; ++k)
463 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
469 for (
unsigned int k=0; k<n_q_points; ++k)
470 for (
unsigned int d=0;
d<spacedim; ++
d)
471 for (
unsigned int n=0; n<spacedim; ++n)
472 fe_data.transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
473 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
476 for (
unsigned int k=0; k<n_q_points; ++k)
477 for (
unsigned int d=0;
d<dim; ++
d)
478 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
485 for (
unsigned int k=0; k<n_q_points; ++k)
486 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
492 for (
unsigned int k=0; k<n_q_points; ++k)
493 for (
unsigned int d=0;
d<spacedim; ++
d)
494 for (
unsigned int n=0; n<spacedim; ++n)
495 fe_data.transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
496 * mapping_data.jacobian_pushed_forward_grads[k][
d][n] )
498 * mapping_data.jacobian_pushed_forward_grads[k][n][n] );
500 for (
unsigned int k=0; k<n_q_points; ++k)
501 for (
unsigned int d=0;
d<dim; ++
d)
503 * fe_data.transformed_shape_grads[k][d];
520 for (
unsigned int k=0; k<n_q_points; ++k)
521 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
528 for (
unsigned int k=0; k<n_q_points; ++k)
529 for (
unsigned int d=0;
d<spacedim; ++
d)
530 for (
unsigned int n=0; n<spacedim; ++n)
531 fe_data.transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
532 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
534 for (
unsigned int k = 0; k < n_q_points; ++k)
535 for (
unsigned int d = 0;
d < dim; ++
d)
537 * fe_data.transformed_shape_grads[k][d];
557 switch (mapping_type)
567 for (
unsigned int k=0; k<n_q_points; ++k)
568 for (
unsigned int d=0;
d<spacedim; ++
d)
569 for (
unsigned int n=0; n<spacedim; ++n)
570 fe_data.transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
571 * mapping_data.jacobian_pushed_forward_grads[k][n];
573 for (
unsigned int k=0; k<n_q_points; ++k)
574 for (
unsigned int d=0;
d<dim; ++
d)
575 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
583 for (
unsigned int k=0; k<n_q_points; ++k)
584 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
590 for (
unsigned int k=0; k<n_q_points; ++k)
591 for (
unsigned int d=0;
d<spacedim; ++
d)
592 for (
unsigned int n=0; n<spacedim; ++n)
593 for (
unsigned int i=0; i<spacedim; ++i)
594 for (
unsigned int j=0; j<spacedim; ++j)
596 fe_data.transformed_shape_hessians[k][
d][i][j]
598 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
600 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
602 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
604 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
607 for (
unsigned int k=0; k<n_q_points; ++k)
608 for (
unsigned int d=0;
d<dim; ++
d)
609 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
617 for (
unsigned int k=0; k<n_q_points; ++k)
618 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
625 for (
unsigned int k=0; k<n_q_points; ++k)
626 for (
unsigned int d=0;
d<spacedim; ++
d)
627 for (
unsigned int n=0; n<spacedim; ++n)
628 for (
unsigned int i=0; i<spacedim; ++i)
629 for (
unsigned int j=0; j<spacedim; ++j)
631 fe_data.transformed_shape_hessians[k][
d][i][j]
633 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
635 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
637 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
639 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
640 for (
unsigned int m=0; m<spacedim; ++m)
641 fe_data.transformed_shape_hessians[k][d][i][j]
642 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
643 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
645 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
646 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
650 for (
unsigned int k=0; k<n_q_points; ++k)
651 for (
unsigned int d=0;
d<dim; ++
d)
652 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
661 for (
unsigned int k=0; k<n_q_points; ++k)
662 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
669 for (
unsigned int k=0; k<n_q_points; ++k)
670 for (
unsigned int d=0;
d<spacedim; ++
d)
671 for (
unsigned int n=0; n<spacedim; ++n)
672 for (
unsigned int i=0; i<spacedim; ++i)
673 for (
unsigned int j=0; j<spacedim; ++j)
675 fe_data.transformed_shape_hessians[k][
d][i][j]
677 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
679 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
681 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
683 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
685 fe_data.transformed_shape_hessians[k][
d][i][j]
687 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
689 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
691 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
693 for (
unsigned int m=0; m<spacedim; ++m)
695 fe_data.transformed_shape_hessians[k][
d][i][j]
696 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
697 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
699 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
700 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
703 fe_data.transformed_shape_hessians[k][
d][i][j]
704 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
705 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
707 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
708 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
713 for (
unsigned int k=0; k<n_q_points; ++k)
714 for (
unsigned int d=0;
d<dim; ++
d)
715 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * fe_data.transformed_shape_hessians[k][d];
724 for (
unsigned int k=0; k<n_q_points; ++k)
725 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
731 for (
unsigned int k=0; k<n_q_points; ++k)
732 for (
unsigned int d=0;
d<spacedim; ++
d)
733 for (
unsigned int n=0; n<spacedim; ++n)
734 for (
unsigned int i=0; i<spacedim; ++i)
735 for (
unsigned int j=0; j<spacedim; ++j)
737 fe_data.transformed_shape_hessians[k][
d][i][j]
739 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
741 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
743 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
745 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
748 for (
unsigned int k=0; k<n_q_points; ++k)
749 for (
unsigned int d=0;
d<dim; ++
d)
750 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * fe_data.transformed_shape_hessians[k][d];
776 template <
class PolynomialType,
int dim,
int spacedim>
781 const unsigned int face_no,
785 const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
793 Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
795 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
797 const unsigned int n_q_points = quadrature.
size();
804 cell->face_orientation(face_no),
805 cell->face_flip(face_no),
806 cell->face_rotation(face_no),
816 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
819 get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
822 get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
824 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
827 this->get_nonzero_components(i).first_selected_component()];
831 switch (mapping_type)
835 for (
unsigned int k=0; k<n_q_points; ++k)
836 for (
unsigned int d=0;
d<dim; ++
d)
837 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k+offset][
d];
845 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
849 transformed_shape_values);
851 for (
unsigned int k=0; k<n_q_points; ++k)
852 for (
unsigned int d=0;
d<dim; ++
d)
853 output_data.
shape_values(first+d,k) = transformed_shape_values[k][
d];
861 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
865 transformed_shape_values);
866 for (
unsigned int k=0; k<n_q_points; ++k)
867 for (
unsigned int d=0;
d<dim; ++
d)
869 = fe_data.sign_change[i] * transformed_shape_values[k][
d];
876 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
880 transformed_shape_values);
882 for (
unsigned int k = 0; k < n_q_points; ++k)
883 for (
unsigned int d = 0;
d < dim; ++
d)
885 fe_data.sign_change[i] * transformed_shape_values[k][
d];
897 switch (mapping_type)
902 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
906 transformed_shape_grads);
907 for (
unsigned int k=0; k<n_q_points; ++k)
908 for (
unsigned int d=0;
d<dim; ++
d)
909 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
916 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
920 transformed_shape_grads);
922 for (
unsigned int k=0; k<n_q_points; ++k)
923 for (
unsigned int d=0;
d<spacedim; ++
d)
924 for (
unsigned int n=0; n<spacedim; ++n)
925 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
926 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
928 for (
unsigned int k=0; k<n_q_points; ++k)
929 for (
unsigned int d=0;
d<dim; ++
d)
930 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
937 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
938 for (
unsigned int k=0; k<n_q_points; ++k)
939 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
943 transformed_shape_grads);
945 for (
unsigned int k=0; k<n_q_points; ++k)
946 for (
unsigned int d=0;
d<spacedim; ++
d)
947 for (
unsigned int n=0; n<spacedim; ++n)
948 transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
949 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
951 for (
unsigned int k=0; k<n_q_points; ++k)
952 for (
unsigned int d=0;
d<dim; ++
d)
953 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
962 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
963 for (
unsigned int k=0; k<n_q_points; ++k)
964 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
968 transformed_shape_grads);
970 for (
unsigned int k=0; k<n_q_points; ++k)
971 for (
unsigned int d=0;
d<spacedim; ++
d)
972 for (
unsigned int n=0; n<spacedim; ++n)
973 transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
974 * mapping_data.jacobian_pushed_forward_grads[k][
d][n] )
977 * mapping_data.jacobian_pushed_forward_grads[k][n][n] );
979 for (
unsigned int k = 0; k < n_q_points; ++k)
980 for (
unsigned int d = 0;
d < dim; ++
d)
982 * transformed_shape_grads[k][d];
999 for (
unsigned int k=0; k<n_q_points; ++k)
1000 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1003 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
1007 transformed_shape_grads);
1009 for (
unsigned int k=0; k<n_q_points; ++k)
1010 for (
unsigned int d=0;
d<spacedim; ++
d)
1011 for (
unsigned int n=0; n<spacedim; ++n)
1012 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1013 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1015 for (
unsigned int k = 0; k < n_q_points; ++k)
1016 for (
unsigned int d = 0;
d < dim; ++
d)
1018 * transformed_shape_grads[k][d];
1030 switch (mapping_type)
1035 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1039 transformed_shape_hessians);
1041 for (
unsigned int k=0; k<n_q_points; ++k)
1042 for (
unsigned int d=0;
d<spacedim; ++
d)
1043 for (
unsigned int n=0; n<spacedim; ++n)
1044 transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
1045 *mapping_data.jacobian_pushed_forward_grads[k][n];
1047 for (
unsigned int k=0; k<n_q_points; ++k)
1048 for (
unsigned int d=0;
d<dim; ++
d)
1049 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1056 for (
unsigned int k=0; k<n_q_points; ++k)
1057 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1060 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1064 transformed_shape_hessians);
1066 for (
unsigned int k=0; k<n_q_points; ++k)
1067 for (
unsigned int d=0;
d<spacedim; ++
d)
1068 for (
unsigned int n=0; n<spacedim; ++n)
1069 for (
unsigned int i=0; i<spacedim; ++i)
1070 for (
unsigned int j=0; j<spacedim; ++j)
1072 transformed_shape_hessians[k][
d][i][j]
1074 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1076 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1078 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1080 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1083 for (
unsigned int k=0; k<n_q_points; ++k)
1084 for (
unsigned int d=0;
d<dim; ++
d)
1085 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1093 for (
unsigned int k=0; k<n_q_points; ++k)
1094 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1097 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1101 transformed_shape_hessians);
1103 for (
unsigned int k=0; k<n_q_points; ++k)
1104 for (
unsigned int d=0;
d<spacedim; ++
d)
1105 for (
unsigned int n=0; n<spacedim; ++n)
1106 for (
unsigned int i=0; i<spacedim; ++i)
1107 for (
unsigned int j=0; j<spacedim; ++j)
1109 transformed_shape_hessians[k][
d][i][j]
1111 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1113 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1115 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1117 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1118 for (
unsigned int m=0; m<spacedim; ++m)
1119 transformed_shape_hessians[k][d][i][j]
1120 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
1121 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1123 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1124 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1128 for (
unsigned int k=0; k<n_q_points; ++k)
1129 for (
unsigned int d=0;
d<dim; ++
d)
1130 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1138 for (
unsigned int k=0; k<n_q_points; ++k)
1139 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1142 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1146 transformed_shape_hessians);
1148 for (
unsigned int k=0; k<n_q_points; ++k)
1149 for (
unsigned int d=0;
d<spacedim; ++
d)
1150 for (
unsigned int n=0; n<spacedim; ++n)
1151 for (
unsigned int i=0; i<spacedim; ++i)
1152 for (
unsigned int j=0; j<spacedim; ++j)
1154 transformed_shape_hessians[k][
d][i][j]
1156 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1158 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1160 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1162 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1164 transformed_shape_hessians[k][
d][i][j]
1166 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
1168 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
1170 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
1172 for (
unsigned int m=0; m<spacedim; ++m)
1174 transformed_shape_hessians[k][
d][i][j]
1175 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
1176 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1178 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1179 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1182 transformed_shape_hessians[k][
d][i][j]
1183 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
1184 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1186 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
1187 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1192 for (
unsigned int k=0; k<n_q_points; ++k)
1193 for (
unsigned int d=0;
d<dim; ++
d)
1194 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1201 for (
unsigned int k=0; k<n_q_points; ++k)
1202 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1205 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1209 transformed_shape_hessians);
1211 for (
unsigned int k=0; k<n_q_points; ++k)
1212 for (
unsigned int d=0;
d<spacedim; ++
d)
1213 for (
unsigned int n=0; n<spacedim; ++n)
1214 for (
unsigned int i=0; i<spacedim; ++i)
1215 for (
unsigned int j=0; j<spacedim; ++j)
1217 transformed_shape_hessians[k][
d][i][j]
1219 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1221 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1223 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1225 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1228 for (
unsigned int k=0; k<n_q_points; ++k)
1229 for (
unsigned int d=0;
d<dim; ++
d)
1230 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1250 template <
class PolynomialType,
int dim,
int spacedim>
1255 const unsigned int face_no,
1256 const unsigned int sub_no,
1260 const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
1268 Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0,
1270 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
1272 const unsigned int n_q_points = quadrature.
size();
1279 cell->face_orientation(face_no),
1280 cell->face_flip(face_no),
1281 cell->face_rotation(face_no),
1283 cell->subface_case(face_no));
1295 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
1298 get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
1301 get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
1303 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
1306 this->get_nonzero_components(i).first_selected_component()];
1310 switch (mapping_type)
1314 for (
unsigned int k=0; k<n_q_points; ++k)
1315 for (
unsigned int d=0;
d<dim; ++
d)
1316 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k+offset][
d];
1324 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1328 transformed_shape_values);
1330 for (
unsigned int k=0; k<n_q_points; ++k)
1331 for (
unsigned int d=0;
d<dim; ++
d)
1332 output_data.
shape_values(first+d,k) = transformed_shape_values[k][
d];
1341 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1346 transformed_shape_values);
1347 for (
unsigned int k=0; k<n_q_points; ++k)
1348 for (
unsigned int d=0;
d<dim; ++
d)
1350 = fe_data.sign_change[i] * transformed_shape_values[k][
d];
1357 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1362 transformed_shape_values);
1364 for (
unsigned int k = 0; k < n_q_points; ++k)
1365 for (
unsigned int d = 0;
d < dim; ++
d)
1367 fe_data.sign_change[i] * transformed_shape_values[k][
d];
1380 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
1381 switch (mapping_type)
1388 transformed_shape_grads);
1389 for (
unsigned int k=0; k<n_q_points; ++k)
1390 for (
unsigned int d=0;
d<dim; ++
d)
1391 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1400 transformed_shape_grads);
1402 for (
unsigned int k=0; k<n_q_points; ++k)
1403 for (
unsigned int d=0;
d<spacedim; ++
d)
1404 for (
unsigned int n=0; n<spacedim; ++n)
1405 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1406 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1408 for (
unsigned int k=0; k<n_q_points; ++k)
1409 for (
unsigned int d=0;
d<dim; ++
d)
1410 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1417 for (
unsigned int k=0; k<n_q_points; ++k)
1418 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1423 transformed_shape_grads);
1425 for (
unsigned int k=0; k<n_q_points; ++k)
1426 for (
unsigned int d=0;
d<spacedim; ++
d)
1427 for (
unsigned int n=0; n<spacedim; ++n)
1428 transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
1429 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
1431 for (
unsigned int k=0; k<n_q_points; ++k)
1432 for (
unsigned int d=0;
d<dim; ++
d)
1433 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1441 for (
unsigned int k=0; k<n_q_points; ++k)
1442 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1447 transformed_shape_grads);
1449 for (
unsigned int k=0; k<n_q_points; ++k)
1450 for (
unsigned int d=0;
d<spacedim; ++
d)
1451 for (
unsigned int n=0; n<spacedim; ++n)
1452 transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
1453 * mapping_data.jacobian_pushed_forward_grads[k][
d][n])
1455 * mapping_data.jacobian_pushed_forward_grads[k][n][n]);
1457 for (
unsigned int k=0; k<n_q_points; ++k)
1458 for (
unsigned int d=0;
d<dim; ++
d)
1460 fe_data.sign_change[i] * transformed_shape_grads[k][d];
1476 for (
unsigned int k=0; k<n_q_points; ++k)
1477 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1482 transformed_shape_grads);
1484 for (
unsigned int k=0; k<n_q_points; ++k)
1485 for (
unsigned int d=0;
d<spacedim; ++
d)
1486 for (
unsigned int n=0; n<spacedim; ++n)
1487 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1488 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1490 for (
unsigned int k = 0; k < n_q_points; ++k)
1491 for (
unsigned int d = 0;
d < dim; ++
d)
1493 fe_data.sign_change[i] * transformed_shape_grads[k][d];
1505 switch (mapping_type)
1510 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1513 transformed_shape_hessians);
1515 for (
unsigned int k=0; k<n_q_points; ++k)
1516 for (
unsigned int d=0;
d<spacedim; ++
d)
1517 for (
unsigned int n=0; n<spacedim; ++n)
1518 transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
1519 *mapping_data.jacobian_pushed_forward_grads[k][n];
1521 for (
unsigned int k=0; k<n_q_points; ++k)
1522 for (
unsigned int d=0;
d<dim; ++
d)
1523 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1530 for (
unsigned int k=0; k<n_q_points; ++k)
1531 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1534 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1538 transformed_shape_hessians);
1540 for (
unsigned int k=0; k<n_q_points; ++k)
1541 for (
unsigned int d=0;
d<spacedim; ++
d)
1542 for (
unsigned int n=0; n<spacedim; ++n)
1543 for (
unsigned int i=0; i<spacedim; ++i)
1544 for (
unsigned int j=0; j<spacedim; ++j)
1546 transformed_shape_hessians[k][
d][i][j]
1548 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1550 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1552 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1554 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
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] = transformed_shape_hessians[k][d];
1567 for (
unsigned int k=0; k<n_q_points; ++k)
1568 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1571 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1575 transformed_shape_hessians);
1577 for (
unsigned int k=0; k<n_q_points; ++k)
1578 for (
unsigned int d=0;
d<spacedim; ++
d)
1579 for (
unsigned int n=0; n<spacedim; ++n)
1580 for (
unsigned int i=0; i<spacedim; ++i)
1581 for (
unsigned int j=0; j<spacedim; ++j)
1583 transformed_shape_hessians[k][
d][i][j]
1585 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1587 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1589 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1591 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1592 for (
unsigned int m=0; m<spacedim; ++m)
1593 transformed_shape_hessians[k][d][i][j]
1594 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
1595 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1597 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1598 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1602 for (
unsigned int k=0; k<n_q_points; ++k)
1603 for (
unsigned int d=0;
d<dim; ++
d)
1604 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1613 for (
unsigned int k=0; k<n_q_points; ++k)
1614 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1617 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1621 transformed_shape_hessians);
1623 for (
unsigned int k=0; k<n_q_points; ++k)
1624 for (
unsigned int d=0;
d<spacedim; ++
d)
1625 for (
unsigned int n=0; n<spacedim; ++n)
1626 for (
unsigned int i=0; i<spacedim; ++i)
1627 for (
unsigned int j=0; j<spacedim; ++j)
1629 transformed_shape_hessians[k][
d][i][j]
1631 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1633 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1635 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1637 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1639 transformed_shape_hessians[k][
d][i][j]
1641 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
1643 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
1645 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
1646 for (
unsigned int m=0; m<spacedim; ++m)
1648 transformed_shape_hessians[k][
d][i][j]
1649 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
1650 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1652 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1653 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1656 transformed_shape_hessians[k][
d][i][j]
1657 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
1658 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1660 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
1661 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1666 for (
unsigned int k=0; k<n_q_points; ++k)
1667 for (
unsigned int d=0;
d<dim; ++
d)
1668 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1676 for (
unsigned int k=0; k<n_q_points; ++k)
1677 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1680 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1684 transformed_shape_hessians);
1686 for (
unsigned int k=0; k<n_q_points; ++k)
1687 for (
unsigned int d=0;
d<spacedim; ++
d)
1688 for (
unsigned int n=0; n<spacedim; ++n)
1689 for (
unsigned int i=0; i<spacedim; ++i)
1690 for (
unsigned int j=0; j<spacedim; ++j)
1692 transformed_shape_hessians[k][
d][i][j]
1694 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1696 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1698 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1700 * mapping_data.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] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1726 template <
class PolynomialType,
int dim,
int spacedim>
1732 switch (mapping_type)
1814 #include "fe_poly_tensor.inst" 1817 DEAL_II_NAMESPACE_CLOSE
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const =0
Contravariant transformation.
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const
FE_PolyTensor(const unsigned int degree, const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
static ::ExceptionBase & ExcFENotPrimitive()
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const
Third derivatives of shape functions.
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
Abstract base class for mapping classes.
Second derivatives of shape functions.
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int size() const
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const
ArrayView< ElementType > make_array_view(std::vector< ElementType > &vector)
Shape function gradients.
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)
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
static ::ExceptionBase & ExcNotImplemented()
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
Values needed for Piola transform.
Covariant transformation.
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static ::ExceptionBase & ExcInternalError()
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)