17 #include <deal.II/base/array_view.h> 18 #include <deal.II/base/derivative_form.h> 19 #include <deal.II/base/qprojector.h> 20 #include <deal.II/base/polynomials_bdm.h> 21 #include <deal.II/base/polynomials_raviart_thomas.h> 22 #include <deal.II/base/polynomials_rt_bubbles.h> 23 #include <deal.II/base/polynomials_abf.h> 24 #include <deal.II/base/polynomials_nedelec.h> 25 #include <deal.II/fe/fe_poly_tensor.h> 26 #include <deal.II/fe/fe_values.h> 27 #include <deal.II/fe/mapping_cartesian.h> 28 #include <deal.II/grid/tria.h> 30 DEAL_II_NAMESPACE_OPEN
50 get_face_sign_change_rt (const ::Triangulation<1>::cell_iterator &,
52 std::vector<double> &face_sign)
55 std::fill (face_sign.begin (), face_sign.end (), 1.0);
61 get_face_sign_change_rt (const ::Triangulation<2>::cell_iterator &cell,
62 const unsigned int dofs_per_face,
63 std::vector<double> &face_sign)
65 const unsigned int dim = 2;
66 const unsigned int spacedim = 2;
70 std::fill (face_sign.begin (), face_sign.end (), 1.0);
73 f < GeometryInfo<dim>::faces_per_cell; ++f)
76 if (!face->at_boundary ())
78 const unsigned int nn = cell->neighbor_face_no(f);
81 for (
unsigned int j = 0; j < dofs_per_face; ++j)
83 Assert (f * dofs_per_face + j < face_sign.size(),
87 face_sign[f * dofs_per_face + j] = -1.0;
96 get_face_sign_change_rt (const ::Triangulation<3>::cell_iterator &,
98 std::vector<double> &face_sign)
100 std::fill (face_sign.begin (), face_sign.end (), 1.0);
105 get_face_sign_change_nedelec (const ::Triangulation<1>::cell_iterator &,
107 std::vector<double> &face_sign)
110 std::fill (face_sign.begin (), face_sign.end (), 1.0);
116 get_face_sign_change_nedelec (const ::Triangulation<2>::cell_iterator &,
118 std::vector<double> &face_sign)
120 std::fill (face_sign.begin (), face_sign.end (), 1.0);
126 get_face_sign_change_nedelec (const ::Triangulation<3>::cell_iterator &cell,
128 std::vector<double> &face_sign)
130 const unsigned int dim = 3;
131 std::fill (face_sign.begin (), face_sign.end (), 1.0);
133 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
134 if (!(cell->line_orientation (l)))
143 template <
class PolynomialType,
int dim,
int spacedim>
145 (
const unsigned int degree,
147 const std::vector<bool> &restriction_is_additive_flags,
148 const std::vector<ComponentMask> &nonzero_components)
151 restriction_is_additive_flags,
154 poly_space(PolynomialType(degree))
156 cached_point(0) = -1;
164 for (
unsigned int comp=0; comp<this->
n_components() ; ++comp)
165 this->component_to_base_table[comp].first.second = comp;
170 template <
class PolynomialType,
int dim,
int spacedim>
182 template <
class PolynomialType,
int dim,
int spacedim>
185 (
const unsigned int i,
187 const unsigned int component)
const 194 if (cached_point != p || cached_values.size() == 0)
197 cached_values.resize(poly_space.n());
199 std::vector<Tensor<4,dim> > dummy1;
200 std::vector<Tensor<5,dim> > dummy2;
201 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
205 if (inverse_node_matrix.n_cols() == 0)
206 return cached_values[i][component];
208 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
209 s += inverse_node_matrix(j,i) * cached_values[j][component];
215 template <
class PolynomialType,
int dim,
int spacedim>
226 template <
class PolynomialType,
int dim,
int spacedim>
229 (
const unsigned int i,
231 const unsigned int component)
const 238 if (cached_point != p || cached_grads.size() == 0)
241 cached_grads.resize(poly_space.n());
243 std::vector<Tensor<4,dim> > dummy1;
244 std::vector<Tensor<5,dim> > dummy2;
245 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
249 if (inverse_node_matrix.n_cols() == 0)
250 return cached_grads[i][component];
252 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
253 s += inverse_node_matrix(j,i) * cached_grads[j][component];
260 template <
class PolynomialType,
int dim,
int spacedim>
272 template <
class PolynomialType,
int dim,
int spacedim>
275 (
const unsigned int i,
277 const unsigned int component)
const 284 if (cached_point != p || cached_grad_grads.size() == 0)
287 cached_grad_grads.resize(poly_space.n());
289 std::vector<Tensor<4,dim> > dummy1;
290 std::vector<Tensor<5,dim> > dummy2;
291 poly_space.compute(p, cached_values, cached_grads, cached_grad_grads, dummy1, dummy2);
295 if (inverse_node_matrix.n_cols() == 0)
296 return cached_grad_grads[i][component];
298 for (
unsigned int j=0; j<inverse_node_matrix.n_cols(); ++j)
299 s += inverse_node_matrix(i,j) * cached_grad_grads[j][component];
309 template <
class PolynomialType,
int dim,
int spacedim>
318 const ::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> &mapping_data,
326 Assert (dynamic_cast<const InternalData *> (&fe_internal) !=
nullptr,
328 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
330 const unsigned int n_q_points = quadrature.
size();
332 Assert(!(fe_data.update_each &
update_values) || fe_data.shape_values.size()[0] == this->dofs_per_cell,
334 Assert(!(fe_data.update_each &
update_values) || fe_data.shape_values.size()[1] == n_q_points,
342 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
345 internal::FE_PolyTensor::get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
347 internal::FE_PolyTensor::get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
350 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
353 this->get_nonzero_components(i).first_selected_component()];
367 switch (mapping_type)
371 for (
unsigned int k=0; k<n_q_points; ++k)
372 for (
unsigned int d=0; d<dim; ++d)
373 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k][d];
385 for (
unsigned int k=0; k<n_q_points; ++k)
386 for (
unsigned int d=0;
d<dim; ++
d)
387 output_data.
shape_values(first+d,k) = fe_data.transformed_shape_values[k][
d];
399 for (
unsigned int k=0; k<n_q_points; ++k)
400 for (
unsigned int d=0;
d<dim; ++
d)
402 = fe_data.sign_change[i] * fe_data.transformed_shape_values[k][
d];
413 for (
unsigned int k = 0; k < n_q_points; ++k)
414 for (
unsigned int d = 0;
d < dim; ++
d)
415 output_data.
shape_values(first+d,k) = fe_data.sign_change[i]
416 * fe_data.transformed_shape_values[k][
d];
435 switch (mapping_type)
443 for (
unsigned int k=0; k<n_q_points; ++k)
444 for (
unsigned int d=0;
d<dim; ++
d)
445 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
455 for (
unsigned int k=0; k<n_q_points; ++k)
456 for (
unsigned int d=0;
d<spacedim; ++
d)
457 for (
unsigned int n=0; n<spacedim; ++n)
458 fe_data.transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
459 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
461 for (
unsigned int k=0; k<n_q_points; ++k)
462 for (
unsigned int d=0;
d<dim; ++
d)
463 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
469 for (
unsigned int k=0; k<n_q_points; ++k)
470 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
476 for (
unsigned int k=0; k<n_q_points; ++k)
477 for (
unsigned int d=0;
d<spacedim; ++
d)
478 for (
unsigned int n=0; n<spacedim; ++n)
479 fe_data.transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
480 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
483 for (
unsigned int k=0; k<n_q_points; ++k)
484 for (
unsigned int d=0;
d<dim; ++
d)
485 output_data.
shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
492 for (
unsigned int k=0; k<n_q_points; ++k)
493 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
499 for (
unsigned int k=0; k<n_q_points; ++k)
500 for (
unsigned int d=0;
d<spacedim; ++
d)
501 for (
unsigned int n=0; n<spacedim; ++n)
502 fe_data.transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
503 * mapping_data.jacobian_pushed_forward_grads[k][
d][n] )
505 * mapping_data.jacobian_pushed_forward_grads[k][n][n] );
507 for (
unsigned int k=0; k<n_q_points; ++k)
508 for (
unsigned int d=0;
d<dim; ++
d)
510 * fe_data.transformed_shape_grads[k][d];
527 for (
unsigned int k=0; k<n_q_points; ++k)
528 fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
535 for (
unsigned int k=0; k<n_q_points; ++k)
536 for (
unsigned int d=0;
d<spacedim; ++
d)
537 for (
unsigned int n=0; n<spacedim; ++n)
538 fe_data.transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
539 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
541 for (
unsigned int k = 0; k < n_q_points; ++k)
542 for (
unsigned int d = 0;
d < dim; ++
d)
544 * fe_data.transformed_shape_grads[k][d];
564 switch (mapping_type)
574 for (
unsigned int k=0; k<n_q_points; ++k)
575 for (
unsigned int d=0;
d<spacedim; ++
d)
576 for (
unsigned int n=0; n<spacedim; ++n)
577 fe_data.transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
578 * mapping_data.jacobian_pushed_forward_grads[k][n];
580 for (
unsigned int k=0; k<n_q_points; ++k)
581 for (
unsigned int d=0;
d<dim; ++
d)
582 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
590 for (
unsigned int k=0; k<n_q_points; ++k)
591 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
597 for (
unsigned int k=0; k<n_q_points; ++k)
598 for (
unsigned int d=0;
d<spacedim; ++
d)
599 for (
unsigned int n=0; n<spacedim; ++n)
600 for (
unsigned int i=0; i<spacedim; ++i)
601 for (
unsigned int j=0; j<spacedim; ++j)
603 fe_data.transformed_shape_hessians[k][
d][i][j]
605 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
607 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
609 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
611 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
614 for (
unsigned int k=0; k<n_q_points; ++k)
615 for (
unsigned int d=0;
d<dim; ++
d)
616 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
624 for (
unsigned int k=0; k<n_q_points; ++k)
625 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
632 for (
unsigned int k=0; k<n_q_points; ++k)
633 for (
unsigned int d=0;
d<spacedim; ++
d)
634 for (
unsigned int n=0; n<spacedim; ++n)
635 for (
unsigned int i=0; i<spacedim; ++i)
636 for (
unsigned int j=0; j<spacedim; ++j)
638 fe_data.transformed_shape_hessians[k][
d][i][j]
640 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
642 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
644 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
646 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
647 for (
unsigned int m=0; m<spacedim; ++m)
648 fe_data.transformed_shape_hessians[k][d][i][j]
649 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
650 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
652 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
653 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
657 for (
unsigned int k=0; k<n_q_points; ++k)
658 for (
unsigned int d=0;
d<dim; ++
d)
659 output_data.
shape_hessians[first+d][k] = fe_data.transformed_shape_hessians[k][d];
668 for (
unsigned int k=0; k<n_q_points; ++k)
669 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
676 for (
unsigned int k=0; k<n_q_points; ++k)
677 for (
unsigned int d=0;
d<spacedim; ++
d)
678 for (
unsigned int n=0; n<spacedim; ++n)
679 for (
unsigned int i=0; i<spacedim; ++i)
680 for (
unsigned int j=0; j<spacedim; ++j)
682 fe_data.transformed_shape_hessians[k][
d][i][j]
684 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
686 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
688 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
690 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
692 fe_data.transformed_shape_hessians[k][
d][i][j]
694 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
696 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
698 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
700 for (
unsigned int m=0; m<spacedim; ++m)
702 fe_data.transformed_shape_hessians[k][
d][i][j]
703 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
704 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
706 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
707 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
710 fe_data.transformed_shape_hessians[k][
d][i][j]
711 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
712 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
714 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
715 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
720 for (
unsigned int k=0; k<n_q_points; ++k)
721 for (
unsigned int d=0;
d<dim; ++
d)
722 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * fe_data.transformed_shape_hessians[k][d];
731 for (
unsigned int k=0; k<n_q_points; ++k)
732 fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
738 for (
unsigned int k=0; k<n_q_points; ++k)
739 for (
unsigned int d=0;
d<spacedim; ++
d)
740 for (
unsigned int n=0; n<spacedim; ++n)
741 for (
unsigned int i=0; i<spacedim; ++i)
742 for (
unsigned int j=0; j<spacedim; ++j)
744 fe_data.transformed_shape_hessians[k][
d][i][j]
746 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
748 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
750 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
752 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
755 for (
unsigned int k=0; k<n_q_points; ++k)
756 for (
unsigned int d=0;
d<dim; ++
d)
757 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * fe_data.transformed_shape_hessians[k][d];
783 template <
class PolynomialType,
int dim,
int spacedim>
788 const unsigned int face_no,
792 const ::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> &mapping_data,
800 Assert (dynamic_cast<const InternalData *> (&fe_internal) !=
nullptr,
802 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
804 const unsigned int n_q_points = quadrature.
size();
811 cell->face_orientation(face_no),
812 cell->face_flip(face_no),
813 cell->face_rotation(face_no),
823 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
826 internal::FE_PolyTensor::get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
829 internal::FE_PolyTensor::get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
831 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
834 this->get_nonzero_components(i).first_selected_component()];
838 switch (mapping_type)
842 for (
unsigned int k=0; k<n_q_points; ++k)
843 for (
unsigned int d=0;
d<dim; ++
d)
844 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k+offset][
d];
852 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
856 transformed_shape_values);
858 for (
unsigned int k=0; k<n_q_points; ++k)
859 for (
unsigned int d=0;
d<dim; ++
d)
860 output_data.
shape_values(first+d,k) = transformed_shape_values[k][
d];
868 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
872 transformed_shape_values);
873 for (
unsigned int k=0; k<n_q_points; ++k)
874 for (
unsigned int d=0;
d<dim; ++
d)
876 = fe_data.sign_change[i] * transformed_shape_values[k][
d];
883 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
887 transformed_shape_values);
889 for (
unsigned int k = 0; k < n_q_points; ++k)
890 for (
unsigned int d = 0;
d < dim; ++
d)
892 fe_data.sign_change[i] * transformed_shape_values[k][
d];
904 switch (mapping_type)
909 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
913 transformed_shape_grads);
914 for (
unsigned int k=0; k<n_q_points; ++k)
915 for (
unsigned int d=0;
d<dim; ++
d)
916 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
923 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
927 transformed_shape_grads);
929 for (
unsigned int k=0; k<n_q_points; ++k)
930 for (
unsigned int d=0;
d<spacedim; ++
d)
931 for (
unsigned int n=0; n<spacedim; ++n)
932 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
933 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
935 for (
unsigned int k=0; k<n_q_points; ++k)
936 for (
unsigned int d=0;
d<dim; ++
d)
937 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
944 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
945 for (
unsigned int k=0; k<n_q_points; ++k)
946 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
950 transformed_shape_grads);
952 for (
unsigned int k=0; k<n_q_points; ++k)
953 for (
unsigned int d=0;
d<spacedim; ++
d)
954 for (
unsigned int n=0; n<spacedim; ++n)
955 transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
956 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
958 for (
unsigned int k=0; k<n_q_points; ++k)
959 for (
unsigned int d=0;
d<dim; ++
d)
960 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
969 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
970 for (
unsigned int k=0; k<n_q_points; ++k)
971 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
975 transformed_shape_grads);
977 for (
unsigned int k=0; k<n_q_points; ++k)
978 for (
unsigned int d=0;
d<spacedim; ++
d)
979 for (
unsigned int n=0; n<spacedim; ++n)
980 transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
981 * mapping_data.jacobian_pushed_forward_grads[k][
d][n] )
984 * mapping_data.jacobian_pushed_forward_grads[k][n][n] );
986 for (
unsigned int k = 0; k < n_q_points; ++k)
987 for (
unsigned int d = 0;
d < dim; ++
d)
989 * transformed_shape_grads[k][d];
1006 for (
unsigned int k=0; k<n_q_points; ++k)
1007 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1010 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
1014 transformed_shape_grads);
1016 for (
unsigned int k=0; k<n_q_points; ++k)
1017 for (
unsigned int d=0;
d<spacedim; ++
d)
1018 for (
unsigned int n=0; n<spacedim; ++n)
1019 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1020 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1022 for (
unsigned int k = 0; k < n_q_points; ++k)
1023 for (
unsigned int d = 0;
d < dim; ++
d)
1025 * transformed_shape_grads[k][d];
1037 switch (mapping_type)
1042 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1046 transformed_shape_hessians);
1048 for (
unsigned int k=0; k<n_q_points; ++k)
1049 for (
unsigned int d=0;
d<spacedim; ++
d)
1050 for (
unsigned int n=0; n<spacedim; ++n)
1051 transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
1052 *mapping_data.jacobian_pushed_forward_grads[k][n];
1054 for (
unsigned int k=0; k<n_q_points; ++k)
1055 for (
unsigned int d=0;
d<dim; ++
d)
1056 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1063 for (
unsigned int k=0; k<n_q_points; ++k)
1064 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1067 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1071 transformed_shape_hessians);
1073 for (
unsigned int k=0; k<n_q_points; ++k)
1074 for (
unsigned int d=0;
d<spacedim; ++
d)
1075 for (
unsigned int n=0; n<spacedim; ++n)
1076 for (
unsigned int i=0; i<spacedim; ++i)
1077 for (
unsigned int j=0; j<spacedim; ++j)
1079 transformed_shape_hessians[k][
d][i][j]
1081 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1083 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1085 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1087 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1090 for (
unsigned int k=0; k<n_q_points; ++k)
1091 for (
unsigned int d=0;
d<dim; ++
d)
1092 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1100 for (
unsigned int k=0; k<n_q_points; ++k)
1101 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1104 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1108 transformed_shape_hessians);
1110 for (
unsigned int k=0; k<n_q_points; ++k)
1111 for (
unsigned int d=0;
d<spacedim; ++
d)
1112 for (
unsigned int n=0; n<spacedim; ++n)
1113 for (
unsigned int i=0; i<spacedim; ++i)
1114 for (
unsigned int j=0; j<spacedim; ++j)
1116 transformed_shape_hessians[k][
d][i][j]
1118 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1120 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1122 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1124 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1125 for (
unsigned int m=0; m<spacedim; ++m)
1126 transformed_shape_hessians[k][d][i][j]
1127 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
1128 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1130 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1131 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1135 for (
unsigned int k=0; k<n_q_points; ++k)
1136 for (
unsigned int d=0;
d<dim; ++
d)
1137 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1145 for (
unsigned int k=0; k<n_q_points; ++k)
1146 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1149 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1153 transformed_shape_hessians);
1155 for (
unsigned int k=0; k<n_q_points; ++k)
1156 for (
unsigned int d=0;
d<spacedim; ++
d)
1157 for (
unsigned int n=0; n<spacedim; ++n)
1158 for (
unsigned int i=0; i<spacedim; ++i)
1159 for (
unsigned int j=0; j<spacedim; ++j)
1161 transformed_shape_hessians[k][
d][i][j]
1163 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1165 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1167 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1169 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1171 transformed_shape_hessians[k][
d][i][j]
1173 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
1175 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
1177 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
1179 for (
unsigned int m=0; m<spacedim; ++m)
1181 transformed_shape_hessians[k][
d][i][j]
1182 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
1183 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1185 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1186 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1189 transformed_shape_hessians[k][
d][i][j]
1190 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
1191 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1193 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
1194 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1199 for (
unsigned int k=0; k<n_q_points; ++k)
1200 for (
unsigned int d=0;
d<dim; ++
d)
1201 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1208 for (
unsigned int k=0; k<n_q_points; ++k)
1209 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1212 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1216 transformed_shape_hessians);
1218 for (
unsigned int k=0; k<n_q_points; ++k)
1219 for (
unsigned int d=0;
d<spacedim; ++
d)
1220 for (
unsigned int n=0; n<spacedim; ++n)
1221 for (
unsigned int i=0; i<spacedim; ++i)
1222 for (
unsigned int j=0; j<spacedim; ++j)
1224 transformed_shape_hessians[k][
d][i][j]
1226 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1228 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1230 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1232 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1235 for (
unsigned int k=0; k<n_q_points; ++k)
1236 for (
unsigned int d=0;
d<dim; ++
d)
1237 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1257 template <
class PolynomialType,
int dim,
int spacedim>
1262 const unsigned int face_no,
1263 const unsigned int sub_no,
1267 const ::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> &mapping_data,
1275 Assert (dynamic_cast<const InternalData *> (&fe_internal) !=
nullptr,
1277 const InternalData &fe_data =
static_cast<const InternalData &
> (fe_internal);
1279 const unsigned int n_q_points = quadrature.
size();
1286 cell->face_orientation(face_no),
1287 cell->face_flip(face_no),
1288 cell->face_rotation(face_no),
1290 cell->subface_case(face_no));
1302 std::fill( fe_data.sign_change.begin(), fe_data.sign_change.end(), 1.0 );
1305 internal::FE_PolyTensor::get_face_sign_change_rt (cell, this->dofs_per_face, fe_data.sign_change);
1308 internal::FE_PolyTensor::get_face_sign_change_nedelec (cell, this->dofs_per_face, fe_data.sign_change);
1310 for (
unsigned int i=0; i<this->dofs_per_cell; ++i)
1313 this->get_nonzero_components(i).first_selected_component()];
1317 switch (mapping_type)
1321 for (
unsigned int k=0; k<n_q_points; ++k)
1322 for (
unsigned int d=0;
d<dim; ++
d)
1323 output_data.
shape_values(first+d,k) = fe_data.shape_values[i][k+offset][
d];
1331 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1335 transformed_shape_values);
1337 for (
unsigned int k=0; k<n_q_points; ++k)
1338 for (
unsigned int d=0;
d<dim; ++
d)
1339 output_data.
shape_values(first+d,k) = transformed_shape_values[k][
d];
1348 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1353 transformed_shape_values);
1354 for (
unsigned int k=0; k<n_q_points; ++k)
1355 for (
unsigned int d=0;
d<dim; ++
d)
1357 = fe_data.sign_change[i] * transformed_shape_values[k][
d];
1364 =
make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
1369 transformed_shape_values);
1371 for (
unsigned int k = 0; k < n_q_points; ++k)
1372 for (
unsigned int d = 0;
d < dim; ++
d)
1374 fe_data.sign_change[i] * transformed_shape_values[k][
d];
1387 =
make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
1388 switch (mapping_type)
1395 transformed_shape_grads);
1396 for (
unsigned int k=0; k<n_q_points; ++k)
1397 for (
unsigned int d=0;
d<dim; ++
d)
1398 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1407 transformed_shape_grads);
1409 for (
unsigned int k=0; k<n_q_points; ++k)
1410 for (
unsigned int d=0;
d<spacedim; ++
d)
1411 for (
unsigned int n=0; n<spacedim; ++n)
1412 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1413 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1415 for (
unsigned int k=0; k<n_q_points; ++k)
1416 for (
unsigned int d=0;
d<dim; ++
d)
1417 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1424 for (
unsigned int k=0; k<n_q_points; ++k)
1425 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1430 transformed_shape_grads);
1432 for (
unsigned int k=0; k<n_q_points; ++k)
1433 for (
unsigned int d=0;
d<spacedim; ++
d)
1434 for (
unsigned int n=0; n<spacedim; ++n)
1435 transformed_shape_grads[k][d] += output_data.
shape_values(first+n,k)
1436 * mapping_data.jacobian_pushed_forward_grads[k][
d][n];
1438 for (
unsigned int k=0; k<n_q_points; ++k)
1439 for (
unsigned int d=0;
d<dim; ++
d)
1440 output_data.
shape_gradients[first+d][k] = transformed_shape_grads[k][d];
1448 for (
unsigned int k=0; k<n_q_points; ++k)
1449 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1454 transformed_shape_grads);
1456 for (
unsigned int k=0; k<n_q_points; ++k)
1457 for (
unsigned int d=0;
d<spacedim; ++
d)
1458 for (
unsigned int n=0; n<spacedim; ++n)
1459 transformed_shape_grads[k][d] += ( output_data.
shape_values(first+n,k)
1460 * mapping_data.jacobian_pushed_forward_grads[k][
d][n])
1462 * mapping_data.jacobian_pushed_forward_grads[k][n][n]);
1464 for (
unsigned int k=0; k<n_q_points; ++k)
1465 for (
unsigned int d=0;
d<dim; ++
d)
1467 fe_data.sign_change[i] * transformed_shape_grads[k][d];
1483 for (
unsigned int k=0; k<n_q_points; ++k)
1484 fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
1489 transformed_shape_grads);
1491 for (
unsigned int k=0; k<n_q_points; ++k)
1492 for (
unsigned int d=0;
d<spacedim; ++
d)
1493 for (
unsigned int n=0; n<spacedim; ++n)
1494 transformed_shape_grads[k][d] -= output_data.
shape_values(first+n,k)
1495 * mapping_data.jacobian_pushed_forward_grads[k][n][
d];
1497 for (
unsigned int k = 0; k < n_q_points; ++k)
1498 for (
unsigned int d = 0;
d < dim; ++
d)
1500 fe_data.sign_change[i] * transformed_shape_grads[k][d];
1512 switch (mapping_type)
1517 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1520 transformed_shape_hessians);
1522 for (
unsigned int k=0; k<n_q_points; ++k)
1523 for (
unsigned int d=0;
d<spacedim; ++
d)
1524 for (
unsigned int n=0; n<spacedim; ++n)
1525 transformed_shape_hessians[k][d] -= output_data.
shape_gradients[first+d][k][n]
1526 *mapping_data.jacobian_pushed_forward_grads[k][n];
1528 for (
unsigned int k=0; k<n_q_points; ++k)
1529 for (
unsigned int d=0;
d<dim; ++
d)
1530 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1537 for (
unsigned int k=0; k<n_q_points; ++k)
1538 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1541 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1545 transformed_shape_hessians);
1547 for (
unsigned int k=0; k<n_q_points; ++k)
1548 for (
unsigned int d=0;
d<spacedim; ++
d)
1549 for (
unsigned int n=0; n<spacedim; ++n)
1550 for (
unsigned int i=0; i<spacedim; ++i)
1551 for (
unsigned int j=0; j<spacedim; ++j)
1553 transformed_shape_hessians[k][
d][i][j]
1555 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1557 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1559 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1561 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1564 for (
unsigned int k=0; k<n_q_points; ++k)
1565 for (
unsigned int d=0;
d<dim; ++
d)
1566 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1574 for (
unsigned int k=0; k<n_q_points; ++k)
1575 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1578 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1582 transformed_shape_hessians);
1584 for (
unsigned int k=0; k<n_q_points; ++k)
1585 for (
unsigned int d=0;
d<spacedim; ++
d)
1586 for (
unsigned int n=0; n<spacedim; ++n)
1587 for (
unsigned int i=0; i<spacedim; ++i)
1588 for (
unsigned int j=0; j<spacedim; ++j)
1590 transformed_shape_hessians[k][
d][i][j]
1592 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1594 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1596 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1598 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1599 for (
unsigned int m=0; m<spacedim; ++m)
1600 transformed_shape_hessians[k][d][i][j]
1601 -= (mapping_data.jacobian_pushed_forward_grads[k][d][i][m]
1602 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1604 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1605 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1609 for (
unsigned int k=0; k<n_q_points; ++k)
1610 for (
unsigned int d=0;
d<dim; ++
d)
1611 output_data.
shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
1620 for (
unsigned int k=0; k<n_q_points; ++k)
1621 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1624 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1628 transformed_shape_hessians);
1630 for (
unsigned int k=0; k<n_q_points; ++k)
1631 for (
unsigned int d=0;
d<spacedim; ++
d)
1632 for (
unsigned int n=0; n<spacedim; ++n)
1633 for (
unsigned int i=0; i<spacedim; ++i)
1634 for (
unsigned int j=0; j<spacedim; ++j)
1636 transformed_shape_hessians[k][
d][i][j]
1638 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][
d][n][i][j])
1640 * mapping_data.jacobian_pushed_forward_grads[k][d][n][j])
1642 * mapping_data.jacobian_pushed_forward_grads[k][
d][i][n])
1644 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j]);
1646 transformed_shape_hessians[k][
d][i][j]
1648 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][n][i][j])
1650 * mapping_data.jacobian_pushed_forward_grads[k][n][n][j])
1652 * mapping_data.jacobian_pushed_forward_grads[k][n][n][i]);
1653 for (
unsigned int m=0; m<spacedim; ++m)
1655 transformed_shape_hessians[k][
d][i][j]
1656 -= (mapping_data.jacobian_pushed_forward_grads[k][
d][i][m]
1657 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1659 + (mapping_data.jacobian_pushed_forward_grads[k][d][m][j]
1660 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1663 transformed_shape_hessians[k][
d][i][j]
1664 += (mapping_data.jacobian_pushed_forward_grads[k][n][i][m]
1665 * mapping_data.jacobian_pushed_forward_grads[k][m][n][j]
1667 + (mapping_data.jacobian_pushed_forward_grads[k][n][m][j]
1668 * mapping_data.jacobian_pushed_forward_grads[k][m][i][n]
1673 for (
unsigned int k=0; k<n_q_points; ++k)
1674 for (
unsigned int d=0;
d<dim; ++
d)
1675 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1683 for (
unsigned int k=0; k<n_q_points; ++k)
1684 fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
1687 =
make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
1691 transformed_shape_hessians);
1693 for (
unsigned int k=0; k<n_q_points; ++k)
1694 for (
unsigned int d=0;
d<spacedim; ++
d)
1695 for (
unsigned int n=0; n<spacedim; ++n)
1696 for (
unsigned int i=0; i<spacedim; ++i)
1697 for (
unsigned int j=0; j<spacedim; ++j)
1699 transformed_shape_hessians[k][
d][i][j]
1701 * mapping_data.jacobian_pushed_forward_2nd_derivatives[k][n][
d][i][j])
1703 * mapping_data.jacobian_pushed_forward_grads[k][n][i][j])
1705 * mapping_data.jacobian_pushed_forward_grads[k][n][
d][j])
1707 * mapping_data.jacobian_pushed_forward_grads[k][n][i][d]);
1710 for (
unsigned int k=0; k<n_q_points; ++k)
1711 for (
unsigned int d=0;
d<dim; ++
d)
1712 output_data.
shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
1733 template <
class PolynomialType,
int dim,
int spacedim>
1739 switch (mapping_type)
1823 #include "fe_poly_tensor.inst" 1826 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
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type > make_array_view(const Iterator begin, const Iterator end)
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
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)