48#include <boost/container/small_vector.hpp>
59 template <
class VectorType>
61 const VectorType & vector,
78 template <
int dim,
int spacedim>
79 inline std::vector<unsigned int>
82 std::vector<unsigned int> shape_function_to_row_table(
91 unsigned int nth_nonzero_component = 0;
96 row + nth_nonzero_component;
97 ++nth_nonzero_component;
102 return shape_function_to_row_table;
109 template <
typename Number,
typename T =
void>
124 template <
typename Number>
127 std::enable_if_t<Differentiation::AD::is_ad_number<Number>::value>>
130 value(
const Number & )
142 template <
int dim,
int spacedim>
144 const unsigned int component)
145 : fe_values(&fe_values)
146 , component(component)
147 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
155 const std::vector<unsigned int> shape_function_to_row_table =
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->n_dofs_per_cell())
200 const std::vector<unsigned int> shape_function_to_row_table =
203 for (
unsigned int d = 0; d < spacedim; ++d)
211 if (is_primitive ==
true)
221 shape_function_to_row_table[i * fe.
n_components() + component];
230 unsigned int n_nonzero_components = 0;
231 for (
unsigned int d = 0; d < spacedim; ++d)
234 ++n_nonzero_components;
236 if (n_nonzero_components == 0)
238 else if (n_nonzero_components > 1)
242 for (
unsigned int d = 0; d < spacedim; ++d)
244 .is_nonzero_shape_function_component[d] ==
true)
257 template <
int dim,
int spacedim>
260 , first_vector_component(
numbers::invalid_unsigned_int)
265 template <
int dim,
int spacedim>
268 const unsigned int first_tensor_component)
269 : fe_values(&fe_values)
270 , first_tensor_component(first_tensor_component)
271 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
274 Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 <
277 first_tensor_component +
284 const std::vector<unsigned int> shape_function_to_row_table =
287 for (
unsigned int d = 0;
288 d < ::SymmetricTensor<2, dim>::n_independent_components;
291 const unsigned int component = first_tensor_component + d;
297 if (is_primitive ==
true)
298 shape_function_data[i].is_nonzero_shape_function_component[d] =
301 shape_function_data[i].is_nonzero_shape_function_component[d] =
304 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
306 shape_function_data[i].row_index[d] =
309 shape_function_data[i].row_index[d] =
316 unsigned int n_nonzero_components = 0;
317 for (
unsigned int d = 0;
318 d < ::SymmetricTensor<2, dim>::n_independent_components;
320 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
322 ++n_nonzero_components;
324 if (n_nonzero_components == 0)
325 shape_function_data[i].single_nonzero_component = -2;
326 else if (n_nonzero_components > 1)
327 shape_function_data[i].single_nonzero_component = -1;
330 for (
unsigned int d = 0;
331 d < ::SymmetricTensor<2, dim>::n_independent_components;
333 if (shape_function_data[i]
334 .is_nonzero_shape_function_component[d] ==
true)
336 shape_function_data[i].single_nonzero_component =
337 shape_function_data[i].row_index[d];
338 shape_function_data[i].single_nonzero_component_index = d;
347 template <
int dim,
int spacedim>
350 , first_tensor_component(
numbers::invalid_unsigned_int)
355 template <
int dim,
int spacedim>
357 const unsigned int first_tensor_component)
358 : fe_values(&fe_values)
359 , first_tensor_component(first_tensor_component)
360 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
367 const std::vector<unsigned int> shape_function_to_row_table =
370 for (
unsigned int d = 0; d < dim * dim; ++d)
372 const unsigned int component = first_tensor_component + d;
378 if (is_primitive ==
true)
379 shape_function_data[i].is_nonzero_shape_function_component[d] =
382 shape_function_data[i].is_nonzero_shape_function_component[d] =
385 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
387 shape_function_data[i].row_index[d] =
388 shape_function_to_row_table[i * fe.
n_components() + component];
390 shape_function_data[i].row_index[d] =
397 unsigned int n_nonzero_components = 0;
398 for (
unsigned int d = 0; d < dim * dim; ++d)
399 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
401 ++n_nonzero_components;
403 if (n_nonzero_components == 0)
404 shape_function_data[i].single_nonzero_component = -2;
405 else if (n_nonzero_components > 1)
406 shape_function_data[i].single_nonzero_component = -1;
409 for (
unsigned int d = 0; d < dim * dim; ++d)
410 if (shape_function_data[i]
411 .is_nonzero_shape_function_component[d] ==
true)
413 shape_function_data[i].single_nonzero_component =
414 shape_function_data[i].row_index[d];
415 shape_function_data[i].single_nonzero_component_index = d;
424 template <
int dim,
int spacedim>
427 , first_tensor_component(
numbers::invalid_unsigned_int)
438 template <
int dim,
int spacedim,
typename Number>
444 &shape_function_data,
447 const unsigned int dofs_per_cell = dof_values.
size();
448 const unsigned int n_quadrature_points = values.size();
450 std::fill(values.begin(),
454 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
456 if (shape_function_data[shape_function]
457 .is_nonzero_shape_function_component)
459 const Number &value = dof_values[shape_function];
463 if (::internal::CheckForZero<Number>::value(value) ==
true)
466 const double *shape_value_ptr =
467 &shape_values(shape_function_data[shape_function].row_index, 0);
468 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
470 values[q_point] += value * (*shape_value_ptr++);
478 template <
int order,
int dim,
int spacedim,
typename Number>
484 &shape_function_data,
489 const unsigned int dofs_per_cell = dof_values.
size();
490 const unsigned int n_quadrature_points = derivatives.size();
497 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
499 if (shape_function_data[shape_function]
500 .is_nonzero_shape_function_component)
502 const Number &value = dof_values[shape_function];
506 if (::internal::CheckForZero<Number>::value(value) ==
true)
509 const ::Tensor<order, spacedim> *shape_derivative_ptr =
510 &shape_derivatives[shape_function_data[shape_function].row_index]
512 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
514 derivatives[q_point] += value * (*shape_derivative_ptr++);
520 template <
int dim,
int spacedim,
typename Number>
526 &shape_function_data,
530 const unsigned int dofs_per_cell = dof_values.
size();
531 const unsigned int n_quadrature_points = laplacians.size();
539 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
541 if (shape_function_data[shape_function]
542 .is_nonzero_shape_function_component)
544 const Number &value = dof_values[shape_function];
548 if (::internal::CheckForZero<Number>::value(value) ==
true)
551 const ::Tensor<2, spacedim> *shape_hessian_ptr =
552 &shape_hessians[shape_function_data[shape_function].row_index][0];
553 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
555 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
563 template <
int dim,
int spacedim,
typename Number>
569 &shape_function_data,
574 const unsigned int dofs_per_cell = dof_values.
size();
575 const unsigned int n_quadrature_points = values.size();
582 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
586 shape_function_data[shape_function].single_nonzero_component;
592 const Number &value = dof_values[shape_function];
596 if (::internal::CheckForZero<Number>::value(value) ==
true)
601 const unsigned int comp = shape_function_data[shape_function]
602 .single_nonzero_component_index;
603 const double *shape_value_ptr = &shape_values(snc, 0);
604 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
606 values[q_point][comp] += value * (*shape_value_ptr++);
609 for (
unsigned int d = 0; d < spacedim; ++d)
610 if (shape_function_data[shape_function]
611 .is_nonzero_shape_function_component[d])
613 const double *shape_value_ptr = &shape_values(
614 shape_function_data[shape_function].row_index[d], 0);
615 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
617 values[q_point][d] += value * (*shape_value_ptr++);
624 template <
int order,
int dim,
int spacedim,
typename Number>
630 &shape_function_data,
635 const unsigned int dofs_per_cell = dof_values.
size();
636 const unsigned int n_quadrature_points = derivatives.size();
644 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
648 shape_function_data[shape_function].single_nonzero_component;
654 const Number &value = dof_values[shape_function];
658 if (::internal::CheckForZero<Number>::value(value) ==
true)
663 const unsigned int comp = shape_function_data[shape_function]
664 .single_nonzero_component_index;
665 const ::Tensor<order, spacedim> *shape_derivative_ptr =
666 &shape_derivatives[snc][0];
667 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
669 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
672 for (
unsigned int d = 0; d < spacedim; ++d)
673 if (shape_function_data[shape_function]
674 .is_nonzero_shape_function_component[d])
676 const ::Tensor<order, spacedim> *shape_derivative_ptr =
677 &shape_derivatives[shape_function_data[shape_function]
679 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
681 derivatives[q_point][d] +=
682 value * (*shape_derivative_ptr++);
689 template <
int dim,
int spacedim,
typename Number>
695 &shape_function_data,
699 &symmetric_gradients)
701 const unsigned int dofs_per_cell = dof_values.
size();
702 const unsigned int n_quadrature_points = symmetric_gradients.size();
705 symmetric_gradients.begin(),
706 symmetric_gradients.end(),
710 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
714 shape_function_data[shape_function].single_nonzero_component;
720 const Number &value = dof_values[shape_function];
724 if (::internal::CheckForZero<Number>::value(value) ==
true)
729 const unsigned int comp = shape_function_data[shape_function]
730 .single_nonzero_component_index;
731 const ::Tensor<1, spacedim> *shape_gradient_ptr =
732 &shape_gradients[snc][0];
733 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
735 symmetric_gradients[q_point] +=
737 symmetrize_single_row(comp, *shape_gradient_ptr++));
740 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
745 for (
unsigned int d = 0; d < spacedim; ++d)
746 if (shape_function_data[shape_function]
747 .is_nonzero_shape_function_component[d])
750 shape_gradients[shape_function_data[shape_function]
751 .row_index[d]][q_point];
752 symmetric_gradients[q_point] +=
symmetrize(grad);
759 template <
int dim,
int spacedim,
typename Number>
765 &shape_function_data,
767 template solution_divergence_type<Number>> &divergences)
769 const unsigned int dofs_per_cell = dof_values.
size();
770 const unsigned int n_quadrature_points = divergences.size();
776 spacedim>::template solution_divergence_type<Number>());
778 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
782 shape_function_data[shape_function].single_nonzero_component;
788 const Number &value = dof_values[shape_function];
792 if (::internal::CheckForZero<Number>::value(value) ==
true)
797 const unsigned int comp = shape_function_data[shape_function]
798 .single_nonzero_component_index;
799 const ::Tensor<1, spacedim> *shape_gradient_ptr =
800 &shape_gradients[snc][0];
801 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
803 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
806 for (
unsigned int d = 0; d < spacedim; ++d)
807 if (shape_function_data[shape_function]
808 .is_nonzero_shape_function_component[d])
810 const ::Tensor<1, spacedim> *shape_gradient_ptr =
811 &shape_gradients[shape_function_data[shape_function]
813 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
815 divergences[q_point] += value * (*shape_gradient_ptr++)[d];
822 template <
int dim,
int spacedim,
typename Number>
828 &shape_function_data,
831 typename ::internal::CurlType<spacedim>::type>::type> &curls)
833 const unsigned int dofs_per_cell = dof_values.
size();
834 const unsigned int n_quadrature_points = curls.size();
836 std::fill(curls.begin(),
840 typename ::internal::CurlType<spacedim>::type>::type());
848 "Computing the curl in 1d is not a useful operation"));
854 for (
unsigned int shape_function = 0;
855 shape_function < dofs_per_cell;
858 const int snc = shape_function_data[shape_function]
859 .single_nonzero_component;
865 const Number &value = dof_values[shape_function];
869 if (::internal::CheckForZero<Number>::value(value) ==
875 const ::Tensor<1, spacedim> *shape_gradient_ptr =
876 &shape_gradients[snc][0];
878 Assert(shape_function_data[shape_function]
879 .single_nonzero_component >= 0,
882 if (shape_function_data[shape_function]
883 .single_nonzero_component_index == 0)
884 for (
unsigned int q_point = 0;
885 q_point < n_quadrature_points;
888 value * (*shape_gradient_ptr++)[1];
890 for (
unsigned int q_point = 0;
891 q_point < n_quadrature_points;
894 value * (*shape_gradient_ptr++)[0];
902 if (shape_function_data[shape_function]
903 .is_nonzero_shape_function_component[0])
906 spacedim> *shape_gradient_ptr =
907 &shape_gradients[shape_function_data[shape_function]
910 for (
unsigned int q_point = 0;
911 q_point < n_quadrature_points;
914 value * (*shape_gradient_ptr++)[1];
917 if (shape_function_data[shape_function]
918 .is_nonzero_shape_function_component[1])
921 spacedim> *shape_gradient_ptr =
922 &shape_gradients[shape_function_data[shape_function]
925 for (
unsigned int q_point = 0;
926 q_point < n_quadrature_points;
929 value * (*shape_gradient_ptr++)[0];
938 for (
unsigned int shape_function = 0;
939 shape_function < dofs_per_cell;
942 const int snc = shape_function_data[shape_function]
943 .single_nonzero_component;
949 const Number &value = dof_values[shape_function];
953 if (::internal::CheckForZero<Number>::value(value) ==
959 const ::Tensor<1, spacedim> *shape_gradient_ptr =
960 &shape_gradients[snc][0];
962 switch (shape_function_data[shape_function]
963 .single_nonzero_component_index)
967 for (
unsigned int q_point = 0;
968 q_point < n_quadrature_points;
972 value * (*shape_gradient_ptr)[2];
974 value * (*shape_gradient_ptr++)[1];
982 for (
unsigned int q_point = 0;
983 q_point < n_quadrature_points;
987 value * (*shape_gradient_ptr)[2];
989 value * (*shape_gradient_ptr++)[0];
997 for (
unsigned int q_point = 0;
998 q_point < n_quadrature_points;
1001 curls[q_point][0] +=
1002 value * (*shape_gradient_ptr)[1];
1003 curls[q_point][1] -=
1004 value * (*shape_gradient_ptr++)[0];
1020 if (shape_function_data[shape_function]
1021 .is_nonzero_shape_function_component[0])
1024 spacedim> *shape_gradient_ptr =
1025 &shape_gradients[shape_function_data[shape_function]
1028 for (
unsigned int q_point = 0;
1029 q_point < n_quadrature_points;
1032 curls[q_point][1] +=
1033 value * (*shape_gradient_ptr)[2];
1034 curls[q_point][2] -=
1035 value * (*shape_gradient_ptr++)[1];
1039 if (shape_function_data[shape_function]
1040 .is_nonzero_shape_function_component[1])
1043 spacedim> *shape_gradient_ptr =
1044 &shape_gradients[shape_function_data[shape_function]
1047 for (
unsigned int q_point = 0;
1048 q_point < n_quadrature_points;
1051 curls[q_point][0] -=
1052 value * (*shape_gradient_ptr)[2];
1053 curls[q_point][2] +=
1054 value * (*shape_gradient_ptr++)[0];
1058 if (shape_function_data[shape_function]
1059 .is_nonzero_shape_function_component[2])
1062 spacedim> *shape_gradient_ptr =
1063 &shape_gradients[shape_function_data[shape_function]
1066 for (
unsigned int q_point = 0;
1067 q_point < n_quadrature_points;
1070 curls[q_point][0] +=
1071 value * (*shape_gradient_ptr)[1];
1072 curls[q_point][1] -=
1073 value * (*shape_gradient_ptr++)[0];
1084 template <
int dim,
int spacedim,
typename Number>
1090 &shape_function_data,
1092 template solution_laplacian_type<Number>> &laplacians)
1094 const unsigned int dofs_per_cell = dof_values.
size();
1095 const unsigned int n_quadrature_points = laplacians.size();
1101 spacedim>::template solution_laplacian_type<Number>());
1103 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1107 shape_function_data[shape_function].single_nonzero_component;
1113 const Number &value = dof_values[shape_function];
1117 if (::internal::CheckForZero<Number>::value(value) ==
true)
1122 const unsigned int comp = shape_function_data[shape_function]
1123 .single_nonzero_component_index;
1124 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1125 &shape_hessians[snc][0];
1126 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1128 laplacians[q_point][comp] +=
1129 value *
trace(*shape_hessian_ptr++);
1132 for (
unsigned int d = 0; d < spacedim; ++d)
1133 if (shape_function_data[shape_function]
1134 .is_nonzero_shape_function_component[d])
1136 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1137 &shape_hessians[shape_function_data[shape_function]
1139 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1141 laplacians[q_point][d] +=
1142 value *
trace(*shape_hessian_ptr++);
1151 template <
int dim,
int spacedim,
typename Number>
1155 const ::Table<2, double> &shape_values,
1158 &shape_function_data,
1164 const unsigned int dofs_per_cell = dof_values.
size();
1165 const unsigned int n_quadrature_points = values.size();
1173 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1177 shape_function_data[shape_function].single_nonzero_component;
1183 const Number &value = dof_values[shape_function];
1187 if (::internal::CheckForZero<Number>::value(value) ==
true)
1194 shape_function_data[shape_function]
1195 .single_nonzero_component_index);
1196 const double *shape_value_ptr = &shape_values(snc, 0);
1197 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1199 values[q_point][comp] += value * (*shape_value_ptr++);
1202 for (
unsigned int d = 0;
1206 if (shape_function_data[shape_function]
1207 .is_nonzero_shape_function_component[d])
1212 const double *shape_value_ptr = &shape_values(
1213 shape_function_data[shape_function].row_index[d], 0);
1214 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1216 values[q_point][comp] += value * (*shape_value_ptr++);
1223 template <
int dim,
int spacedim,
typename Number>
1230 &shape_function_data,
1232 template solution_divergence_type<Number>> &divergences)
1234 const unsigned int dofs_per_cell = dof_values.
size();
1235 const unsigned int n_quadrature_points = divergences.size();
1237 std::fill(divergences.begin(),
1242 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1246 shape_function_data[shape_function].single_nonzero_component;
1252 const Number &value = dof_values[shape_function];
1256 if (::internal::CheckForZero<Number>::value(value) ==
true)
1261 const unsigned int comp = shape_function_data[shape_function]
1262 .single_nonzero_component_index;
1264 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1265 &shape_gradients[snc][0];
1272 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1273 ++q_point, ++shape_gradient_ptr)
1275 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1278 divergences[q_point][jj] +=
1279 value * (*shape_gradient_ptr)[ii];
1284 for (
unsigned int d = 0;
1287 spacedim>::n_independent_components;
1289 if (shape_function_data[shape_function]
1290 .is_nonzero_shape_function_component[d])
1302 const unsigned int comp =
1303 shape_function_data[shape_function]
1304 .single_nonzero_component_index;
1306 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1307 &shape_gradients[shape_function_data[shape_function]
1309 for (
unsigned int q_point = 0;
1310 q_point < n_quadrature_points;
1311 ++q_point, ++shape_gradient_ptr)
1313 for (
unsigned int j = 0; j < spacedim; ++j)
1315 const unsigned int vector_component =
1319 divergences[q_point][vector_component] +=
1320 value * (*shape_gradient_ptr++)[j];
1330 template <
int dim,
int spacedim,
typename Number>
1334 const ::Table<2, double> &shape_values,
1336 &shape_function_data,
1341 const unsigned int dofs_per_cell = dof_values.
size();
1342 const unsigned int n_quadrature_points = values.size();
1349 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1353 shape_function_data[shape_function].single_nonzero_component;
1359 const Number &value = dof_values[shape_function];
1363 if (::internal::CheckForZero<Number>::value(value) ==
true)
1368 const unsigned int comp = shape_function_data[shape_function]
1369 .single_nonzero_component_index;
1375 const double *shape_value_ptr = &shape_values(snc, 0);
1376 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1378 values[q_point][indices] += value * (*shape_value_ptr++);
1381 for (
unsigned int d = 0; d < dim * dim; ++d)
1382 if (shape_function_data[shape_function]
1383 .is_nonzero_shape_function_component[d])
1389 const double *shape_value_ptr = &shape_values(
1390 shape_function_data[shape_function].row_index[d], 0);
1391 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1393 values[q_point][indices] += value * (*shape_value_ptr++);
1400 template <
int dim,
int spacedim,
typename Number>
1406 &shape_function_data,
1408 template solution_divergence_type<Number>> &divergences)
1410 const unsigned int dofs_per_cell = dof_values.
size();
1411 const unsigned int n_quadrature_points = divergences.size();
1414 divergences.begin(),
1419 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1423 shape_function_data[shape_function].single_nonzero_component;
1429 const Number &value = dof_values[shape_function];
1433 if (::internal::CheckForZero<Number>::value(value) ==
true)
1438 const unsigned int comp = shape_function_data[shape_function]
1439 .single_nonzero_component_index;
1441 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1442 &shape_gradients[snc][0];
1447 const unsigned int ii = indices[0];
1448 const unsigned int jj = indices[1];
1450 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1451 ++q_point, ++shape_gradient_ptr)
1453 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1458 for (
unsigned int d = 0; d < dim * dim; ++d)
1459 if (shape_function_data[shape_function]
1460 .is_nonzero_shape_function_component[d])
1470 template <
int dim,
int spacedim,
typename Number>
1476 &shape_function_data,
1478 template solution_gradient_type<Number>> &gradients)
1480 const unsigned int dofs_per_cell = dof_values.
size();
1481 const unsigned int n_quadrature_points = gradients.size();
1489 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1493 shape_function_data[shape_function].single_nonzero_component;
1499 const Number &value = dof_values[shape_function];
1503 if (::internal::CheckForZero<Number>::value(value) ==
true)
1508 const unsigned int comp = shape_function_data[shape_function]
1509 .single_nonzero_component_index;
1511 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1512 &shape_gradients[snc][0];
1517 const unsigned int ii = indices[0];
1518 const unsigned int jj = indices[1];
1520 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1521 ++q_point, ++shape_gradient_ptr)
1523 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1528 for (
unsigned int d = 0; d < dim * dim; ++d)
1529 if (shape_function_data[shape_function]
1530 .is_nonzero_shape_function_component[d])
1542 template <
int dim,
int spacedim>
1543 template <
class InputVector>
1546 const InputVector &fe_function,
1564 internal::do_function_values<dim, spacedim>(
1567 shape_function_data,
1573 template <
int dim,
int spacedim>
1574 template <
class InputVector>
1577 const InputVector &dof_values,
1588 internal::do_function_values<dim, spacedim>(
1591 shape_function_data,
1597 template <
int dim,
int spacedim>
1598 template <
class InputVector>
1601 const InputVector &fe_function,
1607 "update_gradients")));
1618 internal::do_function_derivatives<1, dim, spacedim>(
1621 shape_function_data,
1627 template <
int dim,
int spacedim>
1628 template <
class InputVector>
1631 const InputVector &dof_values,
1637 "update_gradients")));
1642 internal::do_function_derivatives<1, dim, spacedim>(
1645 shape_function_data,
1651 template <
int dim,
int spacedim>
1652 template <
class InputVector>
1655 const InputVector &fe_function,
1661 "update_hessians")));
1672 internal::do_function_derivatives<2, dim, spacedim>(
1675 shape_function_data,
1681 template <
int dim,
int spacedim>
1682 template <
class InputVector>
1685 const InputVector &dof_values,
1691 "update_hessians")));
1696 internal::do_function_derivatives<2, dim, spacedim>(
1699 shape_function_data,
1705 template <
int dim,
int spacedim>
1706 template <
class InputVector>
1709 const InputVector &fe_function,
1715 "update_hessians")));
1726 internal::do_function_laplacians<dim, spacedim>(
1729 shape_function_data,
1735 template <
int dim,
int spacedim>
1736 template <
class InputVector>
1739 const InputVector &dof_values,
1745 "update_hessians")));
1750 internal::do_function_laplacians<dim, spacedim>(
1753 shape_function_data,
1759 template <
int dim,
int spacedim>
1760 template <
class InputVector>
1763 const InputVector &fe_function,
1766 &third_derivatives)
const
1770 "update_3rd_derivatives")));
1781 internal::do_function_derivatives<3, dim, spacedim>(
1784 shape_function_data,
1790 template <
int dim,
int spacedim>
1791 template <
class InputVector>
1794 const InputVector &dof_values,
1797 &third_derivatives)
const
1801 "update_3rd_derivatives")));
1806 internal::do_function_derivatives<3, dim, spacedim>(
1809 shape_function_data,
1815 template <
int dim,
int spacedim>
1816 template <
class InputVector>
1819 const InputVector &fe_function,
1836 internal::do_function_values<dim, spacedim>(
1839 shape_function_data,
1845 template <
int dim,
int spacedim>
1846 template <
class InputVector>
1849 const InputVector &dof_values,
1860 internal::do_function_values<dim, spacedim>(
1863 shape_function_data,
1869 template <
int dim,
int spacedim>
1870 template <
class InputVector>
1873 const InputVector &fe_function,
1879 "update_gradients")));
1890 internal::do_function_derivatives<1, dim, spacedim>(
1893 shape_function_data,
1899 template <
int dim,
int spacedim>
1900 template <
class InputVector>
1903 const InputVector &dof_values,
1909 "update_gradients")));
1914 internal::do_function_derivatives<1, dim, spacedim>(
1917 shape_function_data,
1923 template <
int dim,
int spacedim>
1924 template <
class InputVector>
1927 const InputVector &fe_function,
1930 &symmetric_gradients)
const
1934 "update_gradients")));
1945 internal::do_function_symmetric_gradients<dim, spacedim>(
1948 shape_function_data,
1949 symmetric_gradients);
1954 template <
int dim,
int spacedim>
1955 template <
class InputVector>
1958 const InputVector &dof_values,
1961 &symmetric_gradients)
const
1965 "update_gradients")));
1970 internal::do_function_symmetric_gradients<dim, spacedim>(
1973 shape_function_data,
1974 symmetric_gradients);
1979 template <
int dim,
int spacedim>
1980 template <
class InputVector>
1983 const InputVector &fe_function,
1989 "update_gradients")));
2001 internal::do_function_divergences<dim, spacedim>(
2004 shape_function_data,
2010 template <
int dim,
int spacedim>
2011 template <
class InputVector>
2014 const InputVector &dof_values,
2020 "update_gradients")));
2025 internal::do_function_divergences<dim, spacedim>(
2028 shape_function_data,
2034 template <
int dim,
int spacedim>
2035 template <
class InputVector>
2038 const InputVector &fe_function,
2044 "update_gradients")));
2046 ExcMessage(
"FEValues object is not reinited to any cell"));
2055 internal::do_function_curls<dim, spacedim>(
2058 shape_function_data,
2064 template <
int dim,
int spacedim>
2065 template <
class InputVector>
2068 const InputVector &dof_values,
2074 "update_gradients")));
2076 ExcMessage(
"FEValues object is not reinited to any cell"));
2079 internal::do_function_curls<dim, spacedim>(
2082 shape_function_data,
2088 template <
int dim,
int spacedim>
2089 template <
class InputVector>
2092 const InputVector &fe_function,
2098 "update_hessians")));
2109 internal::do_function_derivatives<2, dim, spacedim>(
2112 shape_function_data,
2118 template <
int dim,
int spacedim>
2119 template <
class InputVector>
2122 const InputVector &dof_values,
2128 "update_hessians")));
2133 internal::do_function_derivatives<2, dim, spacedim>(
2136 shape_function_data,
2142 template <
int dim,
int spacedim>
2143 template <
class InputVector>
2146 const InputVector &fe_function,
2152 "update_hessians")));
2168 internal::do_function_laplacians<dim, spacedim>(
2171 shape_function_data,
2177 template <
int dim,
int spacedim>
2178 template <
class InputVector>
2181 const InputVector &dof_values,
2187 "update_hessians")));
2195 internal::do_function_laplacians<dim, spacedim>(
2198 shape_function_data,
2204 template <
int dim,
int spacedim>
2205 template <
class InputVector>
2208 const InputVector &fe_function,
2211 &third_derivatives)
const
2215 "update_3rd_derivatives")));
2226 internal::do_function_derivatives<3, dim, spacedim>(
2229 shape_function_data,
2235 template <
int dim,
int spacedim>
2236 template <
class InputVector>
2239 const InputVector &dof_values,
2242 &third_derivatives)
const
2246 "update_3rd_derivatives")));
2251 internal::do_function_derivatives<3, dim, spacedim>(
2254 shape_function_data,
2260 template <
int dim,
int spacedim>
2261 template <
class InputVector>
2264 const InputVector &fe_function,
2281 internal::do_function_values<dim, spacedim>(
2284 shape_function_data,
2290 template <
int dim,
int spacedim>
2291 template <
class InputVector>
2294 const InputVector &dof_values,
2305 internal::do_function_values<dim, spacedim>(
2308 shape_function_data,
2314 template <
int dim,
int spacedim>
2315 template <
class InputVector>
2318 const InputVector &fe_function,
2324 "update_gradients")));
2336 internal::do_function_divergences<dim, spacedim>(
2339 shape_function_data,
2345 template <
int dim,
int spacedim>
2346 template <
class InputVector>
2350 const InputVector &dof_values,
2356 "update_gradients")));
2361 internal::do_function_divergences<dim, spacedim>(
2364 shape_function_data,
2370 template <
int dim,
int spacedim>
2371 template <
class InputVector>
2374 const InputVector &fe_function,
2391 internal::do_function_values<dim, spacedim>(
2394 shape_function_data,
2400 template <
int dim,
int spacedim>
2401 template <
class InputVector>
2404 const InputVector &dof_values,
2415 internal::do_function_values<dim, spacedim>(
2418 shape_function_data,
2424 template <
int dim,
int spacedim>
2425 template <
class InputVector>
2428 const InputVector &fe_function,
2434 "update_gradients")));
2446 internal::do_function_divergences<dim, spacedim>(
2449 shape_function_data,
2455 template <
int dim,
int spacedim>
2456 template <
class InputVector>
2459 const InputVector &dof_values,
2465 "update_gradients")));
2470 internal::do_function_divergences<dim, spacedim>(
2473 shape_function_data,
2479 template <
int dim,
int spacedim>
2480 template <
class InputVector>
2483 const InputVector &fe_function,
2484 std::vector<solution_gradient_type<typename InputVector::value_type>>
2489 "update_gradients")));
2501 internal::do_function_gradients<dim, spacedim>(
2504 shape_function_data,
2510 template <
int dim,
int spacedim>
2511 template <
class InputVector>
2514 const InputVector &dof_values,
2520 "update_gradients")));
2525 internal::do_function_gradients<dim, spacedim>(
2528 shape_function_data,
2539 template <
int dim,
int spacedim>
2545 scalars.reserve(n_scalars);
2546 for (
unsigned int component = 0; component < n_scalars; ++component)
2547 scalars.emplace_back(fe_values, component);
2552 const unsigned int n_vectors =
2557 vectors.reserve(n_vectors);
2558 for (
unsigned int component = 0; component < n_vectors; ++component)
2559 vectors.emplace_back(fe_values, component);
2562 const unsigned int n_symmetric_second_order_tensors =
2568 symmetric_second_order_tensors.reserve(n_symmetric_second_order_tensors);
2569 for (
unsigned int component = 0;
2570 component < n_symmetric_second_order_tensors;
2572 symmetric_second_order_tensors.emplace_back(fe_values, component);
2576 const unsigned int n_second_order_tensors =
2581 second_order_tensors.reserve(n_second_order_tensors);
2582 for (
unsigned int component = 0; component < n_second_order_tensors;
2584 second_order_tensors.emplace_back(fe_values, component);
2593template <
int dim,
int spacedim>
2595 : initialized(false)
2596 , cell(typename
Triangulation<dim, spacedim>::cell_iterator(nullptr, -1, -1))
2597 , dof_handler(nullptr)
2598 , level_dof_access(false)
2603template <
int dim,
int spacedim>
2608 , dof_handler(nullptr)
2609 , level_dof_access(false)
2614template <
int dim,
int spacedim>
2623template <
int dim,
int spacedim>
2634template <
int dim,
int spacedim>
2640 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2642 return dof_handler->n_dofs();
2647template <
int dim,
int spacedim>
2648template <
typename VectorType>
2651 const VectorType & in,
2655 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2657 if (level_dof_access)
2673template <
int dim,
int spacedim>
2680 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2684 &cell->get_triangulation(), cell->level(), cell->index(), dof_handler);
2687 cell_dofs.
get_fe().n_dofs_per_cell());
2690 for (
unsigned int i = 0; i < cell_dofs.
get_fe().n_dofs_per_cell(); ++i)
2698 namespace FEValuesImplementation
2700 template <
int dim,
int spacedim>
2703 const unsigned int n_quadrature_points,
2710 this->shape_function_to_row_table =
2715 unsigned int n_nonzero_shape_components = 0;
2725 this->shape_values.reinit(n_nonzero_shape_components,
2726 n_quadrature_points);
2727 this->shape_values.fill(numbers::signaling_nan<double>());
2732 this->shape_gradients.reinit(n_nonzero_shape_components,
2733 n_quadrature_points);
2734 this->shape_gradients.fill(
2740 this->shape_hessians.reinit(n_nonzero_shape_components,
2741 n_quadrature_points);
2742 this->shape_hessians.fill(
2748 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
2749 n_quadrature_points);
2750 this->shape_3rd_derivatives.fill(
2757 template <
int dim,
int spacedim>
2776template <
int dim,
int spacedim>
2778 const unsigned int n_q_points,
2787 ,
fe(&
fe, typeid(*this).name())
2792 ExcMessage(
"There is nothing useful you can do with an FEValues "
2793 "object when using a quadrature formula with zero "
2794 "quadrature points!"));
2800template <
int dim,
int spacedim>
2803 tria_listener_refinement.disconnect();
2804 tria_listener_mesh_transform.disconnect();
2818 template <
typename Number,
typename Number2>
2821 const ::Table<2, double> &shape_values,
2822 std::vector<Number> & values)
2825 const unsigned int dofs_per_cell = shape_values.n_rows();
2826 const unsigned int n_quadrature_points = values.size();
2829 std::fill_n(values.begin(),
2830 n_quadrature_points,
2840 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
2842 const Number2
value = dof_values[shape_func];
2850 const double *shape_value_ptr = &shape_values(shape_func, 0);
2851 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
2852 values[point] +=
value * (*shape_value_ptr++);
2858 template <
int dim,
int spacedim,
typename VectorType>
2862 const ::Table<2, double> & shape_values,
2864 const std::vector<unsigned int> &shape_function_to_row_table,
2866 const bool quadrature_points_fastest =
false,
2867 const unsigned int component_multiple = 1)
2869 using Number =
typename VectorType::value_type;
2871 for (
unsigned int i = 0; i < values.size(); ++i)
2872 std::fill_n(values[i].begin(),
2874 typename VectorType::value_type());
2879 if (dofs_per_cell == 0)
2882 const unsigned int n_quadrature_points =
2883 quadrature_points_fastest ? values[0].size() : values.size();
2887 const unsigned result_components = n_components * component_multiple;
2888 (void)result_components;
2889 if (quadrature_points_fastest)
2892 for (
unsigned int i = 0; i < values.size(); ++i)
2898 for (
unsigned int i = 0; i < values.size(); ++i)
2905 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
2906 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
2909 const Number &
value = dof_values[shape_func + mc * dofs_per_cell];
2913 if (::internal::CheckForZero<Number>::value(
value) ==
true)
2918 const unsigned int comp =
2921 const unsigned int row =
2922 shape_function_to_row_table[shape_func * n_components + comp];
2924 const double *shape_value_ptr = &shape_values(row, 0);
2926 if (quadrature_points_fastest)
2928 VectorType &values_comp = values[comp];
2929 for (
unsigned int point = 0; point < n_quadrature_points;
2931 values_comp[point] +=
value * (*shape_value_ptr++);
2934 for (
unsigned int point = 0; point < n_quadrature_points;
2936 values[point][comp] +=
value * (*shape_value_ptr++);
2939 for (
unsigned int c = 0; c < n_components; ++c)
2944 const unsigned int row =
2945 shape_function_to_row_table[shape_func * n_components + c];
2947 const double * shape_value_ptr = &shape_values(row, 0);
2948 const unsigned int comp = c + mc * n_components;
2950 if (quadrature_points_fastest)
2952 VectorType &values_comp = values[comp];
2953 for (
unsigned int point = 0; point < n_quadrature_points;
2955 values_comp[point] +=
value * (*shape_value_ptr++);
2958 for (
unsigned int point = 0; point < n_quadrature_points;
2960 values[point][comp] +=
value * (*shape_value_ptr++);
2969 template <
int order,
int spacedim,
typename Number>
2976 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
2977 const unsigned int n_quadrature_points = derivatives.size();
2980 std::fill_n(derivatives.begin(),
2981 n_quadrature_points,
2991 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
2993 const Number &
value = dof_values[shape_func];
2997 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3001 &shape_derivatives[shape_func][0];
3002 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
3003 derivatives[point] +=
value * (*shape_derivative_ptr++);
3009 template <
int order,
int dim,
int spacedim,
typename Number>
3015 const std::vector<unsigned int> &shape_function_to_row_table,
3017 const bool quadrature_points_fastest =
false,
3018 const unsigned int component_multiple = 1)
3021 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3022 std::fill_n(derivatives[i].begin(),
3023 derivatives[i].size(),
3029 if (dofs_per_cell == 0)
3033 const unsigned int n_quadrature_points =
3034 quadrature_points_fastest ? derivatives[0].size() : derivatives.size();
3038 const unsigned result_components = n_components * component_multiple;
3039 (void)result_components;
3040 if (quadrature_points_fastest)
3043 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3049 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3056 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3057 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3060 const Number &
value = dof_values[shape_func + mc * dofs_per_cell];
3064 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3069 const unsigned int comp =
3072 const unsigned int row =
3073 shape_function_to_row_table[shape_func * n_components + comp];
3076 &shape_derivatives[row][0];
3078 if (quadrature_points_fastest)
3079 for (
unsigned int point = 0; point < n_quadrature_points;
3081 derivatives[comp][point] +=
value * (*shape_derivative_ptr++);
3083 for (
unsigned int point = 0; point < n_quadrature_points;
3085 derivatives[point][comp] +=
value * (*shape_derivative_ptr++);
3088 for (
unsigned int c = 0; c < n_components; ++c)
3093 const unsigned int row =
3094 shape_function_to_row_table[shape_func * n_components + c];
3097 &shape_derivatives[row][0];
3098 const unsigned int comp = c + mc * n_components;
3100 if (quadrature_points_fastest)
3101 for (
unsigned int point = 0; point < n_quadrature_points;
3103 derivatives[comp][point] +=
3104 value * (*shape_derivative_ptr++);
3106 for (
unsigned int point = 0; point < n_quadrature_points;
3108 derivatives[point][comp] +=
3109 value * (*shape_derivative_ptr++);
3116 template <
int spacedim,
typename Number,
typename Number2>
3121 std::vector<Number> & laplacians)
3123 const unsigned int dofs_per_cell = shape_hessians.size()[0];
3124 const unsigned int n_quadrature_points = laplacians.size();
3127 std::fill_n(laplacians.begin(),
3128 n_quadrature_points,
3134 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3136 const Number2
value = dof_values[shape_func];
3145 &shape_hessians[shape_func][0];
3146 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
3147 laplacians[point] +=
value *
trace(*shape_hessian_ptr++);
3153 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3159 const std::vector<unsigned int> & shape_function_to_row_table,
3160 std::vector<VectorType> & laplacians,
3161 const bool quadrature_points_fastest =
false,
3162 const unsigned int component_multiple = 1)
3165 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3166 std::fill_n(laplacians[i].begin(),
3167 laplacians[i].size(),
3168 typename VectorType::value_type());
3173 if (dofs_per_cell == 0)
3177 const unsigned int n_quadrature_points = laplacians.size();
3181 const unsigned result_components = n_components * component_multiple;
3182 (void)result_components;
3183 if (quadrature_points_fastest)
3186 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3192 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3199 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3200 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3203 const Number &
value = dof_values[shape_func + mc * dofs_per_cell];
3207 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3212 const unsigned int comp =
3215 const unsigned int row =
3216 shape_function_to_row_table[shape_func * n_components + comp];
3219 &shape_hessians[row][0];
3220 if (quadrature_points_fastest)
3222 VectorType &laplacians_comp = laplacians[comp];
3223 for (
unsigned int point = 0; point < n_quadrature_points;
3225 laplacians_comp[point] +=
3229 for (
unsigned int point = 0; point < n_quadrature_points;
3231 laplacians[point][comp] +=
3235 for (
unsigned int c = 0; c < n_components; ++c)
3240 const unsigned int row =
3241 shape_function_to_row_table[shape_func * n_components + c];
3244 &shape_hessians[row][0];
3245 const unsigned int comp = c + mc * n_components;
3247 if (quadrature_points_fastest)
3249 VectorType &laplacians_comp = laplacians[comp];
3250 for (
unsigned int point = 0; point < n_quadrature_points;
3252 laplacians_comp[point] +=
3256 for (
unsigned int point = 0; point < n_quadrature_points;
3258 laplacians[point][comp] +=
3267template <
int dim,
int spacedim>
3268template <
class InputVector>
3271 const InputVector & fe_function,
3272 std::vector<typename InputVector::value_type> &values)
const
3274 using Number =
typename InputVector::value_type;
3276 ExcAccessToUninitializedField(
"update_values"));
3278 Assert(present_cell.is_initialized(), ExcNotReinited());
3279 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3283 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3286 this->finite_element_output.shape_values,
3292template <
int dim,
int spacedim>
3293template <
class InputVector>
3296 const InputVector & fe_function,
3298 std::vector<typename InputVector::value_type> & values)
const
3300 using Number =
typename InputVector::value_type;
3302 ExcAccessToUninitializedField(
"update_values"));
3306 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3307 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3311 this->finite_element_output.shape_values,
3317template <
int dim,
int spacedim>
3318template <
class InputVector>
3321 const InputVector & fe_function,
3324 using Number =
typename InputVector::value_type;
3325 Assert(present_cell.is_initialized(), ExcNotReinited());
3328 ExcAccessToUninitializedField(
"update_values"));
3329 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3333 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3336 this->finite_element_output.shape_values,
3338 this->finite_element_output.shape_function_to_row_table,
3344template <
int dim,
int spacedim>
3345template <
class InputVector>
3348 const InputVector & fe_function,
3352 using Number =
typename InputVector::value_type;
3358 ExcAccessToUninitializedField(
"update_values"));
3360 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3361 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3365 this->finite_element_output.shape_values,
3367 this->finite_element_output.shape_function_to_row_table,
3370 indices.
size() / dofs_per_cell);
3375template <
int dim,
int spacedim>
3376template <
class InputVector>
3379 const InputVector & fe_function,
3381 ArrayView<std::vector<typename InputVector::value_type>> values,
3382 const bool quadrature_points_fastest)
const
3384 using Number =
typename InputVector::value_type;
3386 ExcAccessToUninitializedField(
"update_values"));
3393 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3394 for (
unsigned int i = 0; i < indices.
size(); ++i)
3398 this->finite_element_output.shape_values,
3400 this->finite_element_output.shape_function_to_row_table,
3402 quadrature_points_fastest,
3403 indices.
size() / dofs_per_cell);
3408template <
int dim,
int spacedim>
3409template <
class InputVector>
3412 const InputVector &fe_function,
3416 using Number =
typename InputVector::value_type;
3418 ExcAccessToUninitializedField(
"update_gradients"));
3420 Assert(present_cell.is_initialized(), ExcNotReinited());
3421 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3425 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3428 this->finite_element_output.shape_gradients,
3434template <
int dim,
int spacedim>
3435template <
class InputVector>
3438 const InputVector & fe_function,
3443 using Number =
typename InputVector::value_type;
3445 ExcAccessToUninitializedField(
"update_gradients"));
3449 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3450 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3454 this->finite_element_output.shape_gradients,
3460template <
int dim,
int spacedim>
3461template <
class InputVector>
3464 const InputVector &fe_function,
3469 using Number =
typename InputVector::value_type;
3471 ExcAccessToUninitializedField(
"update_gradients"));
3472 Assert(present_cell.is_initialized(), ExcNotReinited());
3473 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3477 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3480 this->finite_element_output.shape_gradients,
3482 this->finite_element_output.shape_function_to_row_table,
3488template <
int dim,
int spacedim>
3489template <
class InputVector>
3492 const InputVector & fe_function,
3496 const bool quadrature_points_fastest)
const
3498 using Number =
typename InputVector::value_type;
3504 ExcAccessToUninitializedField(
"update_gradients"));
3506 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3507 for (
unsigned int i = 0; i < indices.
size(); ++i)
3511 this->finite_element_output.shape_gradients,
3513 this->finite_element_output.shape_function_to_row_table,
3515 quadrature_points_fastest,
3516 indices.
size() / dofs_per_cell);
3521template <
int dim,
int spacedim>
3522template <
class InputVector>
3525 const InputVector &fe_function,
3529 using Number =
typename InputVector::value_type;
3532 ExcAccessToUninitializedField(
"update_hessians"));
3533 Assert(present_cell.is_initialized(), ExcNotReinited());
3534 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3538 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3541 this->finite_element_output.shape_hessians,
3547template <
int dim,
int spacedim>
3548template <
class InputVector>
3551 const InputVector & fe_function,
3556 using Number =
typename InputVector::value_type;
3558 ExcAccessToUninitializedField(
"update_hessians"));
3559 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3562 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3563 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3567 this->finite_element_output.shape_hessians,
3573template <
int dim,
int spacedim>
3574template <
class InputVector>
3577 const InputVector &fe_function,
3581 const bool quadrature_points_fastest)
const
3583 using Number =
typename InputVector::value_type;
3585 ExcAccessToUninitializedField(
"update_hessians"));
3586 Assert(present_cell.is_initialized(), ExcNotReinited());
3587 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3591 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3594 this->finite_element_output.shape_hessians,
3596 this->finite_element_output.shape_function_to_row_table,
3598 quadrature_points_fastest);
3603template <
int dim,
int spacedim>
3604template <
class InputVector>
3607 const InputVector & fe_function,
3611 const bool quadrature_points_fastest)
const
3613 using Number =
typename InputVector::value_type;
3615 ExcAccessToUninitializedField(
"update_hessians"));
3619 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3620 for (
unsigned int i = 0; i < indices.
size(); ++i)
3624 this->finite_element_output.shape_hessians,
3626 this->finite_element_output.shape_function_to_row_table,
3628 quadrature_points_fastest,
3629 indices.
size() / dofs_per_cell);
3634template <
int dim,
int spacedim>
3635template <
class InputVector>
3638 const InputVector & fe_function,
3639 std::vector<typename InputVector::value_type> &laplacians)
const
3641 using Number =
typename InputVector::value_type;
3643 ExcAccessToUninitializedField(
"update_hessians"));
3645 Assert(present_cell.is_initialized(), ExcNotReinited());
3646 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3650 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3653 this->finite_element_output.shape_hessians,
3659template <
int dim,
int spacedim>
3660template <
class InputVector>
3663 const InputVector & fe_function,
3665 std::vector<typename InputVector::value_type> & laplacians)
const
3667 using Number =
typename InputVector::value_type;
3669 ExcAccessToUninitializedField(
"update_hessians"));
3673 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3674 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3678 this->finite_element_output.shape_hessians,
3684template <
int dim,
int spacedim>
3685template <
class InputVector>
3688 const InputVector & fe_function,
3691 using Number =
typename InputVector::value_type;
3692 Assert(present_cell.is_initialized(), ExcNotReinited());
3694 ExcAccessToUninitializedField(
"update_hessians"));
3695 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3699 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3702 this->finite_element_output.shape_hessians,
3704 this->finite_element_output.shape_function_to_row_table,
3710template <
int dim,
int spacedim>
3711template <
class InputVector>
3714 const InputVector & fe_function,
3718 using Number =
typename InputVector::value_type;
3724 ExcAccessToUninitializedField(
"update_hessians"));
3726 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3727 for (
unsigned int i = 0; i < indices.
size(); ++i)
3731 this->finite_element_output.shape_hessians,
3733 this->finite_element_output.shape_function_to_row_table,
3736 indices.
size() / dofs_per_cell);
3741template <
int dim,
int spacedim>
3742template <
class InputVector>
3745 const InputVector & fe_function,
3747 std::vector<std::vector<typename InputVector::value_type>> &laplacians,
3748 const bool quadrature_points_fastest)
const
3750 using Number =
typename InputVector::value_type;
3754 ExcAccessToUninitializedField(
"update_hessians"));
3756 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3757 for (
unsigned int i = 0; i < indices.
size(); ++i)
3761 this->finite_element_output.shape_hessians,
3763 this->finite_element_output.shape_function_to_row_table,
3765 quadrature_points_fastest,
3766 indices.
size() / dofs_per_cell);
3771template <
int dim,
int spacedim>
3772template <
class InputVector>
3775 const InputVector &fe_function,
3777 &third_derivatives)
const
3779 using Number =
typename InputVector::value_type;
3782 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3783 Assert(present_cell.is_initialized(), ExcNotReinited());
3784 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3788 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3791 this->finite_element_output.shape_3rd_derivatives,
3797template <
int dim,
int spacedim>
3798template <
class InputVector>
3801 const InputVector & fe_function,
3804 &third_derivatives)
const
3806 using Number =
typename InputVector::value_type;
3808 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3809 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3812 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3813 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3817 this->finite_element_output.shape_3rd_derivatives,
3823template <
int dim,
int spacedim>
3824template <
class InputVector>
3827 const InputVector &fe_function,
3830 & third_derivatives,
3831 const bool quadrature_points_fastest)
const
3833 using Number =
typename InputVector::value_type;
3835 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3836 Assert(present_cell.is_initialized(), ExcNotReinited());
3837 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
3841 present_cell.get_interpolated_dof_values(fe_function, dof_values);
3844 this->finite_element_output.shape_3rd_derivatives,
3846 this->finite_element_output.shape_function_to_row_table,
3848 quadrature_points_fastest);
3853template <
int dim,
int spacedim>
3854template <
class InputVector>
3857 const InputVector & fe_function,
3861 const bool quadrature_points_fastest)
const
3863 using Number =
typename InputVector::value_type;
3865 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3869 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3870 for (
unsigned int i = 0; i < indices.
size(); ++i)
3874 this->finite_element_output.shape_3rd_derivatives,
3876 this->finite_element_output.shape_function_to_row_table,
3878 quadrature_points_fastest,
3884template <
int dim,
int spacedim>
3888 return present_cell;
3893template <
int dim,
int spacedim>
3894const std::vector<Tensor<1, spacedim>> &
3899 "update_normal_vectors")));
3901 return this->mapping_output.normal_vectors;
3906template <
int dim,
int spacedim>
3910 return (
sizeof(this->update_flags) +
3913 sizeof(cell_similarity) +
3927template <
int dim,
int spacedim>
3939 flags |= mapping->requires_update_flags(flags);
3946template <
int dim,
int spacedim>
3957 tria_listener_refinement.disconnect();
3958 tria_listener_mesh_transform.disconnect();
3964template <
int dim,
int spacedim>
3969 if (present_cell.is_initialized())
3971 if (&cell->get_triangulation() !=
3975 ->get_triangulation())
3982 invalidate_present_cell();
3983 tria_listener_refinement =
3984 cell->get_triangulation().signals.any_change.connect(
3985 [
this]() { this->invalidate_present_cell(); });
3986 tria_listener_mesh_transform =
3987 cell->get_triangulation().signals.mesh_movement.connect(
3988 [
this]() { this->invalidate_present_cell(); });
3996 tria_listener_refinement =
3997 cell->get_triangulation().signals.post_refinement.connect(
3998 [
this]() { this->invalidate_present_cell(); });
3999 tria_listener_mesh_transform =
4000 cell->get_triangulation().signals.mesh_movement.connect(
4001 [
this]() { this->invalidate_present_cell(); });
4007template <
int dim,
int spacedim>
4034 if (this->present_cell.is_initialized() ==
false)
4043 (cell->is_translation_of(
4045 &
>(this->present_cell)) ?
4052 &
>(this->present_cell)
4053 ->direction_flag() != cell->direction_flag())
4062template <
int dim,
int spacedim>
4066 return cell_similarity;
4071template <
int dim,
int spacedim>
4076template <
int dim,
int spacedim>
4081template <
int dim,
int spacedim>
4086template <
int dim,
int spacedim>
4092 fe.n_dofs_per_cell(),
4103template <
int dim,
int spacedim>
4108 :
FEValues(mapping, fe, q[0], update_flags)
4115template <
int dim,
int spacedim>
4121 fe.n_dofs_per_cell(),
4132template <
int dim,
int spacedim>
4143template <
int dim,
int spacedim>
4149 if (dim != spacedim - 1)
4151 ExcMessage(
"You can only pass the 'update_normal_vectors' "
4152 "flag to FEFaceValues or FESubfaceValues objects, "
4153 "but not to an FEValues object unless the "
4154 "triangulation it refers to is embedded in a higher "
4155 "dimensional space."));
4157 const UpdateFlags flags = this->compute_update_flags(update_flags);
4161 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4162 this->finite_element_output.initialize(this->max_n_quadrature_points,
4169 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4174 this->finite_element_output);
4178 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4182 [&]() {
return this->mapping->get_data(flags, quadrature); });
4184 this->update_flags = flags;
4187 this->fe_data = std::move(fe_get_data.return_value());
4189 this->mapping_data = std::move(mapping_get_data.return_value());
4191 this->mapping_data =
4192 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4197template <
int dim,
int spacedim>
4203 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4205 "You are trying to call FEValues::reinit() with a cell of type " +
4206 cell->reference_cell().to_string() +
4207 " with a Mapping that is not compatible with it."));
4211 this->maybe_invalidate_previous_present_cell(cell);
4212 this->check_cell_similarity(cell);
4214 this->present_cell = {cell};
4224template <
int dim,
int spacedim>
4237 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4239 "You are trying to call FEValues::reinit() with a cell of type " +
4240 cell->reference_cell().to_string() +
4241 " with a Mapping that is not compatible with it."));
4243 this->maybe_invalidate_previous_present_cell(cell);
4244 this->check_cell_similarity(cell);
4246 this->present_cell = {cell};
4256template <
int dim,
int spacedim>
4266 this->cell_similarity =
4267 this->get_mapping().fill_fe_values(this->present_cell,
4268 this->cell_similarity,
4270 *this->mapping_data,
4271 this->mapping_output);
4278 this->get_fe().fill_fe_values(this->present_cell,
4279 this->cell_similarity,
4281 this->get_mapping(),
4282 *this->mapping_data,
4283 this->mapping_output,
4285 this->finite_element_output);
4290template <
int dim,
int spacedim>
4302template <
int dim,
int spacedim>
4304 const unsigned int dofs_per_cell,
4313 hp::QCollection<dim - 1>(quadrature))
4318template <
int dim,
int spacedim>
4320 const unsigned int dofs_per_cell,
4325 :
FEValuesBase<dim, spacedim>(quadrature.max_n_quadrature_points(),
4330 , present_face_index(
numbers::invalid_unsigned_int)
4331 , quadrature(quadrature)
4334 quadrature.
size() ==
fe.reference_cell().n_faces(),
4340template <
int dim,
int spacedim>
4341const std::vector<Tensor<1, spacedim>> &
4346 "update_boundary_forms")));
4347 return this->mapping_output.boundary_forms;
4352template <
int dim,
int spacedim>
4363template <
int dim,
int spacedim>
4368template <
int dim,
int spacedim>
4373template <
int dim,
int spacedim>
4381 hp::QCollection<dim - 1>(quadrature),
4387template <
int dim,
int spacedim>
4404template <
int dim,
int spacedim>
4410 hp::QCollection<dim - 1>(quadrature),
4416template <
int dim,
int spacedim>
4422 fe.n_dofs_per_cell(),
4433template <
int dim,
int spacedim>
4437 const UpdateFlags flags = this->compute_update_flags(update_flags);
4441 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4442 this->finite_element_output.initialize(this->max_n_quadrature_points,
4449 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase> (
4458 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> (
4465 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4471 this->finite_element_output);
4473 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4481 this->update_flags = flags;
4484 this->fe_data = std::move(fe_get_data.return_value());
4486 this->mapping_data = std::move(mapping_get_data.return_value());
4488 this->mapping_data =
4489 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4494template <
int dim,
int spacedim>
4499 const unsigned int face_no)
4505 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4510 this->maybe_invalidate_previous_present_cell(cell);
4511 this->present_cell = {cell};
4521template <
int dim,
int spacedim>
4528 const auto face_n = cell->face_iterator_to_index(face);
4534template <
int dim,
int spacedim>
4538 const unsigned int face_no)
4542 this->maybe_invalidate_previous_present_cell(cell);
4543 this->present_cell = {cell};
4553template <
int dim,
int spacedim>
4559 const auto face_n = cell->face_iterator_to_index(face);
4565template <
int dim,
int spacedim>
4569 this->present_face_no = face_no;
4574 this->present_face_index = cell->face_index(face_no);
4578 this->get_mapping().fill_fe_face_values(this->present_cell,
4581 *this->mapping_data,
4582 this->mapping_output);
4585 this->get_fe().fill_fe_face_values(this->present_cell,
4588 this->get_mapping(),
4589 *this->mapping_data,
4590 this->mapping_output,
4592 this->finite_element_output);
4594 const_cast<unsigned int &
>(this->n_quadrature_points) =
4595 this->quadrature[this->quadrature.
size() == 1 ? 0 : face_no].
size();
4602template <
int dim,
int spacedim>
4607template <
int dim,
int spacedim>
4612template <
int dim,
int spacedim>
4629template <
int dim,
int spacedim>
4642template <
int dim,
int spacedim>
4648 fe.n_dofs_per_cell(),
4659template <
int dim,
int spacedim>
4671template <
int dim,
int spacedim>
4675 const UpdateFlags flags = this->compute_update_flags(update_flags);
4679 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4680 this->finite_element_output.initialize(this->max_n_quadrature_points,
4688 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4694 this->quadrature[0],
4695 this->finite_element_output);
4697 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4704 this->quadrature[0]);
4706 this->update_flags = flags;
4709 this->fe_data = std::move(fe_get_data.return_value());
4711 this->mapping_data = std::move(mapping_get_data.return_value());
4713 this->mapping_data =
4714 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4719template <
int dim,
int spacedim>
4724 const unsigned int face_no,
4725 const unsigned int subface_no)
4731 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4738 Assert(cell->face(face_no)->has_children() ||
4743 Assert(!cell->face(face_no)->has_children() ||
4744 subface_no < cell->face(face_no)->n_active_descendants(),
4747 cell->face(face_no)->n_active_descendants()));
4748 Assert(cell->has_children() ==
false,
4749 ExcMessage(
"You can't use subface data for cells that are "
4750 "already refined. Iterate over their children "
4751 "instead in these cases."));
4753 this->maybe_invalidate_previous_present_cell(cell);
4754 this->present_cell = {cell};
4759 do_reinit(face_no, subface_no);
4764template <
int dim,
int spacedim>
4773 cell->face_iterator_to_index(face),
4774 face->child_iterator_to_index(subface));
4779template <
int dim,
int spacedim>
4783 const unsigned int face_no,
4784 const unsigned int subface_no)
4792 (cell->has_periodic_neighbor(face_no) ?
4793 cell->periodic_neighbor(face_no)
4794 ->face(cell->periodic_neighbor_face_no(face_no))
4796 cell->face(face_no)->n_children()));
4798 this->maybe_invalidate_previous_present_cell(cell);
4799 this->present_cell = {cell};
4804 do_reinit(face_no, subface_no);
4809template <
int dim,
int spacedim>
4817 cell->face_iterator_to_index(face),
4818 face->child_iterator_to_index(subface));
4823template <
int dim,
int spacedim>
4826 const unsigned int subface_no)
4828 this->present_face_no = face_no;
4834 if (!cell->face(face_no)->has_children())
4837 this->present_face_index = cell->face_index(face_no);
4839 this->present_face_index = cell->face(face_no)->child_index(subface_no);
4845 switch (cell->subface_case(face_no))
4850 subface_index = cell->face(face_no)->child_index(subface_no);
4854 subface_index = cell->face(face_no)
4855 ->child(subface_no / 2)
4856 ->child_index(subface_no % 2);
4865 cell->face(face_no)->child(0)->child_index(subface_no);
4868 subface_index = cell->face(face_no)->child_index(1);
4879 subface_index = cell->face(face_no)->child_index(0);
4884 cell->face(face_no)->child(1)->child_index(subface_no - 1);
4896 this->present_face_index = subface_index;
4902 this->get_mapping().fill_fe_subface_values(this->present_cell,
4905 this->quadrature[0],
4906 *this->mapping_data,
4907 this->mapping_output);
4910 this->get_fe().fill_fe_subface_values(this->present_cell,
4913 this->quadrature[0],
4914 this->get_mapping(),
4915 *this->mapping_data,
4916 this->mapping_output,
4918 this->finite_element_output);
4923#define SPLIT_INSTANTIATIONS_COUNT 6
4924#ifndef SPLIT_INSTANTIATIONS_INDEX
4925# define SPLIT_INSTANTIATIONS_INDEX 0
4927#include "fe_values.inst"
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
const FiniteElement< dimension_, space_dimension_ > & get_fe() const
void get_interpolated_dof_values(const InputVector &values, Vector< number > &interpolated_values, const types::fe_index fe_index=numbers::invalid_fe_index) const
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
FEFaceValuesBase(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)
std::size_t memory_consumption() const
const std::vector< Tensor< 1, spacedim > > & get_boundary_forms() const
void initialize(const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no)
void do_reinit(const unsigned int face_no)
FEFaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature, const UpdateFlags update_flags)
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &face_quadrature, const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
void initialize(const UpdateFlags update_flags)
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
bool is_initialized() const
void get_interpolated_dof_values(const VectorType &in, Vector< typename VectorType::value_type > &out) const
types::global_dof_index n_dofs_for_dof_handler() const
CellSimilarity::Similarity cell_similarity
CellIteratorContainer present_cell
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
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)
virtual ~FEValuesBase() override
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
const unsigned int dofs_per_cell
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
const unsigned int n_quadrature_points
CellSimilarity::Similarity get_cell_similarity() const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
std::size_t memory_consumption() const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename InputVector::value_type > &laplacians) const
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
void invalidate_present_cell()
::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > finite_element_output
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
const FiniteElement< dim, spacedim > & get_fe() const
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const unsigned int max_n_quadrature_points
void get_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type > > &third_derivatives) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
typename ProductType< Number, hessian_type >::type solution_hessian_type
const unsigned int component
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
std::vector< ShapeFunctionData > shape_function_data
void get_function_laplacians(const InputVector &fe_function, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
typename ProductType< Number, value_type >::type solution_laplacian_type
void get_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
typename ProductType< Number, value_type >::type solution_value_type
typename ProductType< Number, gradient_type >::type solution_gradient_type
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
void get_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename ProductType< Number, value_type >::type solution_value_type
typename ProductType< Number, divergence_type >::type solution_divergence_type
typename ProductType< Number, value_type >::type solution_value_type
typename ProductType< Number, divergence_type >::type solution_divergence_type
typename ProductType< Number, gradient_type >::type solution_gradient_type
void get_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
void get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_symmetric_gradient_type< typename InputVector::value_type > > &symmetric_gradients) const
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
typename ProductType< Number, divergence_type >::type solution_divergence_type
typename ProductType< Number, hessian_type >::type solution_hessian_type
typename ProductType< Number, symmetric_gradient_type >::type solution_symmetric_gradient_type
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
typename ProductType< Number, gradient_type >::type solution_gradient_type
void get_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
typename ProductType< Number, value_type >::type solution_value_type
void get_function_curls_from_local_dof_values(const InputVector &dof_values, std::vector< solution_curl_type< typename InputVector::value_type > > &curls) const
void get_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
const unsigned int first_vector_component
typename ProductType< Number, curl_type >::type solution_curl_type
std::vector< ShapeFunctionData > shape_function_data
void get_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< solution_symmetric_gradient_type< typename InputVector::value_type > > &symmetric_gradients) const
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_laplacians(const InputVector &fe_function, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
typename ProductType< Number, value_type >::type solution_laplacian_type
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_function_curls(const InputVector &fe_function, std::vector< solution_curl_type< typename InputVector::value_type > > &curls) const
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< solution_divergence_type< typename InputVector::value_type > > &divergences) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_function_divergences(const InputVector &fe_function, std::vector< solution_divergence_type< typename InputVector::value_type > > &divergences) const
FEValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags update_flags)
void initialize(const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
std::size_t memory_consumption() const
unsigned int n_dofs_per_cell() const
unsigned int n_components() const
virtual std::unique_ptr< InternalDataBase > get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
const ComponentMask & get_nonzero_components(const unsigned int i) const
bool is_primitive() const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
unsigned int n_nonzero_components(const unsigned int i) const
bool is_element(const size_type index) const
Abstract base class for mapping classes.
static unsigned int n_threads()
static DEAL_II_HOST constexpr unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
static DEAL_II_HOST constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
DEAL_II_HOST constexpr SymmetricTensor()=default
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotReinited()
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_gradients
Shape function gradients.
@ update_default
No update.
@ update_boundary_forms
Outer normal vector, not normalized.
Task< RT > new_task(const std::function< RT()> &function)
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
void do_function_laplacians(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 2, spacedim > > &shape_hessians, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Scalar< dim, spacedim >::template solution_laplacian_type< Number > > &laplacians)
void do_function_values(const ArrayView< Number > &dof_values, const Table< 2, double > &shape_values, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, double >::type > &values)
void do_function_gradients(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Tensor< 2, dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Tensor< 2, dim, spacedim >::template solution_gradient_type< Number > > &gradients)
void do_function_divergences(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Vector< dim, spacedim >::template solution_divergence_type< Number > > &divergences)
void do_function_curls(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, typename ::internal::CurlType< spacedim >::type >::type > &curls)
void do_function_symmetric_gradients(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, ::SymmetricTensor< 2, spacedim > >::type > &symmetric_gradients)
void do_function_derivatives(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< order, spacedim > > &shape_derivatives, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, ::Tensor< order, spacedim > >::type > &derivatives)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
void do_function_laplacians(const ArrayView< Number2 > &dof_values, const ::Table< 2, Tensor< 2, spacedim > > &shape_hessians, std::vector< Number > &laplacians)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
VectorType::value_type get_vector_element(const VectorType &vector, const types::global_dof_index cell_number)
void do_function_derivatives(const ArrayView< Number > &dof_values, const ::Table< 2, Tensor< order, spacedim > > &shape_derivatives, std::vector< Tensor< order, spacedim, Number > > &derivatives)
std::vector< unsigned int > make_shape_function_to_row_table(const FiniteElement< dim, spacedim > &fe)
void do_function_values(const ArrayView< Number2 > &dof_values, const ::Table< 2, double > &shape_values, std::vector< Number > &values)
static const unsigned int invalid_unsigned_int
typename internal::ProductTypeImpl< typename std::decay< T >::type, typename std::decay< U >::type >::type type
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)
Cache(const FEValuesBase< dim, spacedim > &fe_values)
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE const T & value(const T &t)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
DEAL_II_HOST constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)