48#include <boost/container/small_vector.hpp>
60 template <
class VectorType>
62 const VectorType & vector,
79 template <
int dim,
int spacedim>
80 inline std::vector<unsigned int>
83 std::vector<unsigned int> shape_function_to_row_table(
92 unsigned int nth_nonzero_component = 0;
97 row + nth_nonzero_component;
98 ++nth_nonzero_component;
103 return shape_function_to_row_table;
110 template <
typename Number,
typename T =
void>
114 value(
const Number &value)
125 template <
typename Number>
128 typename
std::enable_if<
129 Differentiation::AD::is_ad_number<Number>::value>::type>
132 value(
const Number & )
144 template <
int dim,
int spacedim>
146 const unsigned int component)
147 : fe_values(&fe_values)
148 , component(component)
149 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
157 const std::vector<unsigned int> shape_function_to_row_table =
164 if (is_primitive ==
true)
181 template <
int dim,
int spacedim>
189 template <
int dim,
int spacedim>
191 const unsigned int first_vector_component)
192 : fe_values(&fe_values)
193 , first_vector_component(first_vector_component)
194 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
202 const std::vector<unsigned int> shape_function_to_row_table =
205 for (
unsigned int d = 0;
d < spacedim; ++
d)
213 if (is_primitive ==
true)
223 shape_function_to_row_table[i * fe.
n_components() + component];
232 unsigned int n_nonzero_components = 0;
233 for (
unsigned int d = 0;
d < spacedim; ++
d)
236 ++n_nonzero_components;
238 if (n_nonzero_components == 0)
240 else if (n_nonzero_components > 1)
244 for (
unsigned int d = 0;
d < spacedim; ++
d)
246 .is_nonzero_shape_function_component[
d] ==
true)
259 template <
int dim,
int spacedim>
267 template <
int dim,
int spacedim>
270 const unsigned int first_tensor_component)
271 : fe_values(&fe_values)
272 , first_tensor_component(first_tensor_component)
273 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
276 Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 <
279 first_tensor_component +
286 const std::vector<unsigned int> shape_function_to_row_table =
289 for (
unsigned int d = 0;
290 d < ::SymmetricTensor<2, dim>::n_independent_components;
293 const unsigned int component = first_tensor_component +
d;
299 if (is_primitive ==
true)
300 shape_function_data[i].is_nonzero_shape_function_component[
d] =
303 shape_function_data[i].is_nonzero_shape_function_component[
d] =
306 if (shape_function_data[i].is_nonzero_shape_function_component[
d] ==
308 shape_function_data[i].row_index[
d] =
309 shape_function_to_row_table[i * fe.
n_components() + component];
311 shape_function_data[i].row_index[
d] =
318 unsigned int n_nonzero_components = 0;
319 for (
unsigned int d = 0;
320 d < ::SymmetricTensor<2, dim>::n_independent_components;
322 if (shape_function_data[i].is_nonzero_shape_function_component[
d] ==
324 ++n_nonzero_components;
326 if (n_nonzero_components == 0)
327 shape_function_data[i].single_nonzero_component = -2;
328 else if (n_nonzero_components > 1)
329 shape_function_data[i].single_nonzero_component = -1;
332 for (
unsigned int d = 0;
333 d < ::SymmetricTensor<2, dim>::n_independent_components;
335 if (shape_function_data[i]
336 .is_nonzero_shape_function_component[
d] ==
true)
338 shape_function_data[i].single_nonzero_component =
339 shape_function_data[i].row_index[
d];
340 shape_function_data[i].single_nonzero_component_index =
d;
349 template <
int dim,
int spacedim>
357 template <
int dim,
int spacedim>
359 const unsigned int first_tensor_component)
360 : fe_values(&fe_values)
361 , first_tensor_component(first_tensor_component)
362 , shape_function_data(this->fe_values->fe->n_dofs_per_cell())
369 const std::vector<unsigned int> shape_function_to_row_table =
372 for (
unsigned int d = 0;
d < dim * dim; ++
d)
374 const unsigned int component = first_tensor_component +
d;
380 if (is_primitive ==
true)
381 shape_function_data[i].is_nonzero_shape_function_component[
d] =
384 shape_function_data[i].is_nonzero_shape_function_component[
d] =
387 if (shape_function_data[i].is_nonzero_shape_function_component[
d] ==
389 shape_function_data[i].row_index[
d] =
390 shape_function_to_row_table[i * fe.
n_components() + component];
392 shape_function_data[i].row_index[
d] =
399 unsigned int n_nonzero_components = 0;
400 for (
unsigned int d = 0;
d < dim * dim; ++
d)
401 if (shape_function_data[i].is_nonzero_shape_function_component[
d] ==
403 ++n_nonzero_components;
405 if (n_nonzero_components == 0)
406 shape_function_data[i].single_nonzero_component = -2;
407 else if (n_nonzero_components > 1)
408 shape_function_data[i].single_nonzero_component = -1;
411 for (
unsigned int d = 0;
d < dim * dim; ++
d)
412 if (shape_function_data[i]
413 .is_nonzero_shape_function_component[
d] ==
true)
415 shape_function_data[i].single_nonzero_component =
416 shape_function_data[i].row_index[
d];
417 shape_function_data[i].single_nonzero_component_index =
d;
426 template <
int dim,
int spacedim>
440 template <
int dim,
int spacedim,
typename Number>
446 &shape_function_data,
449 const unsigned int dofs_per_cell = dof_values.
size();
450 const unsigned int n_quadrature_points =
values.size();
456 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
458 if (shape_function_data[shape_function]
459 .is_nonzero_shape_function_component)
461 const Number &value = dof_values[shape_function];
465 if (::internal::CheckForZero<Number>::value(value) ==
true)
468 const double *shape_value_ptr =
469 &shape_values(shape_function_data[shape_function].row_index, 0);
470 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
472 values[q_point] += value * (*shape_value_ptr++);
480 template <
int order,
int dim,
int spacedim,
typename Number>
486 &shape_function_data,
491 const unsigned int dofs_per_cell = dof_values.
size();
492 const unsigned int n_quadrature_points = derivatives.size();
499 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
501 if (shape_function_data[shape_function]
502 .is_nonzero_shape_function_component)
504 const Number &value = dof_values[shape_function];
508 if (::internal::CheckForZero<Number>::value(value) ==
true)
511 const ::Tensor<order, spacedim> *shape_derivative_ptr =
512 &shape_derivatives[shape_function_data[shape_function].row_index]
514 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
516 derivatives[q_point] += value * (*shape_derivative_ptr++);
522 template <
int dim,
int spacedim,
typename Number>
528 &shape_function_data,
532 const unsigned int dofs_per_cell = dof_values.
size();
533 const unsigned int n_quadrature_points = laplacians.size();
541 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
543 if (shape_function_data[shape_function]
544 .is_nonzero_shape_function_component)
546 const Number &value = dof_values[shape_function];
550 if (::internal::CheckForZero<Number>::value(value) ==
true)
553 const ::Tensor<2, spacedim> *shape_hessian_ptr =
554 &shape_hessians[shape_function_data[shape_function].row_index][0];
555 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
557 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
565 template <
int dim,
int spacedim,
typename Number>
571 &shape_function_data,
576 const unsigned int dofs_per_cell = dof_values.
size();
577 const unsigned int n_quadrature_points =
values.size();
584 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
588 shape_function_data[shape_function].single_nonzero_component;
594 const Number &value = dof_values[shape_function];
598 if (::internal::CheckForZero<Number>::value(value) ==
true)
603 const unsigned int comp = shape_function_data[shape_function]
604 .single_nonzero_component_index;
605 const double *shape_value_ptr = &shape_values(snc, 0);
606 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
608 values[q_point][comp] += value * (*shape_value_ptr++);
611 for (
unsigned int d = 0;
d < spacedim; ++
d)
612 if (shape_function_data[shape_function]
613 .is_nonzero_shape_function_component[
d])
615 const double *shape_value_ptr = &shape_values(
616 shape_function_data[shape_function].row_index[
d], 0);
617 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
619 values[q_point][
d] += value * (*shape_value_ptr++);
626 template <
int order,
int dim,
int spacedim,
typename Number>
632 &shape_function_data,
637 const unsigned int dofs_per_cell = dof_values.
size();
638 const unsigned int n_quadrature_points = derivatives.size();
646 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
650 shape_function_data[shape_function].single_nonzero_component;
656 const Number &value = dof_values[shape_function];
660 if (::internal::CheckForZero<Number>::value(value) ==
true)
665 const unsigned int comp = shape_function_data[shape_function]
666 .single_nonzero_component_index;
667 const ::Tensor<order, spacedim> *shape_derivative_ptr =
668 &shape_derivatives[snc][0];
669 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
671 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
674 for (
unsigned int d = 0;
d < spacedim; ++
d)
675 if (shape_function_data[shape_function]
676 .is_nonzero_shape_function_component[
d])
678 const ::Tensor<order, spacedim> *shape_derivative_ptr =
679 &shape_derivatives[shape_function_data[shape_function]
681 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
683 derivatives[q_point][
d] +=
684 value * (*shape_derivative_ptr++);
691 template <
int dim,
int spacedim,
typename Number>
697 &shape_function_data,
701 &symmetric_gradients)
703 const unsigned int dofs_per_cell = dof_values.
size();
704 const unsigned int n_quadrature_points = symmetric_gradients.size();
707 symmetric_gradients.begin(),
708 symmetric_gradients.end(),
712 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
716 shape_function_data[shape_function].single_nonzero_component;
722 const Number &value = dof_values[shape_function];
726 if (::internal::CheckForZero<Number>::value(value) ==
true)
731 const unsigned int comp = shape_function_data[shape_function]
732 .single_nonzero_component_index;
733 const ::Tensor<1, spacedim> *shape_gradient_ptr =
734 &shape_gradients[snc][0];
735 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
737 symmetric_gradients[q_point] +=
739 symmetrize_single_row(comp, *shape_gradient_ptr++));
742 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
747 for (
unsigned int d = 0;
d < spacedim; ++
d)
748 if (shape_function_data[shape_function]
749 .is_nonzero_shape_function_component[
d])
752 shape_gradients[shape_function_data[shape_function]
753 .row_index[
d]][q_point];
754 symmetric_gradients[q_point] +=
symmetrize(grad);
761 template <
int dim,
int spacedim,
typename Number>
767 &shape_function_data,
769 template solution_divergence_type<Number>> &divergences)
771 const unsigned int dofs_per_cell = dof_values.
size();
772 const unsigned int n_quadrature_points = divergences.size();
778 spacedim>::template solution_divergence_type<Number>());
780 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
784 shape_function_data[shape_function].single_nonzero_component;
790 const Number &value = dof_values[shape_function];
794 if (::internal::CheckForZero<Number>::value(value) ==
true)
799 const unsigned int comp = shape_function_data[shape_function]
800 .single_nonzero_component_index;
801 const ::Tensor<1, spacedim> *shape_gradient_ptr =
802 &shape_gradients[snc][0];
803 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
805 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
808 for (
unsigned int d = 0;
d < spacedim; ++
d)
809 if (shape_function_data[shape_function]
810 .is_nonzero_shape_function_component[
d])
812 const ::Tensor<1, spacedim> *shape_gradient_ptr =
813 &shape_gradients[shape_function_data[shape_function]
815 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
817 divergences[q_point] += value * (*shape_gradient_ptr++)[
d];
824 template <
int dim,
int spacedim,
typename Number>
830 &shape_function_data,
833 typename ::internal::CurlType<spacedim>::type>::type> &curls)
835 const unsigned int dofs_per_cell = dof_values.
size();
836 const unsigned int n_quadrature_points = curls.size();
838 std::fill(curls.begin(),
842 typename ::internal::CurlType<spacedim>::type>::type());
850 "Computing the curl in 1d is not a useful operation"));
856 for (
unsigned int shape_function = 0;
857 shape_function < dofs_per_cell;
860 const int snc = shape_function_data[shape_function]
861 .single_nonzero_component;
867 const Number &value = dof_values[shape_function];
871 if (::internal::CheckForZero<Number>::value(value) ==
877 const ::Tensor<1, spacedim> *shape_gradient_ptr =
878 &shape_gradients[snc][0];
880 Assert(shape_function_data[shape_function]
881 .single_nonzero_component >= 0,
884 if (shape_function_data[shape_function]
885 .single_nonzero_component_index == 0)
886 for (
unsigned int q_point = 0;
887 q_point < n_quadrature_points;
890 value * (*shape_gradient_ptr++)[1];
892 for (
unsigned int q_point = 0;
893 q_point < n_quadrature_points;
896 value * (*shape_gradient_ptr++)[0];
904 if (shape_function_data[shape_function]
905 .is_nonzero_shape_function_component[0])
908 spacedim> *shape_gradient_ptr =
909 &shape_gradients[shape_function_data[shape_function]
912 for (
unsigned int q_point = 0;
913 q_point < n_quadrature_points;
916 value * (*shape_gradient_ptr++)[1];
919 if (shape_function_data[shape_function]
920 .is_nonzero_shape_function_component[1])
923 spacedim> *shape_gradient_ptr =
924 &shape_gradients[shape_function_data[shape_function]
927 for (
unsigned int q_point = 0;
928 q_point < n_quadrature_points;
931 value * (*shape_gradient_ptr++)[0];
940 for (
unsigned int shape_function = 0;
941 shape_function < dofs_per_cell;
944 const int snc = shape_function_data[shape_function]
945 .single_nonzero_component;
951 const Number &value = dof_values[shape_function];
955 if (::internal::CheckForZero<Number>::value(value) ==
961 const ::Tensor<1, spacedim> *shape_gradient_ptr =
962 &shape_gradients[snc][0];
964 switch (shape_function_data[shape_function]
965 .single_nonzero_component_index)
969 for (
unsigned int q_point = 0;
970 q_point < n_quadrature_points;
974 value * (*shape_gradient_ptr)[2];
976 value * (*shape_gradient_ptr++)[1];
984 for (
unsigned int q_point = 0;
985 q_point < n_quadrature_points;
989 value * (*shape_gradient_ptr)[2];
991 value * (*shape_gradient_ptr++)[0];
999 for (
unsigned int q_point = 0;
1000 q_point < n_quadrature_points;
1003 curls[q_point][0] +=
1004 value * (*shape_gradient_ptr)[1];
1005 curls[q_point][1] -=
1006 value * (*shape_gradient_ptr++)[0];
1022 if (shape_function_data[shape_function]
1023 .is_nonzero_shape_function_component[0])
1026 spacedim> *shape_gradient_ptr =
1027 &shape_gradients[shape_function_data[shape_function]
1030 for (
unsigned int q_point = 0;
1031 q_point < n_quadrature_points;
1034 curls[q_point][1] +=
1035 value * (*shape_gradient_ptr)[2];
1036 curls[q_point][2] -=
1037 value * (*shape_gradient_ptr++)[1];
1041 if (shape_function_data[shape_function]
1042 .is_nonzero_shape_function_component[1])
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][0] -=
1054 value * (*shape_gradient_ptr)[2];
1055 curls[q_point][2] +=
1056 value * (*shape_gradient_ptr++)[0];
1060 if (shape_function_data[shape_function]
1061 .is_nonzero_shape_function_component[2])
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)[1];
1074 curls[q_point][1] -=
1075 value * (*shape_gradient_ptr++)[0];
1086 template <
int dim,
int spacedim,
typename Number>
1092 &shape_function_data,
1094 template solution_laplacian_type<Number>> &laplacians)
1096 const unsigned int dofs_per_cell = dof_values.
size();
1097 const unsigned int n_quadrature_points = laplacians.size();
1103 spacedim>::template solution_laplacian_type<Number>());
1105 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1109 shape_function_data[shape_function].single_nonzero_component;
1115 const Number &value = dof_values[shape_function];
1119 if (::internal::CheckForZero<Number>::value(value) ==
true)
1124 const unsigned int comp = shape_function_data[shape_function]
1125 .single_nonzero_component_index;
1126 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1127 &shape_hessians[snc][0];
1128 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1130 laplacians[q_point][comp] +=
1131 value *
trace(*shape_hessian_ptr++);
1134 for (
unsigned int d = 0;
d < spacedim; ++
d)
1135 if (shape_function_data[shape_function]
1136 .is_nonzero_shape_function_component[
d])
1138 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1139 &shape_hessians[shape_function_data[shape_function]
1141 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1143 laplacians[q_point][
d] +=
1144 value *
trace(*shape_hessian_ptr++);
1153 template <
int dim,
int spacedim,
typename Number>
1157 const ::Table<2, double> &shape_values,
1160 &shape_function_data,
1166 const unsigned int dofs_per_cell = dof_values.
size();
1167 const unsigned int n_quadrature_points =
values.size();
1175 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1179 shape_function_data[shape_function].single_nonzero_component;
1185 const Number &value = dof_values[shape_function];
1189 if (::internal::CheckForZero<Number>::value(value) ==
true)
1196 shape_function_data[shape_function]
1197 .single_nonzero_component_index);
1198 const double *shape_value_ptr = &shape_values(snc, 0);
1199 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1201 values[q_point][comp] += value * (*shape_value_ptr++);
1204 for (
unsigned int d = 0;
1208 if (shape_function_data[shape_function]
1209 .is_nonzero_shape_function_component[
d])
1214 const double *shape_value_ptr = &shape_values(
1215 shape_function_data[shape_function].row_index[
d], 0);
1216 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1218 values[q_point][comp] += value * (*shape_value_ptr++);
1225 template <
int dim,
int spacedim,
typename Number>
1232 &shape_function_data,
1236 const unsigned int dofs_per_cell = dof_values.
size();
1237 const unsigned int n_quadrature_points = divergences.size();
1239 std::fill(divergences.begin(),
1244 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1248 shape_function_data[shape_function].single_nonzero_component;
1254 const Number &value = dof_values[shape_function];
1258 if (::internal::CheckForZero<Number>::value(value) ==
true)
1263 const unsigned int comp = shape_function_data[shape_function]
1264 .single_nonzero_component_index;
1266 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1267 &shape_gradients[snc][0];
1274 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1275 ++q_point, ++shape_gradient_ptr)
1277 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1280 divergences[q_point][jj] +=
1281 value * (*shape_gradient_ptr)[ii];
1286 for (
unsigned int d = 0;
1289 spacedim>::n_independent_components;
1291 if (shape_function_data[shape_function]
1292 .is_nonzero_shape_function_component[
d])
1304 const unsigned int comp =
1305 shape_function_data[shape_function]
1306 .single_nonzero_component_index;
1308 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1309 &shape_gradients[shape_function_data[shape_function]
1311 for (
unsigned int q_point = 0;
1312 q_point < n_quadrature_points;
1313 ++q_point, ++shape_gradient_ptr)
1315 for (
unsigned int j = 0; j < spacedim; ++j)
1317 const unsigned int vector_component =
1321 divergences[q_point][vector_component] +=
1322 value * (*shape_gradient_ptr++)[j];
1332 template <
int dim,
int spacedim,
typename Number>
1336 const ::Table<2, double> &shape_values,
1338 &shape_function_data,
1343 const unsigned int dofs_per_cell = dof_values.
size();
1344 const unsigned int n_quadrature_points =
values.size();
1351 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1355 shape_function_data[shape_function].single_nonzero_component;
1361 const Number &value = dof_values[shape_function];
1365 if (::internal::CheckForZero<Number>::value(value) ==
true)
1370 const unsigned int comp = shape_function_data[shape_function]
1371 .single_nonzero_component_index;
1377 const double *shape_value_ptr = &shape_values(snc, 0);
1378 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1380 values[q_point][indices] += value * (*shape_value_ptr++);
1383 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1384 if (shape_function_data[shape_function]
1385 .is_nonzero_shape_function_component[
d])
1391 const double *shape_value_ptr = &shape_values(
1392 shape_function_data[shape_function].row_index[
d], 0);
1393 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1395 values[q_point][indices] += value * (*shape_value_ptr++);
1402 template <
int dim,
int spacedim,
typename Number>
1408 &shape_function_data,
1410 template solution_divergence_type<Number>> &divergences)
1412 const unsigned int dofs_per_cell = dof_values.
size();
1413 const unsigned int n_quadrature_points = divergences.size();
1416 divergences.begin(),
1421 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1425 shape_function_data[shape_function].single_nonzero_component;
1431 const Number &value = dof_values[shape_function];
1435 if (::internal::CheckForZero<Number>::value(value) ==
true)
1440 const unsigned int comp = shape_function_data[shape_function]
1441 .single_nonzero_component_index;
1443 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1444 &shape_gradients[snc][0];
1449 const unsigned int ii = indices[0];
1450 const unsigned int jj = indices[1];
1452 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1453 ++q_point, ++shape_gradient_ptr)
1455 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1460 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1461 if (shape_function_data[shape_function]
1462 .is_nonzero_shape_function_component[
d])
1472 template <
int dim,
int spacedim,
typename Number>
1478 &shape_function_data,
1480 template solution_gradient_type<Number>> &
gradients)
1482 const unsigned int dofs_per_cell = dof_values.
size();
1483 const unsigned int n_quadrature_points =
gradients.size();
1491 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1495 shape_function_data[shape_function].single_nonzero_component;
1501 const Number &value = dof_values[shape_function];
1505 if (::internal::CheckForZero<Number>::value(value) ==
true)
1510 const unsigned int comp = shape_function_data[shape_function]
1511 .single_nonzero_component_index;
1513 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1514 &shape_gradients[snc][0];
1519 const unsigned int ii = indices[0];
1520 const unsigned int jj = indices[1];
1522 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1523 ++q_point, ++shape_gradient_ptr)
1525 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1530 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1531 if (shape_function_data[shape_function]
1532 .is_nonzero_shape_function_component[
d])
1544 template <
int dim,
int spacedim>
1545 template <
class InputVector>
1548 const InputVector &fe_function,
1556 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1564 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1566 internal::do_function_values<dim, spacedim>(
1569 shape_function_data,
1575 template <
int dim,
int spacedim>
1576 template <
class InputVector>
1579 const InputVector &dof_values,
1587 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1590 internal::do_function_values<dim, spacedim>(
1593 shape_function_data,
1599 template <
int dim,
int spacedim>
1600 template <
class InputVector>
1603 const InputVector &fe_function,
1609 "update_gradients")));
1611 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1618 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1620 internal::do_function_derivatives<1, dim, spacedim>(
1623 shape_function_data,
1629 template <
int dim,
int spacedim>
1630 template <
class InputVector>
1633 const InputVector &dof_values,
1639 "update_gradients")));
1641 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1644 internal::do_function_derivatives<1, dim, spacedim>(
1647 shape_function_data,
1653 template <
int dim,
int spacedim>
1654 template <
class InputVector>
1657 const InputVector &fe_function,
1663 "update_hessians")));
1665 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1672 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1674 internal::do_function_derivatives<2, dim, spacedim>(
1677 shape_function_data,
1683 template <
int dim,
int spacedim>
1684 template <
class InputVector>
1687 const InputVector &dof_values,
1693 "update_hessians")));
1695 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1698 internal::do_function_derivatives<2, dim, spacedim>(
1701 shape_function_data,
1707 template <
int dim,
int spacedim>
1708 template <
class InputVector>
1711 const InputVector &fe_function,
1717 "update_hessians")));
1719 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1726 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1728 internal::do_function_laplacians<dim, spacedim>(
1731 shape_function_data,
1737 template <
int dim,
int spacedim>
1738 template <
class InputVector>
1741 const InputVector &dof_values,
1747 "update_hessians")));
1749 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1752 internal::do_function_laplacians<dim, spacedim>(
1755 shape_function_data,
1761 template <
int dim,
int spacedim>
1762 template <
class InputVector>
1765 const InputVector &fe_function,
1768 &third_derivatives)
const
1772 "update_3rd_derivatives")));
1774 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1781 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1783 internal::do_function_derivatives<3, dim, spacedim>(
1786 shape_function_data,
1792 template <
int dim,
int spacedim>
1793 template <
class InputVector>
1796 const InputVector &dof_values,
1799 &third_derivatives)
const
1803 "update_3rd_derivatives")));
1805 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1808 internal::do_function_derivatives<3, dim, spacedim>(
1811 shape_function_data,
1817 template <
int dim,
int spacedim>
1818 template <
class InputVector>
1821 const InputVector &fe_function,
1829 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1836 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1838 internal::do_function_values<dim, spacedim>(
1841 shape_function_data,
1847 template <
int dim,
int spacedim>
1848 template <
class InputVector>
1851 const InputVector &dof_values,
1859 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1862 internal::do_function_values<dim, spacedim>(
1865 shape_function_data,
1871 template <
int dim,
int spacedim>
1872 template <
class InputVector>
1875 const InputVector &fe_function,
1881 "update_gradients")));
1883 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1890 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1892 internal::do_function_derivatives<1, dim, spacedim>(
1895 shape_function_data,
1901 template <
int dim,
int spacedim>
1902 template <
class InputVector>
1905 const InputVector &dof_values,
1911 "update_gradients")));
1913 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1916 internal::do_function_derivatives<1, dim, spacedim>(
1919 shape_function_data,
1925 template <
int dim,
int spacedim>
1926 template <
class InputVector>
1929 const InputVector &fe_function,
1932 &symmetric_gradients)
const
1936 "update_gradients")));
1938 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1945 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
1947 internal::do_function_symmetric_gradients<dim, spacedim>(
1950 shape_function_data,
1951 symmetric_gradients);
1956 template <
int dim,
int spacedim>
1957 template <
class InputVector>
1960 const InputVector &dof_values,
1963 &symmetric_gradients)
const
1967 "update_gradients")));
1969 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1972 internal::do_function_symmetric_gradients<dim, spacedim>(
1975 shape_function_data,
1976 symmetric_gradients);
1981 template <
int dim,
int spacedim>
1982 template <
class InputVector>
1985 const InputVector &fe_function,
1991 "update_gradients")));
1993 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2001 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2003 internal::do_function_divergences<dim, spacedim>(
2006 shape_function_data,
2012 template <
int dim,
int spacedim>
2013 template <
class InputVector>
2016 const InputVector &dof_values,
2022 "update_gradients")));
2024 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2027 internal::do_function_divergences<dim, spacedim>(
2030 shape_function_data,
2036 template <
int dim,
int spacedim>
2037 template <
class InputVector>
2040 const InputVector &fe_function,
2046 "update_gradients")));
2048 ExcMessage(
"FEValues object is not reinited to any cell"));
2055 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2057 internal::do_function_curls<dim, spacedim>(
2060 shape_function_data,
2066 template <
int dim,
int spacedim>
2067 template <
class InputVector>
2070 const InputVector &dof_values,
2076 "update_gradients")));
2078 ExcMessage(
"FEValues object is not reinited to any cell"));
2081 internal::do_function_curls<dim, spacedim>(
2084 shape_function_data,
2090 template <
int dim,
int spacedim>
2091 template <
class InputVector>
2094 const InputVector &fe_function,
2100 "update_hessians")));
2102 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2109 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2111 internal::do_function_derivatives<2, dim, spacedim>(
2114 shape_function_data,
2120 template <
int dim,
int spacedim>
2121 template <
class InputVector>
2124 const InputVector &dof_values,
2130 "update_hessians")));
2132 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2135 internal::do_function_derivatives<2, dim, spacedim>(
2138 shape_function_data,
2144 template <
int dim,
int spacedim>
2145 template <
class InputVector>
2148 const InputVector &fe_function,
2154 "update_hessians")));
2159 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2161 fe_function.size() == fe_values->
present_cell->n_dofs_for_dof_handler(),
2168 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2170 internal::do_function_laplacians<dim, spacedim>(
2173 shape_function_data,
2179 template <
int dim,
int spacedim>
2180 template <
class InputVector>
2183 const InputVector &dof_values,
2189 "update_hessians")));
2194 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2197 internal::do_function_laplacians<dim, spacedim>(
2200 shape_function_data,
2206 template <
int dim,
int spacedim>
2207 template <
class InputVector>
2210 const InputVector &fe_function,
2213 &third_derivatives)
const
2217 "update_3rd_derivatives")));
2219 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2226 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2228 internal::do_function_derivatives<3, dim, spacedim>(
2231 shape_function_data,
2237 template <
int dim,
int spacedim>
2238 template <
class InputVector>
2241 const InputVector &dof_values,
2244 &third_derivatives)
const
2248 "update_3rd_derivatives")));
2250 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2253 internal::do_function_derivatives<3, dim, spacedim>(
2256 shape_function_data,
2262 template <
int dim,
int spacedim>
2263 template <
class InputVector>
2266 const InputVector &fe_function,
2274 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2281 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2283 internal::do_function_values<dim, spacedim>(
2286 shape_function_data,
2292 template <
int dim,
int spacedim>
2293 template <
class InputVector>
2296 const InputVector &dof_values,
2304 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2307 internal::do_function_values<dim, spacedim>(
2310 shape_function_data,
2316 template <
int dim,
int spacedim>
2317 template <
class InputVector>
2320 const InputVector &fe_function,
2326 "update_gradients")));
2328 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2336 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2338 internal::do_function_divergences<dim, spacedim>(
2341 shape_function_data,
2347 template <
int dim,
int spacedim>
2348 template <
class InputVector>
2352 const InputVector &dof_values,
2358 "update_gradients")));
2360 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2363 internal::do_function_divergences<dim, spacedim>(
2366 shape_function_data,
2372 template <
int dim,
int spacedim>
2373 template <
class InputVector>
2376 const InputVector &fe_function,
2384 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2391 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2393 internal::do_function_values<dim, spacedim>(
2396 shape_function_data,
2402 template <
int dim,
int spacedim>
2403 template <
class InputVector>
2406 const InputVector &dof_values,
2414 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2417 internal::do_function_values<dim, spacedim>(
2420 shape_function_data,
2426 template <
int dim,
int spacedim>
2427 template <
class InputVector>
2430 const InputVector &fe_function,
2436 "update_gradients")));
2438 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2446 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2448 internal::do_function_divergences<dim, spacedim>(
2451 shape_function_data,
2457 template <
int dim,
int spacedim>
2458 template <
class InputVector>
2461 const InputVector &dof_values,
2462 std::vector<solution_divergence_type<typename InputVector::value_type>>
2467 "update_gradients")));
2469 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2472 internal::do_function_divergences<dim, spacedim>(
2475 shape_function_data,
2481 template <
int dim,
int spacedim>
2482 template <
class InputVector>
2485 const InputVector &fe_function,
2491 "update_gradients")));
2493 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2501 fe_values->
present_cell->get_interpolated_dof_values(fe_function,
2503 internal::do_function_gradients<dim, spacedim>(
2506 shape_function_data,
2512 template <
int dim,
int spacedim>
2513 template <
class InputVector>
2516 const InputVector &dof_values,
2522 "update_gradients")));
2524 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2527 internal::do_function_gradients<dim, spacedim>(
2530 shape_function_data,
2541 template <
int dim,
int spacedim>
2547 scalars.reserve(n_scalars);
2548 for (
unsigned int component = 0; component < n_scalars; ++component)
2549 scalars.emplace_back(fe_values, component);
2554 const unsigned int n_vectors =
2559 vectors.reserve(n_vectors);
2560 for (
unsigned int component = 0; component < n_vectors; ++component)
2561 vectors.emplace_back(fe_values, component);
2564 const unsigned int n_symmetric_second_order_tensors =
2570 symmetric_second_order_tensors.reserve(n_symmetric_second_order_tensors);
2571 for (
unsigned int component = 0;
2572 component < n_symmetric_second_order_tensors;
2574 symmetric_second_order_tensors.emplace_back(fe_values, component);
2578 const unsigned int n_second_order_tensors =
2583 second_order_tensors.reserve(n_second_order_tensors);
2584 for (
unsigned int component = 0; component < n_second_order_tensors;
2586 second_order_tensors.emplace_back(fe_values, component);
2594template <
int dim,
int spacedim>
2620#include "fe_values.decl.1.inst"
2638template <
int dim,
int spacedim>
2639template <
typename CI>
2647 CellIterator(
const CI &cell);
2663 n_dofs_for_dof_handler()
const override;
2665#include "fe_values.decl.2.inst"
2701template <
int dim,
int spacedim>
2727 n_dofs_for_dof_handler()
const override;
2729#include "fe_values.decl.2.inst"
2758template <
int dim,
int spacedim>
2759template <
typename CI>
2766template <
int dim,
int spacedim>
2767template <
typename CI>
2776template <
int dim,
int spacedim>
2777template <
typename CI>
2781 return cell->get_dof_handler().n_dofs();
2786#include "fe_values.impl.1.inst"
2790template <
int dim,
int spacedim>
2791template <
typename CI>
2800 cell->get_fe().n_dofs_per_cell());
2803 for (
unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell(); ++i)
2810template <
int dim,
int spacedim>
2812 spacedim>::TriaCellIterator::message_string =
2813 (
"You have previously called the FEValues::reinit function with a\n"
2814 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However,\n"
2815 "when you do this, you cannot call some functions in the FEValues\n"
2816 "class, such as the get_function_values/gradients/hessians/third_derivatives\n"
2817 "functions. If you need these functions, then you need to call\n"
2818 "FEValues::reinit with an iterator type that allows to extract\n"
2819 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
2823template <
int dim,
int spacedim>
2831template <
int dim,
int spacedim>
2840template <
int dim,
int spacedim>
2850#include "fe_values.impl.2.inst"
2854template <
int dim,
int spacedim>
2867 namespace FEValuesImplementation
2869 template <
int dim,
int spacedim>
2877 n_quadrature_points,
2882 numbers::signaling_nan<double>());
2885 this->jacobians.resize(
2890 this->jacobian_grads.resize(
2895 this->jacobian_pushed_forward_grads.resize(
2899 this->jacobian_2nd_derivatives.resize(
2904 this->jacobian_pushed_forward_2nd_derivatives.resize(
2911 this->jacobian_pushed_forward_3rd_derivatives.resize(
2915 this->inverse_jacobians.resize(
2920 this->boundary_forms.resize(
2924 this->normal_vectors.resize(
2930 template <
int dim,
int spacedim>
2941 jacobian_pushed_forward_2nd_derivatives) +
2944 jacobian_pushed_forward_3rd_derivatives) +
2953 template <
int dim,
int spacedim>
2963 this->shape_function_to_row_table =
2968 unsigned int n_nonzero_shape_components = 0;
2969 for (
unsigned int i = 0; i <
fe.n_dofs_per_cell(); ++i)
2970 n_nonzero_shape_components +=
fe.n_nonzero_components(i);
2971 Assert(n_nonzero_shape_components >=
fe.n_dofs_per_cell(),
2978 this->shape_values.reinit(n_nonzero_shape_components,
2980 this->shape_values.fill(numbers::signaling_nan<double>());
2985 this->shape_gradients.reinit(n_nonzero_shape_components,
2987 this->shape_gradients.fill(
2993 this->shape_hessians.reinit(n_nonzero_shape_components,
2995 this->shape_hessians.fill(
3001 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
3003 this->shape_3rd_derivatives.fill(
3010 template <
int dim,
int spacedim>
3029template <
int dim,
int spacedim>
3031 const unsigned int n_q_points,
3040 ,
fe(&
fe, typeid(*this).name())
3045 ExcMessage(
"There is nothing useful you can do with an FEValues "
3046 "object when using a quadrature formula with zero "
3047 "quadrature points!"));
3053template <
int dim,
int spacedim>
3071 template <
typename Number,
typename Number2>
3074 const ::Table<2, double> &shape_values,
3075 std::vector<Number> &
values)
3082 std::fill_n(
values.begin(),
3093 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell; ++shape_func)
3095 const Number2
value = dof_values_ptr[shape_func];
3103 const double *shape_value_ptr = &shape_values(shape_func, 0);
3111 template <
int dim,
int spacedim,
typename VectorType>
3114 const typename VectorType::value_type *dof_values_ptr,
3115 const ::Table<2, double> & shape_values,
3117 const std::vector<unsigned int> & shape_function_to_row_table,
3119 const bool quadrature_points_fastest =
false,
3120 const unsigned int component_multiple = 1)
3122 using Number =
typename VectorType::value_type;
3124 for (
unsigned int i = 0; i <
values.size(); ++i)
3127 typename VectorType::value_type());
3136 quadrature_points_fastest ?
values[0].size() :
values.size();
3137 const unsigned int n_components =
fe.n_components();
3140 const unsigned result_components = n_components * component_multiple;
3141 (void)result_components;
3142 if (quadrature_points_fastest)
3145 for (
unsigned int i = 0; i <
values.size(); ++i)
3151 for (
unsigned int i = 0; i <
values.size(); ++i)
3158 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3159 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell;
3162 const Number &value = dof_values_ptr[shape_func + mc *
dofs_per_cell];
3166 if (::internal::CheckForZero<Number>::value(value) ==
true)
3169 if (
fe.is_primitive(shape_func))
3171 const unsigned int comp =
3172 fe.system_to_component_index(shape_func).first +
3174 const unsigned int row =
3175 shape_function_to_row_table[shape_func * n_components + comp];
3177 const double *shape_value_ptr = &shape_values(row, 0);
3179 if (quadrature_points_fastest)
3181 VectorType &values_comp =
values[comp];
3184 values_comp[
point] += value * (*shape_value_ptr++);
3189 values[
point][comp] += value * (*shape_value_ptr++);
3192 for (
unsigned int c = 0; c < n_components; ++c)
3194 if (
fe.get_nonzero_components(shape_func)[c] ==
false)
3197 const unsigned int row =
3198 shape_function_to_row_table[shape_func * n_components + c];
3200 const double * shape_value_ptr = &shape_values(row, 0);
3201 const unsigned int comp = c + mc * n_components;
3203 if (quadrature_points_fastest)
3205 VectorType &values_comp =
values[comp];
3208 values_comp[
point] += value * (*shape_value_ptr++);
3213 values[
point][comp] += value * (*shape_value_ptr++);
3222 template <
int order,
int spacedim,
typename Number>
3225 const Number * dof_values_ptr,
3229 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
3233 std::fill_n(derivatives.begin(),
3244 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell; ++shape_func)
3246 const Number &value = dof_values_ptr[shape_func];
3250 if (::internal::CheckForZero<Number>::value(value) ==
true)
3254 &shape_derivatives[shape_func][0];
3256 derivatives[
point] += value * (*shape_derivative_ptr++);
3262 template <
int order,
int dim,
int spacedim,
typename Number>
3265 const Number * dof_values_ptr,
3268 const std::vector<unsigned int> &shape_function_to_row_table,
3270 const bool quadrature_points_fastest =
false,
3271 const unsigned int component_multiple = 1)
3274 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3275 std::fill_n(derivatives[i].
begin(),
3276 derivatives[i].size(),
3287 quadrature_points_fastest ? derivatives[0].size() : derivatives.size();
3288 const unsigned int n_components =
fe.n_components();
3291 const unsigned result_components = n_components * component_multiple;
3292 (void)result_components;
3293 if (quadrature_points_fastest)
3296 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3302 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3309 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3310 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell;
3317 if (::internal::CheckForZero<Number>::value(value) ==
true)
3320 if (
fe.is_primitive(shape_func))
3322 const unsigned int comp =
3323 fe.system_to_component_index(shape_func).first +
3325 const unsigned int row =
3326 shape_function_to_row_table[shape_func * n_components + comp];
3329 &shape_derivatives[row][0];
3331 if (quadrature_points_fastest)
3334 derivatives[comp][
point] += value * (*shape_derivative_ptr++);
3338 derivatives[
point][comp] += value * (*shape_derivative_ptr++);
3341 for (
unsigned int c = 0; c < n_components; ++c)
3343 if (
fe.get_nonzero_components(shape_func)[c] ==
false)
3346 const unsigned int row =
3347 shape_function_to_row_table[shape_func * n_components + c];
3350 &shape_derivatives[row][0];
3351 const unsigned int comp = c + mc * n_components;
3353 if (quadrature_points_fastest)
3356 derivatives[comp][
point] +=
3357 value * (*shape_derivative_ptr++);
3361 derivatives[
point][comp] +=
3362 value * (*shape_derivative_ptr++);
3369 template <
int spacedim,
typename Number,
typename Number2>
3372 const Number2 * dof_values_ptr,
3374 std::vector<Number> & laplacians)
3376 const unsigned int dofs_per_cell = shape_hessians.size()[0];
3380 std::fill_n(laplacians.begin(),
3387 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell; ++shape_func)
3389 const Number2
value = dof_values_ptr[shape_func];
3398 &shape_hessians[shape_func][0];
3406 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3409 const Number * dof_values_ptr,
3412 const std::vector<unsigned int> & shape_function_to_row_table,
3413 std::vector<VectorType> & laplacians,
3414 const bool quadrature_points_fastest =
false,
3415 const unsigned int component_multiple = 1)
3418 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3419 std::fill_n(laplacians[i].
begin(),
3420 laplacians[i].size(),
3421 typename VectorType::value_type());
3431 const unsigned int n_components =
fe.n_components();
3434 const unsigned result_components = n_components * component_multiple;
3435 (void)result_components;
3436 if (quadrature_points_fastest)
3439 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3445 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3452 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3453 for (
unsigned int shape_func = 0; shape_func <
dofs_per_cell;
3460 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3463 if (
fe.is_primitive(shape_func))
3465 const unsigned int comp =
3466 fe.system_to_component_index(shape_func).first +
3468 const unsigned int row =
3469 shape_function_to_row_table[shape_func * n_components + comp];
3472 &shape_hessians[row][0];
3473 if (quadrature_points_fastest)
3475 VectorType &laplacians_comp = laplacians[comp];
3478 laplacians_comp[
point] +=
3484 laplacians[
point][comp] +=
3488 for (
unsigned int c = 0; c < n_components; ++c)
3490 if (
fe.get_nonzero_components(shape_func)[c] ==
false)
3493 const unsigned int row =
3494 shape_function_to_row_table[shape_func * n_components + c];
3497 &shape_hessians[row][0];
3498 const unsigned int comp = c + mc * n_components;
3500 if (quadrature_points_fastest)
3502 VectorType &laplacians_comp = laplacians[comp];
3505 laplacians_comp[
point] +=
3511 laplacians[
point][comp] +=
3520template <
int dim,
int spacedim>
3521template <
class InputVector>
3524 const InputVector & fe_function,
3525 std::vector<typename InputVector::value_type> &
values)
const
3527 using Number =
typename InputVector::value_type;
3532 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3537 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3539 this->finite_element_output.shape_values,
3545template <
int dim,
int spacedim>
3546template <
class InputVector>
3549 const InputVector & fe_function,
3551 std::vector<typename InputVector::value_type> &
values)
const
3553 using Number =
typename InputVector::value_type;
3559 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
3563 this->finite_element_output.shape_values,
3569template <
int dim,
int spacedim>
3570template <
class InputVector>
3573 const InputVector & fe_function,
3576 using Number =
typename InputVector::value_type;
3578 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3586 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3589 this->finite_element_output.shape_values,
3591 this->finite_element_output.shape_function_to_row_table,
3597template <
int dim,
int spacedim>
3598template <
class InputVector>
3601 const InputVector & fe_function,
3605 using Number =
typename InputVector::value_type;
3613 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
3618 this->finite_element_output.shape_values,
3620 this->finite_element_output.shape_function_to_row_table,
3628template <
int dim,
int spacedim>
3629template <
class InputVector>
3632 const InputVector & fe_function,
3635 const bool quadrature_points_fastest)
const
3637 using Number =
typename InputVector::value_type;
3646 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3647 for (
unsigned int i = 0; i < indices.
size(); ++i)
3651 this->finite_element_output.shape_values,
3653 this->finite_element_output.shape_function_to_row_table,
3655 quadrature_points_fastest,
3661template <
int dim,
int spacedim>
3662template <
class InputVector>
3665 const InputVector &fe_function,
3669 using Number =
typename InputVector::value_type;
3674 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3679 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3681 this->finite_element_output.shape_gradients,
3687template <
int dim,
int spacedim>
3688template <
class InputVector>
3691 const InputVector & fe_function,
3696 using Number =
typename InputVector::value_type;
3702 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
3706 this->finite_element_output.shape_gradients,
3712template <
int dim,
int spacedim>
3713template <
class InputVector>
3716 const InputVector &fe_function,
3721 using Number =
typename InputVector::value_type;
3725 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3730 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3733 this->finite_element_output.shape_gradients,
3735 this->finite_element_output.shape_function_to_row_table,
3741template <
int dim,
int spacedim>
3742template <
class InputVector>
3745 const InputVector & fe_function,
3749 const bool quadrature_points_fastest)
const
3751 using Number =
typename InputVector::value_type;
3759 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3760 for (
unsigned int i = 0; i < indices.
size(); ++i)
3764 this->finite_element_output.shape_gradients,
3766 this->finite_element_output.shape_function_to_row_table,
3768 quadrature_points_fastest,
3774template <
int dim,
int spacedim>
3775template <
class InputVector>
3778 const InputVector &fe_function,
3782 using Number =
typename InputVector::value_type;
3787 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3792 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3794 this->finite_element_output.shape_hessians,
3800template <
int dim,
int spacedim>
3801template <
class InputVector>
3804 const InputVector & fe_function,
3809 using Number =
typename InputVector::value_type;
3815 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
3819 this->finite_element_output.shape_hessians,
3825template <
int dim,
int spacedim>
3826template <
class InputVector>
3829 const InputVector &fe_function,
3833 const bool quadrature_points_fastest)
const
3835 using Number =
typename InputVector::value_type;
3839 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3844 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3847 this->finite_element_output.shape_hessians,
3849 this->finite_element_output.shape_function_to_row_table,
3851 quadrature_points_fastest);
3856template <
int dim,
int spacedim>
3857template <
class InputVector>
3860 const InputVector & fe_function,
3864 const bool quadrature_points_fastest)
const
3866 using Number =
typename InputVector::value_type;
3872 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3873 for (
unsigned int i = 0; i < indices.
size(); ++i)
3877 this->finite_element_output.shape_hessians,
3879 this->finite_element_output.shape_function_to_row_table,
3881 quadrature_points_fastest,
3887template <
int dim,
int spacedim>
3888template <
class InputVector>
3891 const InputVector & fe_function,
3892 std::vector<typename InputVector::value_type> &laplacians)
const
3894 using Number =
typename InputVector::value_type;
3899 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3904 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3906 this->finite_element_output.shape_hessians,
3912template <
int dim,
int spacedim>
3913template <
class InputVector>
3916 const InputVector & fe_function,
3918 std::vector<typename InputVector::value_type> & laplacians)
const
3920 using Number =
typename InputVector::value_type;
3926 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
3930 this->finite_element_output.shape_hessians,
3936template <
int dim,
int spacedim>
3937template <
class InputVector>
3940 const InputVector & fe_function,
3943 using Number =
typename InputVector::value_type;
3952 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3955 this->finite_element_output.shape_hessians,
3957 this->finite_element_output.shape_function_to_row_table,
3963template <
int dim,
int spacedim>
3964template <
class InputVector>
3967 const InputVector & fe_function,
3971 using Number =
typename InputVector::value_type;
3979 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3980 for (
unsigned int i = 0; i < indices.
size(); ++i)
3984 this->finite_element_output.shape_hessians,
3986 this->finite_element_output.shape_function_to_row_table,
3994template <
int dim,
int spacedim>
3995template <
class InputVector>
3998 const InputVector & fe_function,
4000 std::vector<std::vector<typename InputVector::value_type>> &laplacians,
4001 const bool quadrature_points_fastest)
const
4003 using Number =
typename InputVector::value_type;
4009 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4010 for (
unsigned int i = 0; i < indices.
size(); ++i)
4014 this->finite_element_output.shape_hessians,
4016 this->finite_element_output.shape_function_to_row_table,
4018 quadrature_points_fastest,
4024template <
int dim,
int spacedim>
4025template <
class InputVector>
4028 const InputVector &fe_function,
4030 &third_derivatives)
const
4032 using Number =
typename InputVector::value_type;
4037 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4042 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4045 this->finite_element_output.shape_3rd_derivatives,
4051template <
int dim,
int spacedim>
4052template <
class InputVector>
4055 const InputVector & fe_function,
4058 &third_derivatives)
const
4060 using Number =
typename InputVector::value_type;
4066 boost::container::small_vector<Number, 200> dof_values(
dofs_per_cell);
4071 this->finite_element_output.shape_3rd_derivatives,
4077template <
int dim,
int spacedim>
4078template <
class InputVector>
4081 const InputVector &fe_function,
4084 & third_derivatives,
4085 const bool quadrature_points_fastest)
const
4087 using Number =
typename InputVector::value_type;
4091 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4096 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4099 this->finite_element_output.shape_3rd_derivatives,
4101 this->finite_element_output.shape_function_to_row_table,
4103 quadrature_points_fastest);
4108template <
int dim,
int spacedim>
4109template <
class InputVector>
4112 const InputVector & fe_function,
4116 const bool quadrature_points_fastest)
const
4118 using Number =
typename InputVector::value_type;
4124 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4125 for (
unsigned int i = 0; i < indices.
size(); ++i)
4129 this->finite_element_output.shape_3rd_derivatives,
4131 this->finite_element_output.shape_function_to_row_table,
4133 quadrature_points_fastest,
4139template <
int dim,
int spacedim>
4148template <
int dim,
int spacedim>
4149const std::vector<Tensor<1, spacedim>> &
4154 "update_normal_vectors")));
4161template <
int dim,
int spacedim>
4182template <
int dim,
int spacedim>
4201template <
int dim,
int spacedim>
4219template <
int dim,
int spacedim>
4262template <
int dim,
int spacedim>
4298 (cell->is_translation_of(
4308 ->direction_flag() != cell->direction_flag())
4317template <
int dim,
int spacedim>
4326template <
int dim,
int spacedim>
4331template <
int dim,
int spacedim>
4336template <
int dim,
int spacedim>
4341template <
int dim,
int spacedim>
4347 fe.n_dofs_per_cell(),
4358template <
int dim,
int spacedim>
4363 :
FEValues(mapping, fe, q[0], update_flags)
4370template <
int dim,
int spacedim>
4376 fe.n_dofs_per_cell(),
4387template <
int dim,
int spacedim>
4398template <
int dim,
int spacedim>
4404 if (dim != spacedim - 1)
4406 ExcMessage(
"You can only pass the 'update_normal_vectors' "
4407 "flag to FEFaceValues or FESubfaceValues objects, "
4408 "but not to an FEValues object unless the "
4409 "triangulation it refers to is embedded in a higher "
4410 "dimensional space."));
4412 const UpdateFlags flags = this->compute_update_flags(update_flags);
4416 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4417 this->finite_element_output.initialize(this->max_n_quadrature_points,
4424 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4429 this->finite_element_output);
4433 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4437 [&]() {
return this->mapping->get_data(flags, quadrature); });
4439 this->update_flags = flags;
4442 this->fe_data = std::move(fe_get_data.return_value());
4444 this->mapping_data = std::move(mapping_get_data.return_value());
4446 this->mapping_data =
4447 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4458 template <
typename Type,
typename Po
inter,
typename Iterator>
4460 reset_pointer_in_place_if_possible(std::unique_ptr<Pointer> &present_cell,
4461 const Iterator & new_cell)
4466 if (present_cell.get() && (
typeid(*present_cell.get()) ==
typeid(Type)))
4469 static_cast<const Type *
>(present_cell.get())->~Type();
4472 new (
const_cast<void *
>(
static_cast<const void *
>(present_cell.get())))
4477 present_cell = std::make_unique<Type>(new_cell);
4483template <
int dim,
int spacedim>
4489 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4491 "You are trying to call FEValues::reinit() with a cell of type " +
4492 cell->reference_cell().to_string() +
4493 " with a Mapping that is not compatible with it."));
4497 this->maybe_invalidate_previous_present_cell(cell);
4498 this->check_cell_similarity(cell);
4500 reset_pointer_in_place_if_possible<
4512template <
int dim,
int spacedim>
4525 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4527 "You are trying to call FEValues::reinit() with a cell of type " +
4528 cell->reference_cell().to_string() +
4529 " with a Mapping that is not compatible with it."));
4531 this->maybe_invalidate_previous_present_cell(cell);
4532 this->check_cell_similarity(cell);
4534 reset_pointer_in_place_if_possible<
4547template <
int dim,
int spacedim>
4557 this->cell_similarity =
4558 this->get_mapping().fill_fe_values(*this->present_cell,
4559 this->cell_similarity,
4561 *this->mapping_data,
4562 this->mapping_output);
4569 this->get_fe().fill_fe_values(*this->present_cell,
4570 this->cell_similarity,
4572 this->get_mapping(),
4573 *this->mapping_data,
4574 this->mapping_output,
4576 this->finite_element_output);
4581template <
int dim,
int spacedim>
4593template <
int dim,
int spacedim>
4595 const unsigned int dofs_per_cell,
4604 hp::QCollection<dim - 1>(quadrature))
4609template <
int dim,
int spacedim>
4611 const unsigned int dofs_per_cell,
4616 :
FEValuesBase<dim, spacedim>(quadrature.max_n_quadrature_points(),
4622 , quadrature(quadrature)
4625 quadrature.
size() ==
fe.reference_cell().n_faces(),
4631template <
int dim,
int spacedim>
4632const std::vector<Tensor<1, spacedim>> &
4637 "update_boundary_forms")));
4643template <
int dim,
int spacedim>
4654template <
int dim,
int spacedim>
4659template <
int dim,
int spacedim>
4664template <
int dim,
int spacedim>
4672 hp::QCollection<dim - 1>(quadrature),
4678template <
int dim,
int spacedim>
4695template <
int dim,
int spacedim>
4701 hp::QCollection<dim - 1>(quadrature),
4707template <
int dim,
int spacedim>
4713 fe.n_dofs_per_cell(),
4724template <
int dim,
int spacedim>
4728 const UpdateFlags flags = this->compute_update_flags(update_flags);
4732 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4733 this->finite_element_output.initialize(this->max_n_quadrature_points,
4740 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase> (
4749 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> (
4756 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4762 this->finite_element_output);
4764 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4772 this->update_flags = flags;
4775 this->fe_data = std::move(fe_get_data.return_value());
4777 this->mapping_data = std::move(mapping_get_data.return_value());
4779 this->mapping_data =
4780 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4785template <
int dim,
int spacedim>
4790 const unsigned int face_no)
4796 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4801 this->maybe_invalidate_previous_present_cell(cell);
4802 reset_pointer_in_place_if_possible<
4815template <
int dim,
int spacedim>
4822 const auto face_n = cell->face_iterator_to_index(face);
4828template <
int dim,
int spacedim>
4832 const unsigned int face_no)
4836 this->maybe_invalidate_previous_present_cell(cell);
4837 reset_pointer_in_place_if_possible<
4849template <
int dim,
int spacedim>
4855 const auto face_n = cell->face_iterator_to_index(face);
4861template <
int dim,
int spacedim>
4865 this->present_face_no = face_no;
4869 *this->present_cell;
4870 this->present_face_index = cell->face_index(face_no);
4874 this->get_mapping().fill_fe_face_values(*this->present_cell,
4877 *this->mapping_data,
4878 this->mapping_output);
4881 this->get_fe().fill_fe_face_values(*this->present_cell,
4884 this->get_mapping(),
4885 *this->mapping_data,
4886 this->mapping_output,
4888 this->finite_element_output);
4890 const_cast<unsigned int &
>(this->n_quadrature_points) =
4891 this->quadrature[this->quadrature.
size() == 1 ? 0 : face_no].
size();
4898template <
int dim,
int spacedim>
4903template <
int dim,
int spacedim>
4908template <
int dim,
int spacedim>
4925template <
int dim,
int spacedim>
4938template <
int dim,
int spacedim>
4944 fe.n_dofs_per_cell(),
4955template <
int dim,
int spacedim>
4967template <
int dim,
int spacedim>
4984 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4990 this->quadrature[0],
4993 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
5000 this->quadrature[0]);
5002 this->update_flags = flags;
5005 this->
fe_data = std::move(fe_get_data.return_value());
5007 this->
mapping_data = std::move(mapping_get_data.return_value());
5010 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
5015template <
int dim,
int spacedim>
5020 const unsigned int face_no,
5021 const unsigned int subface_no)
5027 cell->get_dof_handler().get_fe(cell->active_fe_index())),
5034 Assert(cell->face(face_no)->has_children() ||
5039 Assert(!cell->face(face_no)->has_children() ||
5040 subface_no < cell->face(face_no)->n_active_descendants(),
5043 cell->face(face_no)->n_active_descendants()));
5044 Assert(cell->has_children() ==
false,
5045 ExcMessage(
"You can't use subface data for cells that are "
5046 "already refined. Iterate over their children "
5047 "instead in these cases."));
5050 reset_pointer_in_place_if_possible<
5063template <
int dim,
int spacedim>
5072 cell->face_iterator_to_index(face),
5073 face->child_iterator_to_index(subface));
5078template <
int dim,
int spacedim>
5082 const unsigned int face_no,
5083 const unsigned int subface_no)
5091 (cell->has_periodic_neighbor(face_no) ?
5092 cell->periodic_neighbor(face_no)
5093 ->face(cell->periodic_neighbor_face_no(face_no))
5095 cell->face(face_no)->n_children()));
5098 reset_pointer_in_place_if_possible<
5110template <
int dim,
int spacedim>
5118 cell->face_iterator_to_index(face),
5119 face->child_iterator_to_index(subface));
5124template <
int dim,
int spacedim>
5127 const unsigned int subface_no)
5135 if (!cell->face(face_no)->has_children())
5146 switch (cell->subface_case(face_no))
5151 subface_index = cell->face(face_no)->child_index(subface_no);
5155 subface_index = cell->face(face_no)
5156 ->child(subface_no / 2)
5157 ->child_index(subface_no % 2);
5166 cell->face(face_no)->child(0)->child_index(subface_no);
5169 subface_index = cell->face(face_no)->child_index(1);
5180 subface_index = cell->face(face_no)->child_index(0);
5185 cell->face(face_no)->child(1)->child_index(subface_no - 1);
5206 this->quadrature[0],
5214 this->quadrature[0],
5224#define SPLIT_INSTANTIATIONS_COUNT 6
5225#ifndef SPLIT_INSTANTIATIONS_INDEX
5226# define SPLIT_INSTANTIATIONS_INDEX 0
5228#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)
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
value_type * data() const noexcept
unsigned int present_face_no
unsigned int present_face_index
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
const hp::QCollection< dim - 1 > quadrature
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)
virtual void get_interpolated_dof_values(const IndexSet &in, Vector< IndexSet::value_type > &out) const =0
virtual types::global_dof_index n_dofs_for_dof_handler() const =0
virtual ~CellIteratorBase()=default
TriaCellIterator(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
virtual types::global_dof_index n_dofs_for_dof_handler() const override
static const char *const message_string
virtual void get_interpolated_dof_values(const IndexSet &in, Vector< IndexSet::value_type > &out) const override
const Triangulation< dim, spacedim >::cell_iterator cell
CellSimilarity::Similarity cell_similarity
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
boost::signals2::connection tria_listener_mesh_transform
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 Mapping< dim, spacedim > & get_mapping() const
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
::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > mapping_output
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > mapping_data
boost::signals2::connection tria_listener_refinement
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
void invalidate_present_cell()
std::unique_ptr< const CellIteratorBase > 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
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
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
typename ProductType< Number, hessian_type >::type solution_hessian_type
const unsigned int component
std::vector< ShapeFunctionData > shape_function_data
typename ProductType< Number, value_type >::type solution_laplacian_type
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_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
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
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
typename ProductType< Number, gradient_type >::type solution_gradient_type
typename ProductType< Number, value_type >::type solution_value_type
const unsigned int first_vector_component
typename ProductType< Number, curl_type >::type solution_curl_type
std::vector< ShapeFunctionData > shape_function_data
typename ProductType< Number, value_type >::type solution_laplacian_type
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
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
bool is_element(const size_type index) const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const =0
static unsigned int n_threads()
static constexpr unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
friend class SymmetricTensor
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
Triangulation< dim, spacedim > & get_triangulation()
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_jacobian_pushed_forward_grads
@ update_hessians
Second derivatives of shape functions.
@ update_jacobian_3rd_derivatives
@ update_values
Shape function values.
@ update_jacobian_grads
Gradient of volume element.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_JxW_values
Transformed quadrature weights.
@ update_jacobians
Volume element.
@ update_inverse_jacobians
Volume element.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
@ update_default
No update.
@ update_jacobian_pushed_forward_3rd_derivatives
@ update_boundary_forms
Outer normal vector, not normalized.
@ update_jacobian_2nd_derivatives
static ::ExceptionBase & ExcAccessToUninitializedField(std::string arg1)
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
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< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
VectorType::value_type * begin(VectorType &V)
void do_function_derivatives(const Number *dof_values_ptr, const ::Table< 2, Tensor< order, spacedim > > &shape_derivatives, std::vector< Tensor< order, spacedim, Number > > &derivatives)
void do_function_values(const Number2 *dof_values_ptr, const ::Table< 2, double > &shape_values, std::vector< Number > &values)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
void do_function_laplacians(const Number2 *dof_values_ptr, const ::Table< 2, Tensor< 2, spacedim > > &shape_hessians, std::vector< Number > &laplacians)
void do_function_derivatives(const Number *dof_values_ptr, const ::Table< 2, Tensor< order, spacedim > > &shape_derivatives, const FiniteElement< dim, spacedim > &fe, const std::vector< unsigned int > &shape_function_to_row_table, ArrayView< std::vector< Tensor< order, spacedim, Number > > > derivatives, const bool quadrature_points_fastest=false, const unsigned int component_multiple=1)
VectorType::value_type get_vector_element(const VectorType &vector, const types::global_dof_index cell_number)
void do_function_laplacians(const Number *dof_values_ptr, const ::Table< 2, Tensor< 2, spacedim > > &shape_hessians, const FiniteElement< dim, spacedim > &fe, const std::vector< unsigned int > &shape_function_to_row_table, std::vector< VectorType > &laplacians, const bool quadrature_points_fastest=false, const unsigned int component_multiple=1)
std::vector< unsigned int > make_shape_function_to_row_table(const FiniteElement< dim, spacedim > &fe)
void do_function_values(const typename VectorType::value_type *dof_values_ptr, const ::Table< 2, double > &shape_values, const FiniteElement< dim, spacedim > &fe, const std::vector< unsigned int > &shape_function_to_row_table, ArrayView< VectorType > values, const bool quadrature_points_fastest=false, const unsigned int component_multiple=1)
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 const T & value(const T &t)
constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)