16 #include <deal.II/base/array_view.h> 17 #include <deal.II/base/memory_consumption.h> 18 #include <deal.II/base/multithread_info.h> 19 #include <deal.II/base/numbers.h> 20 #include <deal.II/base/quadrature.h> 21 #include <deal.II/base/signaling_nan.h> 22 #include <deal.II/base/std_cxx14/memory.h> 24 #include <deal.II/differentiation/ad.h> 26 #include <deal.II/dofs/dof_accessor.h> 28 #include <deal.II/fe/fe.h> 29 #include <deal.II/fe/fe_values.h> 30 #include <deal.II/fe/mapping_q1.h> 32 #include <deal.II/grid/tria_accessor.h> 33 #include <deal.II/grid/tria_iterator.h> 35 #include <deal.II/lac/block_vector.h> 36 #include <deal.II/lac/la_parallel_block_vector.h> 37 #include <deal.II/lac/la_parallel_vector.h> 38 #include <deal.II/lac/la_vector.h> 39 #include <deal.II/lac/petsc_block_vector.h> 40 #include <deal.II/lac/petsc_vector.h> 41 #include <deal.II/lac/trilinos_parallel_block_vector.h> 42 #include <deal.II/lac/trilinos_tpetra_vector.h> 43 #include <deal.II/lac/trilinos_vector.h> 44 #include <deal.II/lac/vector.h> 45 #include <deal.II/lac/vector_element_access.h> 47 #include <boost/container/small_vector.hpp> 50 #include <type_traits> 52 DEAL_II_NAMESPACE_OPEN
57 template <
class VectorType>
58 typename VectorType::value_type
inline get_vector_element(
59 const VectorType & vector,
62 return internal::ElementAccess<VectorType>::get(vector, cell_number);
76 template <
int dim,
int spacedim>
77 inline std::vector<unsigned int>
80 std::vector<unsigned int> shape_function_to_row_table(
89 unsigned int nth_nonzero_component = 0;
94 row + nth_nonzero_component;
95 ++nth_nonzero_component;
100 return shape_function_to_row_table;
107 template <
typename Number,
typename T =
void>
111 value(
const Number &value)
122 template <
typename Number>
125 typename
std::enable_if<
126 Differentiation::AD::is_ad_number<Number>::value>::type>
129 value(
const Number & )
141 template <
int dim,
int spacedim>
143 const unsigned int component)
144 : fe_values(&fe_values)
145 , component(component)
146 , shape_function_data(this->fe_values->fe->dofs_per_cell)
155 const std::vector<unsigned int> shape_function_to_row_table =
156 ::internal::make_shape_function_to_row_table(fe);
162 if (is_primitive ==
true)
179 template <
int dim,
int spacedim>
182 , component(
numbers::invalid_unsigned_int)
187 template <
int dim,
int spacedim>
189 const unsigned int first_vector_component)
190 : fe_values(&fe_values)
191 , first_vector_component(first_vector_component)
192 , shape_function_data(this->fe_values->fe->dofs_per_cell)
203 const std::vector<unsigned int> shape_function_to_row_table =
204 ::internal::make_shape_function_to_row_table(fe);
206 for (
unsigned int d = 0; d < spacedim; ++d)
214 if (is_primitive ==
true)
224 shape_function_to_row_table[i * fe.
n_components() + component];
233 unsigned int n_nonzero_components = 0;
234 for (
unsigned int d = 0; d < spacedim; ++d)
237 ++n_nonzero_components;
239 if (n_nonzero_components == 0)
241 else if (n_nonzero_components > 1)
245 for (
unsigned int d = 0; d < spacedim; ++d)
247 .is_nonzero_shape_function_component[d] ==
true)
260 template <
int dim,
int spacedim>
263 , first_vector_component(
numbers::invalid_unsigned_int)
268 template <
int dim,
int spacedim>
271 const unsigned int first_tensor_component)
272 : fe_values(&fe_values)
273 , first_tensor_component(first_tensor_component)
274 , shape_function_data(this->fe_values->fe->dofs_per_cell)
277 Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 <
280 first_tensor_component +
287 const std::vector<unsigned int> shape_function_to_row_table =
288 ::internal::make_shape_function_to_row_table(fe);
290 for (
unsigned int d = 0;
291 d < ::SymmetricTensor<2, dim>::n_independent_components;
294 const unsigned int component = first_tensor_component + d;
300 if (is_primitive ==
true)
301 shape_function_data[i].is_nonzero_shape_function_component[d] =
304 shape_function_data[i].is_nonzero_shape_function_component[d] =
307 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
309 shape_function_data[i].row_index[d] =
310 shape_function_to_row_table[i * fe.
n_components() + component];
312 shape_function_data[i].row_index[d] =
319 unsigned int n_nonzero_components = 0;
320 for (
unsigned int d = 0;
321 d < ::SymmetricTensor<2, dim>::n_independent_components;
323 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
325 ++n_nonzero_components;
327 if (n_nonzero_components == 0)
328 shape_function_data[i].single_nonzero_component = -2;
329 else if (n_nonzero_components > 1)
330 shape_function_data[i].single_nonzero_component = -1;
333 for (
unsigned int d = 0;
334 d < ::SymmetricTensor<2, dim>::n_independent_components;
336 if (shape_function_data[i]
337 .is_nonzero_shape_function_component[d] ==
true)
339 shape_function_data[i].single_nonzero_component =
340 shape_function_data[i].row_index[d];
341 shape_function_data[i].single_nonzero_component_index = d;
350 template <
int dim,
int spacedim>
353 , first_tensor_component(
numbers::invalid_unsigned_int)
358 template <
int dim,
int spacedim>
360 const unsigned int first_tensor_component)
361 : fe_values(&fe_values)
362 , first_tensor_component(first_tensor_component)
363 , shape_function_data(this->fe_values->fe->dofs_per_cell)
373 const std::vector<unsigned int> shape_function_to_row_table =
374 ::internal::make_shape_function_to_row_table(fe);
376 for (
unsigned int d = 0; d < dim * dim; ++d)
378 const unsigned int component = first_tensor_component + d;
384 if (is_primitive ==
true)
385 shape_function_data[i].is_nonzero_shape_function_component[d] =
388 shape_function_data[i].is_nonzero_shape_function_component[d] =
391 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
393 shape_function_data[i].row_index[d] =
394 shape_function_to_row_table[i * fe.
n_components() + component];
396 shape_function_data[i].row_index[d] =
403 unsigned int n_nonzero_components = 0;
404 for (
unsigned int d = 0; d < dim * dim; ++d)
405 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
407 ++n_nonzero_components;
409 if (n_nonzero_components == 0)
410 shape_function_data[i].single_nonzero_component = -2;
411 else if (n_nonzero_components > 1)
412 shape_function_data[i].single_nonzero_component = -1;
415 for (
unsigned int d = 0; d < dim * dim; ++d)
416 if (shape_function_data[i]
417 .is_nonzero_shape_function_component[d] ==
true)
419 shape_function_data[i].single_nonzero_component =
420 shape_function_data[i].row_index[d];
421 shape_function_data[i].single_nonzero_component_index = d;
430 template <
int dim,
int spacedim>
433 , first_tensor_component(
numbers::invalid_unsigned_int)
444 template <
int dim,
int spacedim,
typename Number>
450 &shape_function_data,
451 std::vector<
typename ProductType<Number, double>::type> &values)
453 const unsigned int dofs_per_cell = dof_values.
size();
454 const unsigned int n_quadrature_points =
455 dofs_per_cell > 0 ? shape_values.n_cols() : values.
size();
458 std::fill(values.begin(),
462 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
464 if (shape_function_data[shape_function]
465 .is_nonzero_shape_function_component)
467 const Number &value = dof_values[shape_function];
471 if (::internal::CheckForZero<Number>::value(value) ==
true)
474 const double *shape_value_ptr =
475 &shape_values(shape_function_data[shape_function].row_index, 0);
476 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
478 values[q_point] += value * (*shape_value_ptr++);
486 template <
int order,
int dim,
int spacedim,
typename Number>
488 do_function_derivatives(
491 const std::vector<
typename Scalar<dim, spacedim>::ShapeFunctionData>
492 &shape_function_data,
497 const unsigned int dofs_per_cell = dof_values.
size();
498 const unsigned int n_quadrature_points =
499 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
507 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
509 if (shape_function_data[shape_function]
510 .is_nonzero_shape_function_component)
512 const Number &value = dof_values[shape_function];
516 if (::internal::CheckForZero<Number>::value(value) ==
true)
519 const ::Tensor<order, spacedim> *shape_derivative_ptr =
520 &shape_derivatives[shape_function_data[shape_function].row_index]
522 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
524 derivatives[q_point] += value * (*shape_derivative_ptr++);
530 template <
int dim,
int spacedim,
typename Number>
532 do_function_laplacians(
535 const std::vector<
typename Scalar<dim, spacedim>::ShapeFunctionData>
536 & shape_function_data,
537 std::vector<
typename Scalar<dim, spacedim>::template OutputType<
538 Number>::laplacian_type> &laplacians)
540 const unsigned int dofs_per_cell = dof_values.
size();
541 const unsigned int n_quadrature_points =
542 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
545 std::fill(laplacians.begin(),
547 typename Scalar<dim, spacedim>::template OutputType<
548 Number>::laplacian_type());
550 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
552 if (shape_function_data[shape_function]
553 .is_nonzero_shape_function_component)
555 const Number &value = dof_values[shape_function];
559 if (::internal::CheckForZero<Number>::value(value) ==
true)
562 const ::Tensor<2, spacedim> *shape_hessian_ptr =
563 &shape_hessians[shape_function_data[shape_function].row_index][0];
564 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
566 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
574 template <
int dim,
int spacedim,
typename Number>
579 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
580 &shape_function_data,
585 const unsigned int dofs_per_cell = dof_values.
size();
586 const unsigned int n_quadrature_points =
587 dofs_per_cell > 0 ? shape_values.n_cols() : values.
size();
595 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
599 shape_function_data[shape_function].single_nonzero_component;
605 const Number &value = dof_values[shape_function];
609 if (::internal::CheckForZero<Number>::value(value) ==
true)
614 const unsigned int comp = shape_function_data[shape_function]
615 .single_nonzero_component_index;
616 const double *shape_value_ptr = &shape_values(snc, 0);
617 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
619 values[q_point][comp] += value * (*shape_value_ptr++);
622 for (
unsigned int d = 0;
d < spacedim; ++
d)
623 if (shape_function_data[shape_function]
624 .is_nonzero_shape_function_component[d])
626 const double *shape_value_ptr = &shape_values(
627 shape_function_data[shape_function].row_index[d], 0);
628 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
630 values[q_point][d] += value * (*shape_value_ptr++);
637 template <
int order,
int dim,
int spacedim,
typename Number>
639 do_function_derivatives(
642 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
643 &shape_function_data,
648 const unsigned int dofs_per_cell = dof_values.
size();
649 const unsigned int n_quadrature_points =
650 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
659 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
663 shape_function_data[shape_function].single_nonzero_component;
669 const Number &value = dof_values[shape_function];
673 if (::internal::CheckForZero<Number>::value(value) ==
true)
678 const unsigned int comp = shape_function_data[shape_function]
679 .single_nonzero_component_index;
680 const ::Tensor<order, spacedim> *shape_derivative_ptr =
681 &shape_derivatives[snc][0];
682 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
684 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
687 for (
unsigned int d = 0;
d < spacedim; ++
d)
688 if (shape_function_data[shape_function]
689 .is_nonzero_shape_function_component[d])
691 const ::Tensor<order, spacedim> *shape_derivative_ptr =
692 &shape_derivatives[shape_function_data[shape_function]
694 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
696 derivatives[q_point][d] +=
697 value * (*shape_derivative_ptr++);
704 template <
int dim,
int spacedim,
typename Number>
706 do_function_symmetric_gradients(
709 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
710 &shape_function_data,
714 &symmetric_gradients)
716 const unsigned int dofs_per_cell = dof_values.
size();
717 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
718 shape_gradients[0].size() :
719 symmetric_gradients.size();
723 symmetric_gradients.begin(),
724 symmetric_gradients.end(),
728 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
732 shape_function_data[shape_function].single_nonzero_component;
738 const Number &value = dof_values[shape_function];
742 if (::internal::CheckForZero<Number>::value(value) ==
true)
747 const unsigned int comp = shape_function_data[shape_function]
748 .single_nonzero_component_index;
749 const ::Tensor<1, spacedim> *shape_gradient_ptr =
750 &shape_gradients[snc][0];
751 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
753 symmetric_gradients[q_point] +=
755 symmetrize_single_row(comp, *shape_gradient_ptr++));
758 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
763 for (
unsigned int d = 0;
d < spacedim; ++
d)
764 if (shape_function_data[shape_function]
765 .is_nonzero_shape_function_component[d])
768 shape_gradients[shape_function_data[shape_function]
769 .row_index[
d]][q_point];
770 symmetric_gradients[q_point] +=
symmetrize(grad);
777 template <
int dim,
int spacedim,
typename Number>
779 do_function_divergences(
782 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
783 & shape_function_data,
784 std::vector<
typename Vector<dim, spacedim>::template OutputType<
785 Number>::divergence_type> &divergences)
787 const unsigned int dofs_per_cell = dof_values.
size();
788 const unsigned int n_quadrature_points =
789 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
792 std::fill(divergences.begin(),
794 typename Vector<dim, spacedim>::template OutputType<
795 Number>::divergence_type());
797 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
801 shape_function_data[shape_function].single_nonzero_component;
807 const Number &value = dof_values[shape_function];
811 if (::internal::CheckForZero<Number>::value(value) ==
true)
816 const unsigned int comp = shape_function_data[shape_function]
817 .single_nonzero_component_index;
818 const ::Tensor<1, spacedim> *shape_gradient_ptr =
819 &shape_gradients[snc][0];
820 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
822 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
825 for (
unsigned int d = 0;
d < spacedim; ++
d)
826 if (shape_function_data[shape_function]
827 .is_nonzero_shape_function_component[d])
829 const ::Tensor<1, spacedim> *shape_gradient_ptr =
830 &shape_gradients[shape_function_data[shape_function]
832 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
834 divergences[q_point] += value * (*shape_gradient_ptr++)[
d];
841 template <
int dim,
int spacedim,
typename Number>
846 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
847 &shape_function_data,
850 typename ::internal::CurlType<spacedim>::type>::type> &curls)
852 const unsigned int dofs_per_cell = dof_values.
size();
853 const unsigned int n_quadrature_points =
854 dofs_per_cell > 0 ? shape_gradients[0].size() : curls.size();
857 std::fill(curls.begin(),
861 typename ::internal::CurlType<spacedim>::type>::type());
869 "Computing the curl in 1d is not a useful operation"));
875 for (
unsigned int shape_function = 0;
876 shape_function < dofs_per_cell;
879 const int snc = shape_function_data[shape_function]
880 .single_nonzero_component;
886 const Number &value = dof_values[shape_function];
890 if (::internal::CheckForZero<Number>::value(value) ==
896 const ::Tensor<1, spacedim> *shape_gradient_ptr =
897 &shape_gradients[snc][0];
899 Assert(shape_function_data[shape_function]
900 .single_nonzero_component >= 0,
903 if (shape_function_data[shape_function]
904 .single_nonzero_component_index == 0)
905 for (
unsigned int q_point = 0;
906 q_point < n_quadrature_points;
909 value * (*shape_gradient_ptr++)[1];
911 for (
unsigned int q_point = 0;
912 q_point < n_quadrature_points;
915 value * (*shape_gradient_ptr++)[0];
923 if (shape_function_data[shape_function]
924 .is_nonzero_shape_function_component[0])
927 spacedim> *shape_gradient_ptr =
928 &shape_gradients[shape_function_data[shape_function]
931 for (
unsigned int q_point = 0;
932 q_point < n_quadrature_points;
935 value * (*shape_gradient_ptr++)[1];
938 if (shape_function_data[shape_function]
939 .is_nonzero_shape_function_component[1])
942 spacedim> *shape_gradient_ptr =
943 &shape_gradients[shape_function_data[shape_function]
946 for (
unsigned int q_point = 0;
947 q_point < n_quadrature_points;
950 value * (*shape_gradient_ptr++)[0];
959 for (
unsigned int shape_function = 0;
960 shape_function < dofs_per_cell;
963 const int snc = shape_function_data[shape_function]
964 .single_nonzero_component;
970 const Number &value = dof_values[shape_function];
974 if (::internal::CheckForZero<Number>::value(value) ==
980 const ::Tensor<1, spacedim> *shape_gradient_ptr =
981 &shape_gradients[snc][0];
983 switch (shape_function_data[shape_function]
984 .single_nonzero_component_index)
988 for (
unsigned int q_point = 0;
989 q_point < n_quadrature_points;
993 value * (*shape_gradient_ptr)[2];
995 value * (*shape_gradient_ptr++)[1];
1003 for (
unsigned int q_point = 0;
1004 q_point < n_quadrature_points;
1007 curls[q_point][0] -=
1008 value * (*shape_gradient_ptr)[2];
1009 curls[q_point][2] +=
1010 value * (*shape_gradient_ptr++)[0];
1018 for (
unsigned int q_point = 0;
1019 q_point < n_quadrature_points;
1022 curls[q_point][0] +=
1023 value * (*shape_gradient_ptr)[1];
1024 curls[q_point][1] -=
1025 value * (*shape_gradient_ptr++)[0];
1041 if (shape_function_data[shape_function]
1042 .is_nonzero_shape_function_component[0])
1045 spacedim> *shape_gradient_ptr =
1046 &shape_gradients[shape_function_data[shape_function]
1049 for (
unsigned int q_point = 0;
1050 q_point < n_quadrature_points;
1053 curls[q_point][1] +=
1054 value * (*shape_gradient_ptr)[2];
1055 curls[q_point][2] -=
1056 value * (*shape_gradient_ptr++)[1];
1060 if (shape_function_data[shape_function]
1061 .is_nonzero_shape_function_component[1])
1064 spacedim> *shape_gradient_ptr =
1065 &shape_gradients[shape_function_data[shape_function]
1068 for (
unsigned int q_point = 0;
1069 q_point < n_quadrature_points;
1072 curls[q_point][0] -=
1073 value * (*shape_gradient_ptr)[2];
1074 curls[q_point][2] +=
1075 value * (*shape_gradient_ptr++)[0];
1079 if (shape_function_data[shape_function]
1080 .is_nonzero_shape_function_component[2])
1083 spacedim> *shape_gradient_ptr =
1084 &shape_gradients[shape_function_data[shape_function]
1087 for (
unsigned int q_point = 0;
1088 q_point < n_quadrature_points;
1091 curls[q_point][0] +=
1092 value * (*shape_gradient_ptr)[1];
1093 curls[q_point][1] -=
1094 value * (*shape_gradient_ptr++)[0];
1105 template <
int dim,
int spacedim,
typename Number>
1107 do_function_laplacians(
1110 const std::vector<
typename Vector<dim, spacedim>::ShapeFunctionData>
1111 & shape_function_data,
1112 std::vector<
typename Vector<dim, spacedim>::template OutputType<
1113 Number>::laplacian_type> &laplacians)
1115 const unsigned int dofs_per_cell = dof_values.
size();
1116 const unsigned int n_quadrature_points =
1117 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
1120 std::fill(laplacians.begin(),
1122 typename Vector<dim, spacedim>::template OutputType<
1123 Number>::laplacian_type());
1125 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1129 shape_function_data[shape_function].single_nonzero_component;
1135 const Number &value = dof_values[shape_function];
1139 if (::internal::CheckForZero<Number>::value(value) ==
true)
1144 const unsigned int comp = shape_function_data[shape_function]
1145 .single_nonzero_component_index;
1146 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1147 &shape_hessians[snc][0];
1148 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1150 laplacians[q_point][comp] +=
1151 value *
trace(*shape_hessian_ptr++);
1154 for (
unsigned int d = 0;
d < spacedim; ++
d)
1155 if (shape_function_data[shape_function]
1156 .is_nonzero_shape_function_component[d])
1158 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1159 &shape_hessians[shape_function_data[shape_function]
1161 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1163 laplacians[q_point][d] +=
1164 value *
trace(*shape_hessian_ptr++);
1173 template <
int dim,
int spacedim,
typename Number>
1177 const ::Table<2, double> &shape_values,
1180 &shape_function_data,
1186 const unsigned int dofs_per_cell = dof_values.
size();
1187 const unsigned int n_quadrature_points =
1188 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
1197 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1201 shape_function_data[shape_function].single_nonzero_component;
1207 const Number &value = dof_values[shape_function];
1211 if (::internal::CheckForZero<Number>::value(value) ==
true)
1218 shape_function_data[shape_function]
1219 .single_nonzero_component_index);
1220 const double *shape_value_ptr = &shape_values(snc, 0);
1221 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1223 values[q_point][comp] += value * (*shape_value_ptr++);
1226 for (
unsigned int d = 0;
1230 if (shape_function_data[shape_function]
1231 .is_nonzero_shape_function_component[d])
1236 const double *shape_value_ptr = &shape_values(
1237 shape_function_data[shape_function].row_index[d], 0);
1238 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1240 values[q_point][comp] += value * (*shape_value_ptr++);
1247 template <
int dim,
int spacedim,
typename Number>
1249 do_function_divergences(
1254 &shape_function_data,
1256 template OutputType<Number>::divergence_type> &divergences)
1258 const unsigned int dofs_per_cell = dof_values.
size();
1259 const unsigned int n_quadrature_points =
1260 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
1263 std::fill(divergences.begin(),
1266 Number>::divergence_type());
1268 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1272 shape_function_data[shape_function].single_nonzero_component;
1278 const Number &value = dof_values[shape_function];
1282 if (::internal::CheckForZero<Number>::value(value) ==
true)
1287 const unsigned int comp = shape_function_data[shape_function]
1288 .single_nonzero_component_index;
1290 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1291 &shape_gradients[snc][0];
1298 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1299 ++q_point, ++shape_gradient_ptr)
1301 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1304 divergences[q_point][jj] +=
1305 value * (*shape_gradient_ptr)[ii];
1310 for (
unsigned int d = 0;
1313 spacedim>::n_independent_components;
1315 if (shape_function_data[shape_function]
1316 .is_nonzero_shape_function_component[d])
1328 const unsigned int comp =
1329 shape_function_data[shape_function]
1330 .single_nonzero_component_index;
1332 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1333 &shape_gradients[shape_function_data[shape_function]
1335 for (
unsigned int q_point = 0;
1336 q_point < n_quadrature_points;
1337 ++q_point, ++shape_gradient_ptr)
1339 for (
unsigned int j = 0; j < spacedim; ++j)
1341 const unsigned int vector_component =
1345 divergences[q_point][vector_component] +=
1346 value * (*shape_gradient_ptr++)[j];
1356 template <
int dim,
int spacedim,
typename Number>
1360 const ::Table<2, double> &shape_values,
1362 &shape_function_data,
1367 const unsigned int dofs_per_cell = dof_values.
size();
1368 const unsigned int n_quadrature_points =
1369 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
1377 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1381 shape_function_data[shape_function].single_nonzero_component;
1387 const Number &value = dof_values[shape_function];
1391 if (::internal::CheckForZero<Number>::value(value) ==
true)
1396 const unsigned int comp = shape_function_data[shape_function]
1397 .single_nonzero_component_index;
1403 const double *shape_value_ptr = &shape_values(snc, 0);
1404 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1406 values[q_point][indices] += value * (*shape_value_ptr++);
1409 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1410 if (shape_function_data[shape_function]
1411 .is_nonzero_shape_function_component[d])
1417 const double *shape_value_ptr = &shape_values(
1418 shape_function_data[shape_function].row_index[d], 0);
1419 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1421 values[q_point][indices] += value * (*shape_value_ptr++);
1428 template <
int dim,
int spacedim,
typename Number>
1430 do_function_divergences(
1434 & shape_function_data,
1436 Number>::divergence_type> &divergences)
1438 const unsigned int dofs_per_cell = dof_values.
size();
1439 const unsigned int n_quadrature_points =
1440 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
1443 std::fill(divergences.begin(),
1446 Number>::divergence_type());
1448 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1452 shape_function_data[shape_function].single_nonzero_component;
1458 const Number &value = dof_values[shape_function];
1462 if (::internal::CheckForZero<Number>::value(value) ==
true)
1467 const unsigned int comp = shape_function_data[shape_function]
1468 .single_nonzero_component_index;
1470 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1471 &shape_gradients[snc][0];
1476 const unsigned int ii = indices[0];
1477 const unsigned int jj = indices[1];
1479 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1480 ++q_point, ++shape_gradient_ptr)
1482 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1487 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1488 if (shape_function_data[shape_function]
1489 .is_nonzero_shape_function_component[d])
1499 template <
int dim,
int spacedim,
typename Number>
1501 do_function_gradients(
1505 & shape_function_data,
1507 Number>::gradient_type> &gradients)
1509 const unsigned int dofs_per_cell = dof_values.
size();
1510 const unsigned int n_quadrature_points =
1511 dofs_per_cell > 0 ? shape_gradients[0].size() : gradients.size();
1514 std::fill(gradients.begin(),
1517 Number>::gradient_type());
1519 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1523 shape_function_data[shape_function].single_nonzero_component;
1529 const Number &value = dof_values[shape_function];
1533 if (::internal::CheckForZero<Number>::value(value) ==
true)
1538 const unsigned int comp = shape_function_data[shape_function]
1539 .single_nonzero_component_index;
1541 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1542 &shape_gradients[snc][0];
1547 const unsigned int ii = indices[0];
1548 const unsigned int jj = indices[1];
1550 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1551 ++q_point, ++shape_gradient_ptr)
1553 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1558 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1559 if (shape_function_data[shape_function]
1560 .is_nonzero_shape_function_component[d])
1572 template <
int dim,
int spacedim>
1573 template <
class InputVector>
1576 const InputVector &fe_function,
1578 typename ProductType<value_type, typename InputVector::value_type>::type>
1584 Assert(fe_values->present_cell.get() !=
nullptr,
1585 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1587 fe_values->present_cell->n_dofs_for_dof_handler());
1592 fe_values->dofs_per_cell);
1593 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1595 internal::do_function_values<dim, spacedim>(
1596 make_array_view(dof_values.begin(), dof_values.end()),
1597 fe_values->finite_element_output.shape_values,
1598 shape_function_data,
1604 template <
int dim,
int spacedim>
1605 template <
class InputVector>
1608 const InputVector &dof_values,
1616 Assert(fe_values->present_cell.get() !=
nullptr,
1617 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1620 internal::do_function_values<dim, spacedim>(
1621 make_array_view(dof_values.begin(), dof_values.end()),
1622 fe_values->finite_element_output.shape_values,
1623 shape_function_data,
1629 template <
int dim,
int spacedim>
1630 template <
class InputVector>
1633 const InputVector &fe_function,
1635 typename InputVector::value_type>::type>
1640 "update_gradients")));
1641 Assert(fe_values->present_cell.get() !=
nullptr,
1642 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1644 fe_values->present_cell->n_dofs_for_dof_handler());
1648 fe_values->dofs_per_cell);
1649 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1651 internal::do_function_derivatives<1, dim, spacedim>(
1652 make_array_view(dof_values.begin(), dof_values.end()),
1653 fe_values->finite_element_output.shape_gradients,
1654 shape_function_data,
1660 template <
int dim,
int spacedim>
1661 template <
class InputVector>
1664 const InputVector &dof_values,
1671 "update_gradients")));
1672 Assert(fe_values->present_cell.get() !=
nullptr,
1673 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1676 internal::do_function_derivatives<1, dim, spacedim>(
1677 make_array_view(dof_values.begin(), dof_values.end()),
1678 fe_values->finite_element_output.shape_gradients,
1679 shape_function_data,
1685 template <
int dim,
int spacedim>
1686 template <
class InputVector>
1689 const InputVector &fe_function,
1691 typename InputVector::value_type>::type>
1696 "update_hessians")));
1697 Assert(fe_values->present_cell.get() !=
nullptr,
1698 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1700 fe_values->present_cell->n_dofs_for_dof_handler());
1704 fe_values->dofs_per_cell);
1705 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1707 internal::do_function_derivatives<2, dim, spacedim>(
1708 make_array_view(dof_values.begin(), dof_values.end()),
1709 fe_values->finite_element_output.shape_hessians,
1710 shape_function_data,
1716 template <
int dim,
int spacedim>
1717 template <
class InputVector>
1720 const InputVector &dof_values,
1727 "update_hessians")));
1728 Assert(fe_values->present_cell.get() !=
nullptr,
1729 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1732 internal::do_function_derivatives<2, dim, spacedim>(
1733 make_array_view(dof_values.begin(), dof_values.end()),
1734 fe_values->finite_element_output.shape_hessians,
1735 shape_function_data,
1741 template <
int dim,
int spacedim>
1742 template <
class InputVector>
1745 const InputVector &fe_function,
1747 typename ProductType<value_type, typename InputVector::value_type>::type>
1752 "update_hessians")));
1753 Assert(fe_values->present_cell.get() !=
nullptr,
1754 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1756 fe_values->present_cell->n_dofs_for_dof_handler());
1760 fe_values->dofs_per_cell);
1761 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1763 internal::do_function_laplacians<dim, spacedim>(
1764 make_array_view(dof_values.begin(), dof_values.end()),
1765 fe_values->finite_element_output.shape_hessians,
1766 shape_function_data,
1772 template <
int dim,
int spacedim>
1773 template <
class InputVector>
1776 const InputVector &dof_values,
1783 "update_hessians")));
1784 Assert(fe_values->present_cell.get() !=
nullptr,
1785 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1788 internal::do_function_laplacians<dim, spacedim>(
1789 make_array_view(dof_values.begin(), dof_values.end()),
1790 fe_values->finite_element_output.shape_hessians,
1791 shape_function_data,
1797 template <
int dim,
int spacedim>
1798 template <
class InputVector>
1801 const InputVector &fe_function,
1803 typename InputVector::value_type>::type>
1804 &third_derivatives)
const 1808 "update_3rd_derivatives")));
1809 Assert(fe_values->present_cell.get() !=
nullptr,
1810 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1812 fe_values->present_cell->n_dofs_for_dof_handler());
1816 fe_values->dofs_per_cell);
1817 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1819 internal::do_function_derivatives<3, dim, spacedim>(
1820 make_array_view(dof_values.begin(), dof_values.end()),
1821 fe_values->finite_element_output.shape_3rd_derivatives,
1822 shape_function_data,
1828 template <
int dim,
int spacedim>
1829 template <
class InputVector>
1832 const InputVector & dof_values,
1838 "update_3rd_derivatives")));
1839 Assert(fe_values->present_cell.get() !=
nullptr,
1840 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1843 internal::do_function_derivatives<3, dim, spacedim>(
1844 make_array_view(dof_values.begin(), dof_values.end()),
1845 fe_values->finite_element_output.shape_3rd_derivatives,
1846 shape_function_data,
1852 template <
int dim,
int spacedim>
1853 template <
class InputVector>
1856 const InputVector &fe_function,
1858 typename ProductType<value_type, typename InputVector::value_type>::type>
1864 Assert(fe_values->present_cell.get() !=
nullptr,
1865 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1867 fe_values->present_cell->n_dofs_for_dof_handler());
1871 fe_values->dofs_per_cell);
1872 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1874 internal::do_function_values<dim, spacedim>(
1875 make_array_view(dof_values.begin(), dof_values.end()),
1876 fe_values->finite_element_output.shape_values,
1877 shape_function_data,
1883 template <
int dim,
int spacedim>
1884 template <
class InputVector>
1887 const InputVector &dof_values,
1895 Assert(fe_values->present_cell.get() !=
nullptr,
1896 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1899 internal::do_function_values<dim, spacedim>(
1900 make_array_view(dof_values.begin(), dof_values.end()),
1901 fe_values->finite_element_output.shape_values,
1902 shape_function_data,
1908 template <
int dim,
int spacedim>
1909 template <
class InputVector>
1912 const InputVector &fe_function,
1914 typename InputVector::value_type>::type>
1919 "update_gradients")));
1920 Assert(fe_values->present_cell.get() !=
nullptr,
1921 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1923 fe_values->present_cell->n_dofs_for_dof_handler());
1927 fe_values->dofs_per_cell);
1928 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1930 internal::do_function_derivatives<1, dim, spacedim>(
1931 make_array_view(dof_values.begin(), dof_values.end()),
1932 fe_values->finite_element_output.shape_gradients,
1933 shape_function_data,
1939 template <
int dim,
int spacedim>
1940 template <
class InputVector>
1943 const InputVector &dof_values,
1950 "update_gradients")));
1951 Assert(fe_values->present_cell.get() !=
nullptr,
1952 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1955 internal::do_function_derivatives<1, dim, spacedim>(
1956 make_array_view(dof_values.begin(), dof_values.end()),
1957 fe_values->finite_element_output.shape_gradients,
1958 shape_function_data,
1964 template <
int dim,
int spacedim>
1965 template <
class InputVector>
1968 const InputVector &fe_function,
1970 typename InputVector::value_type>::type>
1971 &symmetric_gradients)
const 1975 "update_gradients")));
1976 Assert(fe_values->present_cell.get() !=
nullptr,
1977 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1979 fe_values->present_cell->n_dofs_for_dof_handler());
1983 fe_values->dofs_per_cell);
1984 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1986 internal::do_function_symmetric_gradients<dim, spacedim>(
1987 make_array_view(dof_values.begin(), dof_values.end()),
1988 fe_values->finite_element_output.shape_gradients,
1989 shape_function_data,
1990 symmetric_gradients);
1995 template <
int dim,
int spacedim>
1996 template <
class InputVector>
1999 const InputVector & dof_values,
2005 "update_gradients")));
2006 Assert(fe_values->present_cell.get() !=
nullptr,
2007 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2010 internal::do_function_symmetric_gradients<dim, spacedim>(
2011 make_array_view(dof_values.begin(), dof_values.end()),
2012 fe_values->finite_element_output.shape_gradients,
2013 shape_function_data,
2014 symmetric_gradients);
2019 template <
int dim,
int spacedim>
2020 template <
class InputVector>
2023 const InputVector &fe_function,
2025 typename InputVector::value_type>::type>
2030 "update_gradients")));
2031 Assert(fe_values->present_cell.get() !=
nullptr,
2032 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2034 fe_values->present_cell->n_dofs_for_dof_handler());
2039 fe_values->dofs_per_cell);
2040 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2042 internal::do_function_divergences<dim, spacedim>(
2043 make_array_view(dof_values.begin(), dof_values.end()),
2044 fe_values->finite_element_output.shape_gradients,
2045 shape_function_data,
2051 template <
int dim,
int spacedim>
2052 template <
class InputVector>
2055 const InputVector &dof_values,
2062 "update_gradients")));
2063 Assert(fe_values->present_cell.get() !=
nullptr,
2064 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2067 internal::do_function_divergences<dim, spacedim>(
2068 make_array_view(dof_values.begin(), dof_values.end()),
2069 fe_values->finite_element_output.shape_gradients,
2070 shape_function_data,
2076 template <
int dim,
int spacedim>
2077 template <
class InputVector>
2080 const InputVector &fe_function,
2082 typename ProductType<curl_type, typename InputVector::value_type>::type>
2087 "update_gradients")));
2088 Assert(fe_values->present_cell.get() !=
nullptr,
2089 ExcMessage(
"FEValues object is not reinited to any cell"));
2091 fe_values->present_cell->n_dofs_for_dof_handler());
2095 fe_values->dofs_per_cell);
2096 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2098 internal::do_function_curls<dim, spacedim>(
2099 make_array_view(dof_values.begin(), dof_values.end()),
2100 fe_values->finite_element_output.shape_gradients,
2101 shape_function_data,
2107 template <
int dim,
int spacedim>
2108 template <
class InputVector>
2111 const InputVector &dof_values,
2118 "update_gradients")));
2119 Assert(fe_values->present_cell.get() !=
nullptr,
2120 ExcMessage(
"FEValues object is not reinited to any cell"));
2123 internal::do_function_curls<dim, spacedim>(
2124 make_array_view(dof_values.begin(), dof_values.end()),
2125 fe_values->finite_element_output.shape_gradients,
2126 shape_function_data,
2132 template <
int dim,
int spacedim>
2133 template <
class InputVector>
2136 const InputVector &fe_function,
2138 typename InputVector::value_type>::type>
2143 "update_hessians")));
2144 Assert(fe_values->present_cell.get() !=
nullptr,
2145 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2147 fe_values->present_cell->n_dofs_for_dof_handler());
2151 fe_values->dofs_per_cell);
2152 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2154 internal::do_function_derivatives<2, dim, spacedim>(
2155 make_array_view(dof_values.begin(), dof_values.end()),
2156 fe_values->finite_element_output.shape_hessians,
2157 shape_function_data,
2163 template <
int dim,
int spacedim>
2164 template <
class InputVector>
2167 const InputVector &dof_values,
2174 "update_hessians")));
2175 Assert(fe_values->present_cell.get() !=
nullptr,
2176 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2179 internal::do_function_derivatives<2, dim, spacedim>(
2180 make_array_view(dof_values.begin(), dof_values.end()),
2181 fe_values->finite_element_output.shape_hessians,
2182 shape_function_data,
2188 template <
int dim,
int spacedim>
2189 template <
class InputVector>
2192 const InputVector &fe_function,
2194 typename ProductType<value_type, typename InputVector::value_type>::type>
2199 "update_hessians")));
2200 Assert(laplacians.size() == fe_values->n_quadrature_points,
2202 fe_values->n_quadrature_points));
2203 Assert(fe_values->present_cell.get() !=
nullptr,
2204 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2206 fe_function.size() == fe_values->present_cell->n_dofs_for_dof_handler(),
2208 fe_values->present_cell->n_dofs_for_dof_handler()));
2212 fe_values->dofs_per_cell);
2213 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2215 internal::do_function_laplacians<dim, spacedim>(
2216 make_array_view(dof_values.begin(), dof_values.end()),
2217 fe_values->finite_element_output.shape_hessians,
2218 shape_function_data,
2224 template <
int dim,
int spacedim>
2225 template <
class InputVector>
2228 const InputVector &dof_values,
2235 "update_hessians")));
2236 Assert(laplacians.size() == fe_values->n_quadrature_points,
2238 fe_values->n_quadrature_points));
2239 Assert(fe_values->present_cell.get() !=
nullptr,
2240 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2243 internal::do_function_laplacians<dim, spacedim>(
2244 make_array_view(dof_values.begin(), dof_values.end()),
2245 fe_values->finite_element_output.shape_hessians,
2246 shape_function_data,
2252 template <
int dim,
int spacedim>
2253 template <
class InputVector>
2256 const InputVector &fe_function,
2258 typename InputVector::value_type>::type>
2259 &third_derivatives)
const 2263 "update_3rd_derivatives")));
2264 Assert(fe_values->present_cell.get() !=
nullptr,
2265 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2267 fe_values->present_cell->n_dofs_for_dof_handler());
2271 fe_values->dofs_per_cell);
2272 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2274 internal::do_function_derivatives<3, dim, spacedim>(
2275 make_array_view(dof_values.begin(), dof_values.end()),
2276 fe_values->finite_element_output.shape_3rd_derivatives,
2277 shape_function_data,
2283 template <
int dim,
int spacedim>
2284 template <
class InputVector>
2287 const InputVector & dof_values,
2293 "update_3rd_derivatives")));
2294 Assert(fe_values->present_cell.get() !=
nullptr,
2295 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2298 internal::do_function_derivatives<3, dim, spacedim>(
2299 make_array_view(dof_values.begin(), dof_values.end()),
2300 fe_values->finite_element_output.shape_3rd_derivatives,
2301 shape_function_data,
2307 template <
int dim,
int spacedim>
2308 template <
class InputVector>
2311 const InputVector &fe_function,
2313 typename ProductType<value_type, typename InputVector::value_type>::type>
2319 Assert(fe_values->present_cell.get() !=
nullptr,
2320 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2322 fe_values->present_cell->n_dofs_for_dof_handler());
2326 fe_values->dofs_per_cell);
2327 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2329 internal::do_function_values<dim, spacedim>(
2330 make_array_view(dof_values.begin(), dof_values.end()),
2331 fe_values->finite_element_output.shape_values,
2332 shape_function_data,
2338 template <
int dim,
int spacedim>
2339 template <
class InputVector>
2342 const InputVector &dof_values,
2350 Assert(fe_values->present_cell.get() !=
nullptr,
2351 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2354 internal::do_function_values<dim, spacedim>(
2355 make_array_view(dof_values.begin(), dof_values.end()),
2356 fe_values->finite_element_output.shape_values,
2357 shape_function_data,
2363 template <
int dim,
int spacedim>
2364 template <
class InputVector>
2367 const InputVector &fe_function,
2369 typename InputVector::value_type>::type>
2374 "update_gradients")));
2375 Assert(fe_values->present_cell.get() !=
nullptr,
2376 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2378 fe_values->present_cell->n_dofs_for_dof_handler());
2383 fe_values->dofs_per_cell);
2384 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2386 internal::do_function_divergences<dim, spacedim>(
2387 make_array_view(dof_values.begin(), dof_values.end()),
2388 fe_values->finite_element_output.shape_gradients,
2389 shape_function_data,
2395 template <
int dim,
int spacedim>
2396 template <
class InputVector>
2398 SymmetricTensor<2, dim, spacedim>::
2399 get_function_divergences_from_local_dof_values(
2400 const InputVector &dof_values,
2407 "update_gradients")));
2408 Assert(fe_values->present_cell.get() !=
nullptr,
2409 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2412 internal::do_function_divergences<dim, spacedim>(
2413 make_array_view(dof_values.begin(), dof_values.end()),
2414 fe_values->finite_element_output.shape_gradients,
2415 shape_function_data,
2421 template <
int dim,
int spacedim>
2422 template <
class InputVector>
2425 const InputVector &fe_function,
2427 typename ProductType<value_type, typename InputVector::value_type>::type>
2433 Assert(fe_values->present_cell.get() !=
nullptr,
2434 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2436 fe_values->present_cell->n_dofs_for_dof_handler());
2440 fe_values->dofs_per_cell);
2441 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2443 internal::do_function_values<dim, spacedim>(
2444 make_array_view(dof_values.begin(), dof_values.end()),
2445 fe_values->finite_element_output.shape_values,
2446 shape_function_data,
2452 template <
int dim,
int spacedim>
2453 template <
class InputVector>
2456 const InputVector &dof_values,
2464 Assert(fe_values->present_cell.get() !=
nullptr,
2465 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2468 internal::do_function_values<dim, spacedim>(
2469 make_array_view(dof_values.begin(), dof_values.end()),
2470 fe_values->finite_element_output.shape_values,
2471 shape_function_data,
2477 template <
int dim,
int spacedim>
2478 template <
class InputVector>
2481 const InputVector &fe_function,
2483 typename InputVector::value_type>::type>
2488 "update_gradients")));
2489 Assert(fe_values->present_cell.get() !=
nullptr,
2490 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2492 fe_values->present_cell->n_dofs_for_dof_handler());
2497 fe_values->dofs_per_cell);
2498 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2500 internal::do_function_divergences<dim, spacedim>(
2501 make_array_view(dof_values.begin(), dof_values.end()),
2502 fe_values->finite_element_output.shape_gradients,
2503 shape_function_data,
2509 template <
int dim,
int spacedim>
2510 template <
class InputVector>
2513 const InputVector &dof_values,
2520 "update_gradients")));
2521 Assert(fe_values->present_cell.get() !=
nullptr,
2522 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2525 internal::do_function_divergences<dim, spacedim>(
2526 make_array_view(dof_values.begin(), dof_values.end()),
2527 fe_values->finite_element_output.shape_gradients,
2528 shape_function_data,
2534 template <
int dim,
int spacedim>
2535 template <
class InputVector>
2538 const InputVector &fe_function,
2540 typename InputVector::value_type>::type>
2545 "update_gradients")));
2546 Assert(fe_values->present_cell.get() !=
nullptr,
2547 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2549 fe_values->present_cell->n_dofs_for_dof_handler());
2554 fe_values->dofs_per_cell);
2555 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2557 internal::do_function_gradients<dim, spacedim>(
2558 make_array_view(dof_values.begin(), dof_values.end()),
2559 fe_values->finite_element_output.shape_gradients,
2560 shape_function_data,
2566 template <
int dim,
int spacedim>
2567 template <
class InputVector>
2570 const InputVector &dof_values,
2577 "update_gradients")));
2578 Assert(fe_values->present_cell.get() !=
nullptr,
2579 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2582 internal::do_function_gradients<dim, spacedim>(
2583 make_array_view(dof_values.begin(), dof_values.end()),
2584 fe_values->finite_element_output.shape_gradients,
2585 shape_function_data,
2596 template <
int dim,
int spacedim>
2602 scalars.reserve(n_scalars);
2603 for (
unsigned int component = 0; component < n_scalars; ++component)
2604 scalars.emplace_back(fe_values, component);
2609 const unsigned int n_vectors =
2611 vectors.reserve(n_vectors);
2612 for (
unsigned int component = 0; component < n_vectors; ++component)
2613 vectors.emplace_back(fe_values, component);
2616 const unsigned int n_symmetric_second_order_tensors =
2620 symmetric_second_order_tensors.reserve(n_symmetric_second_order_tensors);
2621 for (
unsigned int component = 0;
2622 component < n_symmetric_second_order_tensors;
2624 symmetric_second_order_tensors.emplace_back(fe_values, component);
2628 const unsigned int n_second_order_tensors =
2631 second_order_tensors.reserve(n_second_order_tensors);
2632 for (
unsigned int component = 0; component < n_second_order_tensors;
2634 second_order_tensors.emplace_back(fe_values, component);
2642 template <
int dim,
int spacedim>
2650 virtual ~CellIteratorBase() =
default;
2666 n_dofs_for_dof_handler()
const = 0;
2668 #include "fe_values.decl.1.inst" 2675 get_interpolated_dof_values(
const IndexSet & in,
2676 Vector<IndexSet::value_type> &out)
const = 0;
2688 template <
int dim,
int spacedim>
2689 template <
typename CI>
2697 CellIterator(
const CI &cell);
2713 n_dofs_for_dof_handler()
const override;
2715 #include "fe_values.decl.2.inst" 2722 get_interpolated_dof_values(
const IndexSet & in,
2723 Vector<IndexSet::value_type> &out)
const override;
2753 template <
int dim,
int spacedim>
2779 n_dofs_for_dof_handler()
const override;
2781 #include "fe_values.decl.2.inst" 2788 get_interpolated_dof_values(
const IndexSet & in,
2789 Vector<IndexSet::value_type> &out)
const override;
2810 template <
int dim,
int spacedim>
2811 template <
typename CI>
2818 template <
int dim,
int spacedim>
2819 template <
typename CI>
2828 template <
int dim,
int spacedim>
2829 template <
typename CI>
2833 return cell->get_dof_handler().n_dofs();
2838 #include "fe_values.impl.1.inst" 2842 template <
int dim,
int spacedim>
2843 template <
typename CI>
2847 Vector<IndexSet::value_type> &out)
const 2851 std::vector<types::global_dof_index> dof_indices(
2852 cell->get_fe().dofs_per_cell);
2853 cell->get_dof_indices(dof_indices);
2855 for (
unsigned int i = 0; i < cell->get_fe().dofs_per_cell; ++i)
2856 out[i] = (in.
is_element(dof_indices[i]) ? 1 : 0);
2862 template <
int dim,
int spacedim>
2864 spacedim>::TriaCellIterator::message_string =
2865 (
"You have previously called the FEValues::reinit function with a\n" 2866 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However,\n" 2867 "when you do this, you cannot call some functions in the FEValues\n" 2868 "class, such as the get_function_values/gradients/hessians/third_derivatives\n" 2869 "functions. If you need these functions, then you need to call\n" 2870 "FEValues::reinit with an iterator type that allows to extract\n" 2871 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
2875 template <
int dim,
int spacedim>
2883 template <
int dim,
int spacedim>
2892 template <
int dim,
int spacedim>
2902 #include "fe_values.impl.2.inst" 2906 template <
int dim,
int spacedim>
2910 Vector<IndexSet::value_type> &)
const 2919 namespace FEValuesImplementation
2921 template <
int dim,
int spacedim>
2928 this->quadrature_points.resize(
2934 numbers::signaling_nan<double>());
2937 this->jacobians.resize(
2942 this->jacobian_grads.resize(
2947 this->jacobian_pushed_forward_grads.resize(
2951 this->jacobian_2nd_derivatives.resize(
2956 this->jacobian_pushed_forward_2nd_derivatives.resize(
2963 this->jacobian_pushed_forward_3rd_derivatives.resize(
2967 this->inverse_jacobians.resize(
2972 this->boundary_forms.resize(
2976 this->normal_vectors.resize(
2982 template <
int dim,
int spacedim>
2993 jacobian_pushed_forward_2nd_derivatives) +
2996 jacobian_pushed_forward_3rd_derivatives) +
3005 template <
int dim,
int spacedim>
3015 this->shape_function_to_row_table =
3016 ::internal::make_shape_function_to_row_table(
fe);
3020 unsigned int n_nonzero_shape_components = 0;
3021 for (
unsigned int i = 0; i <
fe.dofs_per_cell; ++i)
3022 n_nonzero_shape_components +=
fe.n_nonzero_components(i);
3023 Assert(n_nonzero_shape_components >=
fe.dofs_per_cell,
3030 this->shape_values.reinit(n_nonzero_shape_components,
3032 this->shape_values.fill(numbers::signaling_nan<double>());
3037 this->shape_gradients.reinit(n_nonzero_shape_components,
3039 this->shape_gradients.fill(
3045 this->shape_hessians.reinit(n_nonzero_shape_components,
3047 this->shape_hessians.fill(
3053 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
3055 this->shape_3rd_derivatives.fill(
3062 template <
int dim,
int spacedim>
3081 template <
int dim,
int spacedim>
3083 const unsigned int n_q_points,
3091 ,
fe(&
fe, typeid(*this).name())
3096 ExcMessage(
"There is nothing useful you can do with an FEValues " 3097 "object when using a quadrature formula with zero " 3098 "quadrature points!"));
3104 template <
int dim,
int spacedim>
3107 tria_listener_refinement.disconnect();
3108 tria_listener_mesh_transform.disconnect();
3122 template <
typename Number,
typename Number2>
3124 do_function_values(
const Number2 * dof_values_ptr,
3125 const ::Table<2, double> &shape_values,
3126 std::vector<Number> & values)
3129 const unsigned int dofs_per_cell = shape_values.n_rows();
3130 const unsigned int n_quadrature_points =
3131 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
3135 std::fill_n(values.begin(),
3136 n_quadrature_points,
3146 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3148 const Number2 value = dof_values_ptr[shape_func];
3156 const double *shape_value_ptr = &shape_values(shape_func, 0);
3157 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
3158 values[point] += value * (*shape_value_ptr++);
3164 template <
int dim,
int spacedim,
typename VectorType>
3167 const typename VectorType::value_type *dof_values_ptr,
3168 const ::Table<2, double> & shape_values,
3170 const std::vector<unsigned int> & shape_function_to_row_table,
3172 const bool quadrature_points_fastest =
false,
3173 const unsigned int component_multiple = 1)
3175 using Number =
typename VectorType::value_type;
3177 for (
unsigned int i = 0; i < values.
size(); ++i)
3178 std::fill_n(values[i].begin(),
3180 typename VectorType::value_type());
3185 if (dofs_per_cell == 0)
3188 const unsigned int n_quadrature_points = shape_values.n_cols();
3192 const unsigned result_components =
n_components * component_multiple;
3193 (void)result_components;
3194 if (quadrature_points_fastest)
3197 for (
unsigned int i = 0; i < values.
size(); ++i)
3203 for (
unsigned int i = 0; i < values.
size(); ++i)
3210 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3211 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3214 const Number &value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3218 if (::internal::CheckForZero<Number>::value(value) ==
true)
3223 const unsigned int comp =
3226 const unsigned int row =
3227 shape_function_to_row_table[shape_func *
n_components + comp];
3229 const double *shape_value_ptr = &shape_values(row, 0);
3231 if (quadrature_points_fastest)
3233 VectorType &values_comp = values[comp];
3234 for (
unsigned int point = 0;
point < n_quadrature_points;
3236 values_comp[point] += value * (*shape_value_ptr++);
3239 for (
unsigned int point = 0;
point < n_quadrature_points;
3241 values[point][comp] += value * (*shape_value_ptr++);
3249 const unsigned int row =
3250 shape_function_to_row_table[shape_func *
n_components + c];
3252 const double * shape_value_ptr = &shape_values(row, 0);
3255 if (quadrature_points_fastest)
3257 VectorType &values_comp = values[comp];
3258 for (
unsigned int point = 0;
point < n_quadrature_points;
3260 values_comp[point] += value * (*shape_value_ptr++);
3263 for (
unsigned int point = 0;
point < n_quadrature_points;
3265 values[point][comp] += value * (*shape_value_ptr++);
3274 template <
int order,
int spacedim,
typename Number>
3276 do_function_derivatives(
3277 const Number * dof_values_ptr,
3281 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
3282 const unsigned int n_quadrature_points =
3283 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
3287 std::fill_n(derivatives.begin(),
3288 n_quadrature_points,
3298 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3300 const Number &value = dof_values_ptr[shape_func];
3304 if (::internal::CheckForZero<Number>::value(value) ==
true)
3308 &shape_derivatives[shape_func][0];
3309 for (
unsigned int point = 0;
point < n_quadrature_points; ++
point)
3310 derivatives[point] += value * (*shape_derivative_ptr++);
3316 template <
int order,
int dim,
int spacedim,
typename Number>
3318 do_function_derivatives(
3319 const Number * dof_values_ptr,
3322 const std::vector<unsigned int> &shape_function_to_row_table,
3324 const bool quadrature_points_fastest =
false,
3325 const unsigned int component_multiple = 1)
3328 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3329 std::fill_n(derivatives[i].begin(),
3330 derivatives[i].size(),
3336 if (dofs_per_cell == 0)
3340 const unsigned int n_quadrature_points = shape_derivatives[0].size();
3344 const unsigned result_components =
n_components * component_multiple;
3345 (void)result_components;
3346 if (quadrature_points_fastest)
3349 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3355 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3362 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3363 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3366 const Number &value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3370 if (::internal::CheckForZero<Number>::value(value) ==
true)
3375 const unsigned int comp =
3378 const unsigned int row =
3379 shape_function_to_row_table[shape_func *
n_components + comp];
3382 &shape_derivatives[row][0];
3384 if (quadrature_points_fastest)
3385 for (
unsigned int point = 0;
point < n_quadrature_points;
3387 derivatives[comp][point] += value * (*shape_derivative_ptr++);
3389 for (
unsigned int point = 0;
point < n_quadrature_points;
3391 derivatives[point][comp] += value * (*shape_derivative_ptr++);
3399 const unsigned int row =
3400 shape_function_to_row_table[shape_func *
n_components + c];
3403 &shape_derivatives[row][0];
3406 if (quadrature_points_fastest)
3407 for (
unsigned int point = 0;
point < n_quadrature_points;
3409 derivatives[comp][point] +=
3410 value * (*shape_derivative_ptr++);
3412 for (
unsigned int point = 0;
point < n_quadrature_points;
3414 derivatives[point][comp] +=
3415 value * (*shape_derivative_ptr++);
3422 template <
int spacedim,
typename Number,
typename Number2>
3424 do_function_laplacians(
3425 const Number2 * dof_values_ptr,
3427 std::vector<Number> & laplacians)
3429 const unsigned int dofs_per_cell = shape_hessians.size()[0];
3430 const unsigned int n_quadrature_points =
3431 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
3435 std::fill_n(laplacians.begin(),
3436 n_quadrature_points,
3442 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3444 const Number2 value = dof_values_ptr[shape_func];
3453 &shape_hessians[shape_func][0];
3454 for (
unsigned int point = 0;
point < n_quadrature_points; ++
point)
3455 laplacians[point] += value *
trace(*shape_hessian_ptr++);
3461 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3463 do_function_laplacians(
3464 const Number * dof_values_ptr,
3467 const std::vector<unsigned int> & shape_function_to_row_table,
3468 std::vector<VectorType> & laplacians,
3469 const bool quadrature_points_fastest =
false,
3470 const unsigned int component_multiple = 1)
3473 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3474 std::fill_n(laplacians[i].begin(),
3475 laplacians[i].size(),
3476 typename VectorType::value_type());
3481 if (dofs_per_cell == 0)
3485 const unsigned int n_quadrature_points = shape_hessians[0].size();
3489 const unsigned result_components =
n_components * component_multiple;
3490 (void)result_components;
3491 if (quadrature_points_fastest)
3494 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3500 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3507 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3508 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3511 const Number &value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3515 if (::internal::CheckForZero<Number>::value(value) ==
true)
3520 const unsigned int comp =
3523 const unsigned int row =
3524 shape_function_to_row_table[shape_func *
n_components + comp];
3527 &shape_hessians[row][0];
3528 if (quadrature_points_fastest)
3530 VectorType &laplacians_comp = laplacians[comp];
3531 for (
unsigned int point = 0;
point < n_quadrature_points;
3533 laplacians_comp[point] +=
3534 value *
trace(*shape_hessian_ptr++);
3537 for (
unsigned int point = 0;
point < n_quadrature_points;
3539 laplacians[point][comp] +=
3540 value *
trace(*shape_hessian_ptr++);
3548 const unsigned int row =
3549 shape_function_to_row_table[shape_func *
n_components + c];
3552 &shape_hessians[row][0];
3555 if (quadrature_points_fastest)
3557 VectorType &laplacians_comp = laplacians[comp];
3558 for (
unsigned int point = 0;
point < n_quadrature_points;
3560 laplacians_comp[point] +=
3561 value *
trace(*shape_hessian_ptr++);
3564 for (
unsigned int point = 0;
point < n_quadrature_points;
3566 laplacians[point][comp] +=
3567 value *
trace(*shape_hessian_ptr++);
3575 template <
int dim,
int spacedim>
3576 template <
class InputVector>
3579 const InputVector & fe_function,
3580 std::vector<typename InputVector::value_type> &values)
const 3582 using Number =
typename InputVector::value_type;
3586 Assert(present_cell.get() !=
nullptr,
3587 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3588 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3591 Vector<Number> dof_values(dofs_per_cell);
3592 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3593 internal::do_function_values(dof_values.begin(),
3594 this->finite_element_output.shape_values,
3600 template <
int dim,
int spacedim>
3601 template <
class InputVector>
3604 const InputVector & fe_function,
3606 std::vector<typename InputVector::value_type> & values)
const 3608 using Number =
typename InputVector::value_type;
3614 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3615 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3616 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3617 internal::do_function_values(dof_values.data(),
3618 this->finite_element_output.shape_values,
3624 template <
int dim,
int spacedim>
3625 template <
class InputVector>
3628 const InputVector & fe_function,
3629 std::vector<Vector<typename InputVector::value_type>> &values)
const 3631 using Number =
typename InputVector::value_type;
3632 Assert(present_cell.get() !=
nullptr,
3633 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3637 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3640 Vector<Number> dof_values(dofs_per_cell);
3641 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3642 internal::do_function_values(
3644 this->finite_element_output.shape_values,
3646 this->finite_element_output.shape_function_to_row_table,
3652 template <
int dim,
int spacedim>
3653 template <
class InputVector>
3656 const InputVector & fe_function,
3658 std::vector<Vector<typename InputVector::value_type>> &values)
const 3660 using Number =
typename InputVector::value_type;
3668 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3669 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3670 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3671 internal::do_function_values(
3673 this->finite_element_output.shape_values,
3675 this->finite_element_output.shape_function_to_row_table,
3678 indices.
size() / dofs_per_cell);
3683 template <
int dim,
int spacedim>
3684 template <
class InputVector>
3687 const InputVector & fe_function,
3689 ArrayView<std::vector<typename InputVector::value_type>> values,
3690 bool quadrature_points_fastest)
const 3692 using Number =
typename InputVector::value_type;
3701 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3702 for (
unsigned int i = 0; i < indices.
size(); ++i)
3703 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3704 internal::do_function_values(
3706 this->finite_element_output.shape_values,
3708 this->finite_element_output.shape_function_to_row_table,
3710 quadrature_points_fastest,
3711 indices.
size() / dofs_per_cell);
3716 template <
int dim,
int spacedim>
3717 template <
class InputVector>
3720 const InputVector &fe_function,
3724 using Number =
typename InputVector::value_type;
3728 Assert(present_cell.get() !=
nullptr,
3729 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3730 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3733 Vector<Number> dof_values(dofs_per_cell);
3734 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3735 internal::do_function_derivatives(dof_values.begin(),
3736 this->finite_element_output.shape_gradients,
3742 template <
int dim,
int spacedim>
3743 template <
class InputVector>
3746 const InputVector & fe_function,
3751 using Number =
typename InputVector::value_type;
3757 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3758 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3759 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3760 internal::do_function_derivatives(dof_values.data(),
3761 this->finite_element_output.shape_gradients,
3767 template <
int dim,
int spacedim>
3768 template <
class InputVector>
3771 const InputVector &fe_function,
3776 using Number =
typename InputVector::value_type;
3779 Assert(present_cell.get() !=
nullptr,
3780 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3781 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3784 Vector<Number> dof_values(dofs_per_cell);
3785 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3786 internal::do_function_derivatives(
3788 this->finite_element_output.shape_gradients,
3790 this->finite_element_output.shape_function_to_row_table,
3796 template <
int dim,
int spacedim>
3797 template <
class InputVector>
3800 const InputVector & fe_function,
3804 bool quadrature_points_fastest)
const 3806 using Number =
typename InputVector::value_type;
3814 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3815 for (
unsigned int i = 0; i < indices.
size(); ++i)
3816 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3817 internal::do_function_derivatives(
3819 this->finite_element_output.shape_gradients,
3821 this->finite_element_output.shape_function_to_row_table,
3823 quadrature_points_fastest,
3824 indices.
size() / dofs_per_cell);
3829 template <
int dim,
int spacedim>
3830 template <
class InputVector>
3833 const InputVector &fe_function,
3837 using Number =
typename InputVector::value_type;
3841 Assert(present_cell.get() !=
nullptr,
3842 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3843 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3846 Vector<Number> dof_values(dofs_per_cell);
3847 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3848 internal::do_function_derivatives(dof_values.begin(),
3849 this->finite_element_output.shape_hessians,
3855 template <
int dim,
int spacedim>
3856 template <
class InputVector>
3859 const InputVector & fe_function,
3864 using Number =
typename InputVector::value_type;
3867 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3870 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3871 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3872 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3873 internal::do_function_derivatives(dof_values.data(),
3874 this->finite_element_output.shape_hessians,
3880 template <
int dim,
int spacedim>
3881 template <
class InputVector>
3884 const InputVector &fe_function,
3888 bool quadrature_points_fastest)
const 3890 using Number =
typename InputVector::value_type;
3893 Assert(present_cell.get() !=
nullptr,
3894 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3895 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3898 Vector<Number> dof_values(dofs_per_cell);
3899 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3900 internal::do_function_derivatives(
3902 this->finite_element_output.shape_hessians,
3904 this->finite_element_output.shape_function_to_row_table,
3906 quadrature_points_fastest);
3911 template <
int dim,
int spacedim>
3912 template <
class InputVector>
3915 const InputVector & fe_function,
3919 bool quadrature_points_fastest)
const 3921 using Number =
typename InputVector::value_type;
3927 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3928 for (
unsigned int i = 0; i < indices.
size(); ++i)
3929 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3930 internal::do_function_derivatives(
3932 this->finite_element_output.shape_hessians,
3934 this->finite_element_output.shape_function_to_row_table,
3936 quadrature_points_fastest,
3937 indices.
size() / dofs_per_cell);
3942 template <
int dim,
int spacedim>
3943 template <
class InputVector>
3946 const InputVector & fe_function,
3947 std::vector<typename InputVector::value_type> &laplacians)
const 3949 using Number =
typename InputVector::value_type;
3953 Assert(present_cell.get() !=
nullptr,
3954 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3955 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3958 Vector<Number> dof_values(dofs_per_cell);
3959 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3960 internal::do_function_laplacians(dof_values.begin(),
3961 this->finite_element_output.shape_hessians,
3967 template <
int dim,
int spacedim>
3968 template <
class InputVector>
3971 const InputVector & fe_function,
3973 std::vector<typename InputVector::value_type> & laplacians)
const 3975 using Number =
typename InputVector::value_type;
3981 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3982 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3983 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
3984 internal::do_function_laplacians(dof_values.data(),
3985 this->finite_element_output.shape_hessians,
3991 template <
int dim,
int spacedim>
3992 template <
class InputVector>
3995 const InputVector & fe_function,
3996 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const 3998 using Number =
typename InputVector::value_type;
3999 Assert(present_cell.get() !=
nullptr,
4000 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4003 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4006 Vector<Number> dof_values(dofs_per_cell);
4007 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4008 internal::do_function_laplacians(
4010 this->finite_element_output.shape_hessians,
4012 this->finite_element_output.shape_function_to_row_table,
4018 template <
int dim,
int spacedim>
4019 template <
class InputVector>
4022 const InputVector & fe_function,
4024 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const 4026 using Number =
typename InputVector::value_type;
4034 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4035 for (
unsigned int i = 0; i < indices.
size(); ++i)
4036 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
4037 internal::do_function_laplacians(
4039 this->finite_element_output.shape_hessians,
4041 this->finite_element_output.shape_function_to_row_table,
4044 indices.
size() / dofs_per_cell);
4049 template <
int dim,
int spacedim>
4050 template <
class InputVector>
4053 const InputVector & fe_function,
4055 std::vector<std::vector<typename InputVector::value_type>> &laplacians,
4056 bool quadrature_points_fastest)
const 4058 using Number =
typename InputVector::value_type;
4064 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4065 for (
unsigned int i = 0; i < indices.
size(); ++i)
4066 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
4067 internal::do_function_laplacians(
4069 this->finite_element_output.shape_hessians,
4071 this->finite_element_output.shape_function_to_row_table,
4073 quadrature_points_fastest,
4074 indices.
size() / dofs_per_cell);
4079 template <
int dim,
int spacedim>
4080 template <
class InputVector>
4083 const InputVector &fe_function,
4085 &third_derivatives)
const 4087 using Number =
typename InputVector::value_type;
4091 Assert(present_cell.get() !=
nullptr,
4092 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4093 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4096 Vector<Number> dof_values(dofs_per_cell);
4097 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4098 internal::do_function_derivatives(
4100 this->finite_element_output.shape_3rd_derivatives,
4106 template <
int dim,
int spacedim>
4107 template <
class InputVector>
4110 const InputVector & fe_function,
4113 &third_derivatives)
const 4115 using Number =
typename InputVector::value_type;
4118 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4121 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
4122 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
4123 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
4124 internal::do_function_derivatives(
4126 this->finite_element_output.shape_3rd_derivatives,
4132 template <
int dim,
int spacedim>
4133 template <
class InputVector>
4136 const InputVector &fe_function,
4139 & third_derivatives,
4140 bool quadrature_points_fastest)
const 4142 using Number =
typename InputVector::value_type;
4145 Assert(present_cell.get() !=
nullptr,
4146 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4147 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4150 Vector<Number> dof_values(dofs_per_cell);
4151 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4152 internal::do_function_derivatives(
4154 this->finite_element_output.shape_3rd_derivatives,
4156 this->finite_element_output.shape_function_to_row_table,
4158 quadrature_points_fastest);
4163 template <
int dim,
int spacedim>
4164 template <
class InputVector>
4167 const InputVector & fe_function,
4171 bool quadrature_points_fastest)
const 4173 using Number =
typename InputVector::value_type;
4179 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4180 for (
unsigned int i = 0; i < indices.
size(); ++i)
4181 dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
4182 internal::do_function_derivatives(
4184 this->finite_element_output.shape_3rd_derivatives,
4186 this->finite_element_output.shape_function_to_row_table,
4188 quadrature_points_fastest,
4189 indices.
size() / dofs_per_cell);
4194 template <
int dim,
int spacedim>
4198 return *present_cell;
4203 template <
int dim,
int spacedim>
4204 const std::vector<Tensor<1, spacedim>> &
4209 "update_normal_vectors")));
4210 return get_normal_vectors();
4215 template <
int dim,
int spacedim>
4216 const std::vector<Tensor<1, spacedim>> &
4221 "update_normal_vectors")));
4223 return this->mapping_output.normal_vectors;
4228 template <
int dim,
int spacedim>
4232 return (
sizeof(this->update_flags) +
4234 sizeof(cell_similarity) +
4248 template <
int dim,
int spacedim>
4260 flags |= mapping->requires_update_flags(flags);
4267 template <
int dim,
int spacedim>
4278 tria_listener_refinement.disconnect();
4279 tria_listener_mesh_transform.disconnect();
4280 present_cell.reset();
4285 template <
int dim,
int spacedim>
4290 if (present_cell.get() !=
nullptr)
4292 if (&cell->get_triangulation() !=
4296 ->get_triangulation())
4303 invalidate_present_cell();
4304 tria_listener_refinement =
4305 cell->get_triangulation().signals.any_change.connect(std::bind(
4308 tria_listener_mesh_transform =
4309 cell->get_triangulation().signals.mesh_movement.connect(std::bind(
4319 tria_listener_refinement =
4320 cell->get_triangulation().signals.post_refinement.connect(std::bind(
4323 tria_listener_mesh_transform =
4324 cell->get_triangulation().signals.mesh_movement.connect(std::bind(
4332 template <
int dim,
int spacedim>
4359 if (this->present_cell.get() ==
nullptr)
4368 (cell->is_translation_of(
4370 &
>(*this->present_cell)) ?
4377 &
>(*this->present_cell)
4378 ->direction_flag() != cell->direction_flag())
4387 template <
int dim,
int spacedim>
4391 return cell_similarity;
4396 template <
int dim,
int spacedim>
4401 template <
int dim,
int spacedim>
4406 template <
int dim,
int spacedim>
4411 template <
int dim,
int spacedim>
4428 template <
int dim,
int spacedim>
4444 template <
int dim,
int spacedim>
4450 if (dim != spacedim - 1)
4452 ExcMessage(
"You can only pass the 'update_normal_vectors' " 4453 "flag to FEFaceValues or FESubfaceValues objects, " 4454 "but not to an FEValues object unless the " 4455 "triangulation it refers to is embedded in a higher " 4456 "dimensional space."));
4458 const UpdateFlags flags = this->compute_update_flags(update_flags);
4462 this->mapping_output.initialize(this->n_quadrature_points, flags);
4463 this->finite_element_output.initialize(this->n_quadrature_points,
4470 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4476 this->finite_element_output);
4478 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4486 this->update_flags = flags;
4489 this->fe_data = std::move(fe_get_data.return_value());
4491 this->mapping_data = std::move(mapping_get_data.return_value());
4493 this->mapping_data = std_cxx14::make_unique<
4505 template <
typename Type,
typename Po
inter,
typename Iterator>
4507 reset_pointer_in_place_if_possible(std::unique_ptr<Pointer> &present_cell,
4508 const Iterator & new_cell)
4513 if (present_cell.get() && (
typeid(*present_cell.get()) ==
typeid(Type)))
4516 static_cast<const Type *
>(present_cell.get())->~Type();
4519 new (
const_cast<void *
>(
static_cast<const void *
>(present_cell.get())))
4524 present_cell = std_cxx14::make_unique<Type>(new_cell);
4530 template <
int dim,
int spacedim>
4537 this->maybe_invalidate_previous_present_cell(cell);
4538 this->check_cell_similarity(cell);
4540 reset_pointer_in_place_if_possible<
4552 template <
int dim,
int spacedim>
4553 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4564 this->maybe_invalidate_previous_present_cell(cell);
4565 this->check_cell_similarity(cell);
4567 reset_pointer_in_place_if_possible<
4570 this->present_cell, cell);
4580 template <
int dim,
int spacedim>
4590 this->cell_similarity =
4591 this->get_mapping().fill_fe_values(*this->present_cell,
4592 this->cell_similarity,
4594 *this->mapping_data,
4595 this->mapping_output);
4602 this->get_fe().fill_fe_values(*this->present_cell,
4603 this->cell_similarity,
4605 this->get_mapping(),
4606 *this->mapping_data,
4607 this->mapping_output,
4609 this->finite_element_output);
4614 template <
int dim,
int spacedim>
4626 template <
int dim,
int spacedim>
4628 const unsigned int n_q_points,
4629 const unsigned int dofs_per_cell,
4639 , present_face_index(
numbers::invalid_unsigned_int)
4640 , quadrature(quadrature)
4645 template <
int dim,
int spacedim>
4646 const std::vector<Tensor<1, spacedim>> &
4651 "update_boundary_forms")));
4652 return this->mapping_output.boundary_forms;
4657 template <
int dim,
int spacedim>
4668 template <
int dim,
int spacedim>
4673 template <
int dim,
int spacedim>
4678 template <
int dim,
int spacedim>
4696 template <
int dim,
int spacedim>
4713 template <
int dim,
int spacedim>
4717 const UpdateFlags flags = this->compute_update_flags(update_flags);
4721 this->mapping_output.initialize(this->n_quadrature_points, flags);
4722 this->finite_element_output.initialize(this->n_quadrature_points,
4729 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4736 this->finite_element_output);
4738 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4746 this->update_flags = flags;
4749 this->fe_data = std::move(fe_get_data.return_value());
4751 this->mapping_data = std::move(mapping_get_data.return_value());
4753 this->mapping_data = std_cxx14::make_unique<
4759 template <
int dim,
int spacedim>
4760 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4764 const unsigned int face_no)
4770 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4776 this->maybe_invalidate_previous_present_cell(cell);
4777 reset_pointer_in_place_if_possible<
4780 this->present_cell, cell);
4790 template <
int dim,
int spacedim>
4794 const unsigned int face_no)
4799 this->maybe_invalidate_previous_present_cell(cell);
4800 reset_pointer_in_place_if_possible<
4812 template <
int dim,
int spacedim>
4818 *this->present_cell;
4819 this->present_face_index = cell->face_index(face_no);
4823 this->get_mapping().fill_fe_face_values(*this->present_cell,
4826 *this->mapping_data,
4827 this->mapping_output);
4830 this->get_fe().fill_fe_face_values(*this->present_cell,
4833 this->get_mapping(),
4834 *this->mapping_data,
4835 this->mapping_output,
4837 this->finite_element_output);
4844 template <
int dim,
int spacedim>
4849 template <
int dim,
int spacedim>
4854 template <
int dim,
int spacedim>
4872 template <
int dim,
int spacedim>
4889 template <
int dim,
int spacedim>
4893 const UpdateFlags flags = this->compute_update_flags(update_flags);
4897 this->mapping_output.initialize(this->n_quadrature_points, flags);
4898 this->finite_element_output.initialize(this->n_quadrature_points,
4906 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4913 this->finite_element_output);
4915 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4924 this->update_flags = flags;
4927 this->fe_data = std::move(fe_get_data.return_value());
4929 this->mapping_data = std::move(mapping_get_data.return_value());
4931 this->mapping_data = std_cxx14::make_unique<
4937 template <
int dim,
int spacedim>
4938 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4942 const unsigned int face_no,
4943 const unsigned int subface_no)
4949 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4957 Assert(cell->face(face_no)->has_children() ||
4958 subface_no < GeometryInfo<dim>::max_children_per_face,
4962 Assert(!cell->face(face_no)->has_children() ||
4963 subface_no < cell->face(face_no)->number_of_children(),
4966 cell->face(face_no)->number_of_children()));
4967 Assert(cell->has_children() ==
false,
4968 ExcMessage(
"You can't use subface data for cells that are " 4969 "already refined. Iterate over their children " 4970 "instead in these cases."));
4972 this->maybe_invalidate_previous_present_cell(cell);
4973 reset_pointer_in_place_if_possible<
4976 this->present_cell, cell);
4981 do_reinit(face_no, subface_no);
4986 template <
int dim,
int spacedim>
4990 const unsigned int face_no,
4991 const unsigned int subface_no)
4995 Assert(subface_no < cell->face(face_no)->n_children(),
4996 ExcIndexRange(subface_no, 0, cell->face(face_no)->n_children()));
4998 this->maybe_invalidate_previous_present_cell(cell);
4999 reset_pointer_in_place_if_possible<
5006 do_reinit(face_no, subface_no);
5011 template <
int dim,
int spacedim>
5014 const unsigned int subface_no)
5018 *this->present_cell;
5020 if (!cell->face(face_no)->has_children())
5023 this->present_face_index = cell->face_index(face_no);
5025 this->present_face_index = cell->face(face_no)->child_index(subface_no);
5031 switch (cell->subface_case(face_no))
5036 subface_index = cell->face(face_no)->child_index(subface_no);
5040 subface_index = cell->face(face_no)
5041 ->child(subface_no / 2)
5042 ->child_index(subface_no % 2);
5051 cell->face(face_no)->child(0)->child_index(subface_no);
5054 subface_index = cell->face(face_no)->child_index(1);
5065 subface_index = cell->face(face_no)->child_index(0);
5070 cell->face(face_no)->child(1)->child_index(subface_no - 1);
5082 this->present_face_index = subface_index;
5088 this->get_mapping().fill_fe_subface_values(*this->present_cell,
5092 *this->mapping_data,
5093 this->mapping_output);
5096 this->get_fe().fill_fe_subface_values(*this->present_cell,
5100 this->get_mapping(),
5101 *this->mapping_data,
5102 this->mapping_output,
5104 this->finite_element_output);
5109 #define SPLIT_INSTANTIATIONS_COUNT 6 5110 #ifndef SPLIT_INSTANTIATIONS_INDEX 5111 # define SPLIT_INSTANTIATIONS_INDEX 0 5113 #include "fe_values.inst" 5115 DEAL_II_NAMESPACE_CLOSE
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
Transformed quadrature weights.
constexpr Tensor()=default
virtual ~FEValuesBase() override
typename ProductType< Number, typename Vector< dim, spacedim >::curl_type >::type curl_type
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access >> &cell, const unsigned int face_no, const unsigned int subface_no)
static const unsigned int invalid_unsigned_int
CellSimilarity::Similarity cell_similarity
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::gradient_type >::type gradient_type
Cache(const FEValuesBase< dim, spacedim > &fe_values)
typename ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::value_type >::type value_type
#define AssertDimension(dim1, dim2)
static constexpr unsigned int n_independent_components
static unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
unsigned int n_nonzero_components(const unsigned int i) const
static ::ExceptionBase & ExcAccessToUninitializedField()
Task< RT > new_task(const std::function< RT()> &function)
const unsigned int dofs_per_cell
const unsigned int component
void get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::symmetric_gradient_type > &symmetric_gradients) const
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
Number trace(const SymmetricTensor< 2, dim, Number > &d)
FEValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe)
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
Outer normal vector, not normalized.
void get_function_divergences(const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const
typename ProductType< Number, typename Scalar< dim, spacedim >::hessian_type >::type hessian_type
FEFaceValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature)
const FiniteElement< dim, spacedim > & get_fe() const
static ::ExceptionBase & ExcFEDontMatch()
void get_function_divergences(const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
TriaCellIterator(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
Transformed quadrature points.
void do_reinit(const unsigned int face_no)
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
std::size_t memory_consumption() const
typename ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type value_type
bool is_primitive() const
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > &divergences) const
void get_function_curls_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::curl_type > &curls) const
typename ProductType< Number, typename Vector< dim, spacedim >::gradient_type >::type gradient_type
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
const Triangulation< dim, spacedim >::cell_iterator cell
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
typename ProductType< Number, typename Scalar< dim, spacedim >::gradient_type >::type gradient_type
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename InputVector::value_type > &laplacians) const
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::value_type >::type value_type
static ::ExceptionBase & ExcMessage(std::string arg1)
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
CellSimilarity::Similarity get_cell_similarity() const
Third derivatives of shape functions.
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &face_quadrature, const UpdateFlags update_flags)
Abstract base class for mapping classes.
const ComponentMask & get_nonzero_components(const unsigned int i) const
std::vector< ShapeFunctionData > shape_function_data
const unsigned int first_vector_component
virtual types::global_dof_index n_dofs_for_dof_handler() const override
void invalidate_present_cell()
SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
static const char *const message_string
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< typename ProductType< symmetric_gradient_type, typename InputVector::value_type >::type > &symmetric_gradients) const
Second derivatives of shape functions.
Gradient of volume element.
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
const std::vector< Tensor< 1, spacedim > > & get_all_normal_vectors() const
typename ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::divergence_type >::type divergence_type
value_type * data() const noexcept
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
std::size_t memory_consumption() const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access >> &cell)
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > &divergences) const
const unsigned int dofs_per_cell
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
const unsigned int n_quadrature_points
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type >> &hessians) const
unsigned int global_dof_index
FEFaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature, const UpdateFlags update_flags)
void get_function_curls(const InputVector &fe_function, std::vector< typename ProductType< curl_type, typename InputVector::value_type >::type > &curls) const
void get_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type >> &third_derivatives) const
typename ProductType< Number, typename Vector< dim, spacedim >::value_type >::type value_type
size_type size(const unsigned int i) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
unsigned int n_components() const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
typename ProductType< Number, typename Vector< dim, spacedim >::divergence_type >::type divergence_type
void initialize(const UpdateFlags update_flags)
typename ProductType< Number, typename Vector< dim, spacedim >::hessian_type >::type hessian_type
Shape function gradients.
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::divergence_type >::type divergence_type
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type >> &gradients) const
void initialize(const UpdateFlags update_flags)
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
static unsigned int n_threads()
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access >> &cell, const unsigned int face_no)
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
bool is_element(const size_type index) const
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
typename ProductType< Number, typename Vector< dim, spacedim >::value_type >::type laplacian_type
const std::vector< Tensor< 1, spacedim > > & get_boundary_forms() const
void initialize(const UpdateFlags update_flags)
FEValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags update_flags)
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
void get_function_divergences(const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
typename ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type laplacian_type
std::size_t memory_consumption() const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
std::vector< ShapeFunctionData > shape_function_data
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe