48 #include <boost/container/small_vector.hpp>
51 #include <type_traits>
58 template <
class VectorType>
77 template <
int dim,
int spacedim>
78 inline std::vector<unsigned int>
81 std::vector<unsigned int> shape_function_to_row_table(
90 unsigned int nth_nonzero_component = 0;
95 row + nth_nonzero_component;
96 ++nth_nonzero_component;
101 return shape_function_to_row_table;
108 template <
typename Number,
typename T =
void>
123 template <
typename Number>
126 typename std::enable_if<
127 Differentiation::AD::is_ad_number<Number>::value>::type>
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->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>
187 template <
int dim,
int spacedim>
189 const unsigned int first_vector_component)
190 : fe_values(&fe_values)
191 , first_vector_component(first_vector_component)
192 , shape_function_data(this->fe_values->fe->dofs_per_cell)
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>
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->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] =
307 shape_function_to_row_table[i * fe.
n_components() + component];
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>
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->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>
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 =
449 dofs_per_cell > 0 ? shape_values.n_cols() : values.
size();
452 std::fill(values.begin(),
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];
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 =
493 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
501 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
503 if (shape_function_data[shape_function]
504 .is_nonzero_shape_function_component)
506 const Number &
value = dof_values[shape_function];
513 const ::Tensor<order, spacedim> *shape_derivative_ptr =
514 &shape_derivatives[shape_function_data[shape_function].row_index]
516 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
518 derivatives[q_point] +=
value * (*shape_derivative_ptr++);
524 template <
int dim,
int spacedim,
typename Number>
530 & shape_function_data,
532 Number>::laplacian_type> &laplacians)
534 const unsigned int dofs_per_cell = dof_values.
size();
535 const unsigned int n_quadrature_points =
536 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
539 std::fill(laplacians.begin(),
542 Number>::laplacian_type());
544 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
546 if (shape_function_data[shape_function]
547 .is_nonzero_shape_function_component)
549 const Number &
value = dof_values[shape_function];
556 const ::Tensor<2, spacedim> *shape_hessian_ptr =
557 &shape_hessians[shape_function_data[shape_function].row_index][0];
558 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
560 laplacians[q_point] +=
value *
trace(*shape_hessian_ptr++);
568 template <
int dim,
int spacedim,
typename Number>
574 &shape_function_data,
579 const unsigned int dofs_per_cell = dof_values.
size();
580 const unsigned int n_quadrature_points =
581 dofs_per_cell > 0 ? shape_values.n_cols() : values.
size();
589 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
593 shape_function_data[shape_function].single_nonzero_component;
599 const Number &
value = dof_values[shape_function];
608 const unsigned int comp = shape_function_data[shape_function]
609 .single_nonzero_component_index;
610 const double *shape_value_ptr = &shape_values(snc, 0);
611 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
613 values[q_point][comp] +=
value * (*shape_value_ptr++);
616 for (
unsigned int d = 0;
d < spacedim; ++
d)
617 if (shape_function_data[shape_function]
618 .is_nonzero_shape_function_component[
d])
620 const double *shape_value_ptr = &shape_values(
621 shape_function_data[shape_function].row_index[
d], 0);
622 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
624 values[q_point][
d] +=
value * (*shape_value_ptr++);
631 template <
int order,
int dim,
int spacedim,
typename Number>
637 &shape_function_data,
642 const unsigned int dofs_per_cell = dof_values.
size();
643 const unsigned int n_quadrature_points =
644 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
653 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
657 shape_function_data[shape_function].single_nonzero_component;
663 const Number &
value = dof_values[shape_function];
672 const unsigned int comp = shape_function_data[shape_function]
673 .single_nonzero_component_index;
674 const ::Tensor<order, spacedim> *shape_derivative_ptr =
675 &shape_derivatives[snc][0];
676 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
678 derivatives[q_point][comp] +=
value * (*shape_derivative_ptr++);
681 for (
unsigned int d = 0;
d < spacedim; ++
d)
682 if (shape_function_data[shape_function]
683 .is_nonzero_shape_function_component[
d])
685 const ::Tensor<order, spacedim> *shape_derivative_ptr =
686 &shape_derivatives[shape_function_data[shape_function]
688 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
690 derivatives[q_point][
d] +=
691 value * (*shape_derivative_ptr++);
698 template <
int dim,
int spacedim,
typename Number>
704 &shape_function_data,
708 &symmetric_gradients)
710 const unsigned int dofs_per_cell = dof_values.
size();
711 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
712 shape_gradients[0].size() :
713 symmetric_gradients.size();
717 symmetric_gradients.begin(),
718 symmetric_gradients.end(),
722 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
726 shape_function_data[shape_function].single_nonzero_component;
732 const Number &
value = dof_values[shape_function];
741 const unsigned int comp = shape_function_data[shape_function]
742 .single_nonzero_component_index;
743 const ::Tensor<1, spacedim> *shape_gradient_ptr =
744 &shape_gradients[snc][0];
745 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
747 symmetric_gradients[q_point] +=
749 symmetrize_single_row(comp, *shape_gradient_ptr++));
752 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
757 for (
unsigned int d = 0;
d < spacedim; ++
d)
758 if (shape_function_data[shape_function]
759 .is_nonzero_shape_function_component[
d])
762 shape_gradients[shape_function_data[shape_function]
763 .row_index[
d]][q_point];
764 symmetric_gradients[q_point] +=
symmetrize(grad);
771 template <
int dim,
int spacedim,
typename Number>
777 & shape_function_data,
779 Number>::divergence_type> &divergences)
781 const unsigned int dofs_per_cell = dof_values.
size();
782 const unsigned int n_quadrature_points =
783 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
786 std::fill(divergences.begin(),
789 Number>::divergence_type());
791 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
795 shape_function_data[shape_function].single_nonzero_component;
801 const Number &
value = dof_values[shape_function];
810 const unsigned int comp = shape_function_data[shape_function]
811 .single_nonzero_component_index;
812 const ::Tensor<1, spacedim> *shape_gradient_ptr =
813 &shape_gradients[snc][0];
814 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
816 divergences[q_point] +=
value * (*shape_gradient_ptr++)[comp];
819 for (
unsigned int d = 0;
d < spacedim; ++
d)
820 if (shape_function_data[shape_function]
821 .is_nonzero_shape_function_component[
d])
823 const ::Tensor<1, spacedim> *shape_gradient_ptr =
824 &shape_gradients[shape_function_data[shape_function]
826 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
828 divergences[q_point] +=
value * (*shape_gradient_ptr++)[
d];
835 template <
int dim,
int spacedim,
typename Number>
841 &shape_function_data,
844 typename ::internal::CurlType<spacedim>::type>::type> &curls)
846 const unsigned int dofs_per_cell = dof_values.
size();
847 const unsigned int n_quadrature_points =
848 dofs_per_cell > 0 ? shape_gradients[0].size() : curls.size();
851 std::fill(curls.begin(),
855 typename ::internal::CurlType<spacedim>::type>::type());
863 "Computing the curl in 1d is not a useful operation"));
869 for (
unsigned int shape_function = 0;
870 shape_function < dofs_per_cell;
873 const int snc = shape_function_data[shape_function]
874 .single_nonzero_component;
880 const Number &
value = dof_values[shape_function];
890 const ::Tensor<1, spacedim> *shape_gradient_ptr =
891 &shape_gradients[snc][0];
893 Assert(shape_function_data[shape_function]
894 .single_nonzero_component >= 0,
897 if (shape_function_data[shape_function]
898 .single_nonzero_component_index == 0)
899 for (
unsigned int q_point = 0;
900 q_point < n_quadrature_points;
903 value * (*shape_gradient_ptr++)[1];
905 for (
unsigned int q_point = 0;
906 q_point < n_quadrature_points;
909 value * (*shape_gradient_ptr++)[0];
917 if (shape_function_data[shape_function]
918 .is_nonzero_shape_function_component[0])
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++)[1];
932 if (shape_function_data[shape_function]
933 .is_nonzero_shape_function_component[1])
936 spacedim> *shape_gradient_ptr =
937 &shape_gradients[shape_function_data[shape_function]
940 for (
unsigned int q_point = 0;
941 q_point < n_quadrature_points;
944 value * (*shape_gradient_ptr++)[0];
953 for (
unsigned int shape_function = 0;
954 shape_function < dofs_per_cell;
957 const int snc = shape_function_data[shape_function]
958 .single_nonzero_component;
964 const Number &
value = dof_values[shape_function];
974 const ::Tensor<1, spacedim> *shape_gradient_ptr =
975 &shape_gradients[snc][0];
977 switch (shape_function_data[shape_function]
978 .single_nonzero_component_index)
982 for (
unsigned int q_point = 0;
983 q_point < n_quadrature_points;
987 value * (*shape_gradient_ptr)[2];
989 value * (*shape_gradient_ptr++)[1];
997 for (
unsigned int q_point = 0;
998 q_point < n_quadrature_points;
1001 curls[q_point][0] -=
1002 value * (*shape_gradient_ptr)[2];
1003 curls[q_point][2] +=
1004 value * (*shape_gradient_ptr++)[0];
1012 for (
unsigned int q_point = 0;
1013 q_point < n_quadrature_points;
1016 curls[q_point][0] +=
1017 value * (*shape_gradient_ptr)[1];
1018 curls[q_point][1] -=
1019 value * (*shape_gradient_ptr++)[0];
1035 if (shape_function_data[shape_function]
1036 .is_nonzero_shape_function_component[0])
1039 spacedim> *shape_gradient_ptr =
1040 &shape_gradients[shape_function_data[shape_function]
1043 for (
unsigned int q_point = 0;
1044 q_point < n_quadrature_points;
1047 curls[q_point][1] +=
1048 value * (*shape_gradient_ptr)[2];
1049 curls[q_point][2] -=
1050 value * (*shape_gradient_ptr++)[1];
1054 if (shape_function_data[shape_function]
1055 .is_nonzero_shape_function_component[1])
1058 spacedim> *shape_gradient_ptr =
1059 &shape_gradients[shape_function_data[shape_function]
1062 for (
unsigned int q_point = 0;
1063 q_point < n_quadrature_points;
1066 curls[q_point][0] -=
1067 value * (*shape_gradient_ptr)[2];
1068 curls[q_point][2] +=
1069 value * (*shape_gradient_ptr++)[0];
1073 if (shape_function_data[shape_function]
1074 .is_nonzero_shape_function_component[2])
1077 spacedim> *shape_gradient_ptr =
1078 &shape_gradients[shape_function_data[shape_function]
1081 for (
unsigned int q_point = 0;
1082 q_point < n_quadrature_points;
1085 curls[q_point][0] +=
1086 value * (*shape_gradient_ptr)[1];
1087 curls[q_point][1] -=
1088 value * (*shape_gradient_ptr++)[0];
1099 template <
int dim,
int spacedim,
typename Number>
1105 & shape_function_data,
1107 Number>::laplacian_type> &laplacians)
1109 const unsigned int dofs_per_cell = dof_values.
size();
1110 const unsigned int n_quadrature_points =
1111 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
1114 std::fill(laplacians.begin(),
1117 Number>::laplacian_type());
1119 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1123 shape_function_data[shape_function].single_nonzero_component;
1129 const Number &
value = dof_values[shape_function];
1138 const unsigned int comp = shape_function_data[shape_function]
1139 .single_nonzero_component_index;
1140 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1141 &shape_hessians[snc][0];
1142 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1144 laplacians[q_point][comp] +=
1148 for (
unsigned int d = 0;
d < spacedim; ++
d)
1149 if (shape_function_data[shape_function]
1150 .is_nonzero_shape_function_component[
d])
1152 const ::Tensor<2, spacedim> *shape_hessian_ptr =
1153 &shape_hessians[shape_function_data[shape_function]
1155 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1157 laplacians[q_point][
d] +=
1167 template <
int dim,
int spacedim,
typename Number>
1171 const ::Table<2, double> &shape_values,
1174 &shape_function_data,
1180 const unsigned int dofs_per_cell = dof_values.
size();
1181 const unsigned int n_quadrature_points =
1182 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
1191 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1195 shape_function_data[shape_function].single_nonzero_component;
1201 const Number &
value = dof_values[shape_function];
1212 shape_function_data[shape_function]
1213 .single_nonzero_component_index);
1214 const double *shape_value_ptr = &shape_values(snc, 0);
1215 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1217 values[q_point][comp] +=
value * (*shape_value_ptr++);
1220 for (
unsigned int d = 0;
1224 if (shape_function_data[shape_function]
1225 .is_nonzero_shape_function_component[
d])
1230 const double *shape_value_ptr = &shape_values(
1231 shape_function_data[shape_function].row_index[
d], 0);
1232 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1234 values[q_point][comp] +=
value * (*shape_value_ptr++);
1241 template <
int dim,
int spacedim,
typename Number>
1248 &shape_function_data,
1250 template OutputType<Number>::divergence_type> &divergences)
1252 const unsigned int dofs_per_cell = dof_values.
size();
1253 const unsigned int n_quadrature_points =
1254 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
1257 std::fill(divergences.begin(),
1260 Number>::divergence_type());
1262 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1266 shape_function_data[shape_function].single_nonzero_component;
1272 const Number &
value = dof_values[shape_function];
1281 const unsigned int comp = shape_function_data[shape_function]
1282 .single_nonzero_component_index;
1284 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1285 &shape_gradients[snc][0];
1292 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1293 ++q_point, ++shape_gradient_ptr)
1295 divergences[q_point][ii] +=
value * (*shape_gradient_ptr)[jj];
1298 divergences[q_point][jj] +=
1299 value * (*shape_gradient_ptr)[ii];
1304 for (
unsigned int d = 0;
1307 spacedim>::n_independent_components;
1309 if (shape_function_data[shape_function]
1310 .is_nonzero_shape_function_component[
d])
1322 const unsigned int comp =
1323 shape_function_data[shape_function]
1324 .single_nonzero_component_index;
1326 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1327 &shape_gradients[shape_function_data[shape_function]
1329 for (
unsigned int q_point = 0;
1330 q_point < n_quadrature_points;
1331 ++q_point, ++shape_gradient_ptr)
1333 for (
unsigned int j = 0; j < spacedim; ++j)
1335 const unsigned int vector_component =
1339 divergences[q_point][vector_component] +=
1340 value * (*shape_gradient_ptr++)[j];
1350 template <
int dim,
int spacedim,
typename Number>
1354 const ::Table<2, double> &shape_values,
1356 &shape_function_data,
1361 const unsigned int dofs_per_cell = dof_values.
size();
1362 const unsigned int n_quadrature_points =
1363 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
1371 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1375 shape_function_data[shape_function].single_nonzero_component;
1381 const Number &
value = dof_values[shape_function];
1390 const unsigned int comp = shape_function_data[shape_function]
1391 .single_nonzero_component_index;
1397 const double *shape_value_ptr = &shape_values(snc, 0);
1398 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1400 values[q_point][indices] +=
value * (*shape_value_ptr++);
1403 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1404 if (shape_function_data[shape_function]
1405 .is_nonzero_shape_function_component[
d])
1411 const double *shape_value_ptr = &shape_values(
1412 shape_function_data[shape_function].row_index[
d], 0);
1413 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1415 values[q_point][indices] +=
value * (*shape_value_ptr++);
1422 template <
int dim,
int spacedim,
typename Number>
1428 & shape_function_data,
1430 Number>::divergence_type> &divergences)
1432 const unsigned int dofs_per_cell = dof_values.
size();
1433 const unsigned int n_quadrature_points =
1434 dofs_per_cell > 0 ? shape_gradients[0].size() : divergences.size();
1437 std::fill(divergences.begin(),
1440 Number>::divergence_type());
1442 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1446 shape_function_data[shape_function].single_nonzero_component;
1452 const Number &
value = dof_values[shape_function];
1461 const unsigned int comp = shape_function_data[shape_function]
1462 .single_nonzero_component_index;
1464 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1465 &shape_gradients[snc][0];
1470 const unsigned int ii = indices[0];
1471 const unsigned int jj = indices[1];
1473 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1474 ++q_point, ++shape_gradient_ptr)
1476 divergences[q_point][ii] +=
value * (*shape_gradient_ptr)[jj];
1481 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1482 if (shape_function_data[shape_function]
1483 .is_nonzero_shape_function_component[
d])
1493 template <
int dim,
int spacedim,
typename Number>
1499 & shape_function_data,
1501 Number>::gradient_type> &gradients)
1503 const unsigned int dofs_per_cell = dof_values.
size();
1504 const unsigned int n_quadrature_points =
1505 dofs_per_cell > 0 ? shape_gradients[0].size() : gradients.size();
1508 std::fill(gradients.begin(),
1511 Number>::gradient_type());
1513 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1517 shape_function_data[shape_function].single_nonzero_component;
1523 const Number &
value = dof_values[shape_function];
1532 const unsigned int comp = shape_function_data[shape_function]
1533 .single_nonzero_component_index;
1535 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1536 &shape_gradients[snc][0];
1541 const unsigned int ii = indices[0];
1542 const unsigned int jj = indices[1];
1544 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1545 ++q_point, ++shape_gradient_ptr)
1547 gradients[q_point][ii][jj] +=
value * (*shape_gradient_ptr);
1552 for (
unsigned int d = 0;
d < dim * dim; ++
d)
1553 if (shape_function_data[shape_function]
1554 .is_nonzero_shape_function_component[
d])
1566 template <
int dim,
int spacedim>
1567 template <
class InputVector>
1570 const InputVector &fe_function,
1578 Assert(fe_values->present_cell.get() !=
nullptr,
1579 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1581 fe_values->present_cell->n_dofs_for_dof_handler());
1586 fe_values->dofs_per_cell);
1587 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1589 internal::do_function_values<dim, spacedim>(
1591 fe_values->finite_element_output.shape_values,
1592 shape_function_data,
1598 template <
int dim,
int spacedim>
1599 template <
class InputVector>
1602 const InputVector &dof_values,
1610 Assert(fe_values->present_cell.get() !=
nullptr,
1611 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1614 internal::do_function_values<dim, spacedim>(
1616 fe_values->finite_element_output.shape_values,
1617 shape_function_data,
1623 template <
int dim,
int spacedim>
1624 template <
class InputVector>
1627 const InputVector &fe_function,
1629 typename InputVector::value_type>::type>
1634 "update_gradients")));
1635 Assert(fe_values->present_cell.get() !=
nullptr,
1636 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1638 fe_values->present_cell->n_dofs_for_dof_handler());
1642 fe_values->dofs_per_cell);
1643 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1645 internal::do_function_derivatives<1, dim, spacedim>(
1647 fe_values->finite_element_output.shape_gradients,
1648 shape_function_data,
1654 template <
int dim,
int spacedim>
1655 template <
class InputVector>
1658 const InputVector &dof_values,
1665 "update_gradients")));
1666 Assert(fe_values->present_cell.get() !=
nullptr,
1667 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1670 internal::do_function_derivatives<1, dim, spacedim>(
1672 fe_values->finite_element_output.shape_gradients,
1673 shape_function_data,
1679 template <
int dim,
int spacedim>
1680 template <
class InputVector>
1683 const InputVector &fe_function,
1685 typename InputVector::value_type>::type>
1690 "update_hessians")));
1691 Assert(fe_values->present_cell.get() !=
nullptr,
1692 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1694 fe_values->present_cell->n_dofs_for_dof_handler());
1698 fe_values->dofs_per_cell);
1699 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1701 internal::do_function_derivatives<2, dim, spacedim>(
1703 fe_values->finite_element_output.shape_hessians,
1704 shape_function_data,
1710 template <
int dim,
int spacedim>
1711 template <
class InputVector>
1714 const InputVector &dof_values,
1721 "update_hessians")));
1722 Assert(fe_values->present_cell.get() !=
nullptr,
1723 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1726 internal::do_function_derivatives<2, dim, spacedim>(
1728 fe_values->finite_element_output.shape_hessians,
1729 shape_function_data,
1735 template <
int dim,
int spacedim>
1736 template <
class InputVector>
1739 const InputVector &fe_function,
1746 "update_hessians")));
1747 Assert(fe_values->present_cell.get() !=
nullptr,
1748 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1750 fe_values->present_cell->n_dofs_for_dof_handler());
1754 fe_values->dofs_per_cell);
1755 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1757 internal::do_function_laplacians<dim, spacedim>(
1759 fe_values->finite_element_output.shape_hessians,
1760 shape_function_data,
1766 template <
int dim,
int spacedim>
1767 template <
class InputVector>
1770 const InputVector &dof_values,
1777 "update_hessians")));
1778 Assert(fe_values->present_cell.get() !=
nullptr,
1779 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1782 internal::do_function_laplacians<dim, spacedim>(
1784 fe_values->finite_element_output.shape_hessians,
1785 shape_function_data,
1791 template <
int dim,
int spacedim>
1792 template <
class InputVector>
1795 const InputVector &fe_function,
1797 typename InputVector::value_type>::type>
1798 &third_derivatives)
const
1802 "update_3rd_derivatives")));
1803 Assert(fe_values->present_cell.get() !=
nullptr,
1804 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1806 fe_values->present_cell->n_dofs_for_dof_handler());
1810 fe_values->dofs_per_cell);
1811 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1813 internal::do_function_derivatives<3, dim, spacedim>(
1815 fe_values->finite_element_output.shape_3rd_derivatives,
1816 shape_function_data,
1822 template <
int dim,
int spacedim>
1823 template <
class InputVector>
1826 const InputVector & dof_values,
1832 "update_3rd_derivatives")));
1833 Assert(fe_values->present_cell.get() !=
nullptr,
1834 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1837 internal::do_function_derivatives<3, dim, spacedim>(
1839 fe_values->finite_element_output.shape_3rd_derivatives,
1840 shape_function_data,
1846 template <
int dim,
int spacedim>
1847 template <
class InputVector>
1850 const InputVector &fe_function,
1858 Assert(fe_values->present_cell.get() !=
nullptr,
1859 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1861 fe_values->present_cell->n_dofs_for_dof_handler());
1865 fe_values->dofs_per_cell);
1866 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1868 internal::do_function_values<dim, spacedim>(
1870 fe_values->finite_element_output.shape_values,
1871 shape_function_data,
1877 template <
int dim,
int spacedim>
1878 template <
class InputVector>
1881 const InputVector &dof_values,
1889 Assert(fe_values->present_cell.get() !=
nullptr,
1890 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1893 internal::do_function_values<dim, spacedim>(
1895 fe_values->finite_element_output.shape_values,
1896 shape_function_data,
1902 template <
int dim,
int spacedim>
1903 template <
class InputVector>
1906 const InputVector &fe_function,
1908 typename InputVector::value_type>::type>
1913 "update_gradients")));
1914 Assert(fe_values->present_cell.get() !=
nullptr,
1915 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1917 fe_values->present_cell->n_dofs_for_dof_handler());
1921 fe_values->dofs_per_cell);
1922 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1924 internal::do_function_derivatives<1, dim, spacedim>(
1926 fe_values->finite_element_output.shape_gradients,
1927 shape_function_data,
1933 template <
int dim,
int spacedim>
1934 template <
class InputVector>
1937 const InputVector &dof_values,
1944 "update_gradients")));
1945 Assert(fe_values->present_cell.get() !=
nullptr,
1946 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1949 internal::do_function_derivatives<1, dim, spacedim>(
1951 fe_values->finite_element_output.shape_gradients,
1952 shape_function_data,
1958 template <
int dim,
int spacedim>
1959 template <
class InputVector>
1962 const InputVector &fe_function,
1964 typename InputVector::value_type>::type>
1965 &symmetric_gradients)
const
1969 "update_gradients")));
1970 Assert(fe_values->present_cell.get() !=
nullptr,
1971 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1973 fe_values->present_cell->n_dofs_for_dof_handler());
1977 fe_values->dofs_per_cell);
1978 fe_values->present_cell->get_interpolated_dof_values(fe_function,
1980 internal::do_function_symmetric_gradients<dim, spacedim>(
1982 fe_values->finite_element_output.shape_gradients,
1983 shape_function_data,
1984 symmetric_gradients);
1989 template <
int dim,
int spacedim>
1990 template <
class InputVector>
1993 const InputVector & dof_values,
1999 "update_gradients")));
2000 Assert(fe_values->present_cell.get() !=
nullptr,
2001 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2004 internal::do_function_symmetric_gradients<dim, spacedim>(
2006 fe_values->finite_element_output.shape_gradients,
2007 shape_function_data,
2008 symmetric_gradients);
2013 template <
int dim,
int spacedim>
2014 template <
class InputVector>
2017 const InputVector &fe_function,
2019 typename InputVector::value_type>::type>
2024 "update_gradients")));
2025 Assert(fe_values->present_cell.get() !=
nullptr,
2026 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2028 fe_values->present_cell->n_dofs_for_dof_handler());
2033 fe_values->dofs_per_cell);
2034 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2036 internal::do_function_divergences<dim, spacedim>(
2038 fe_values->finite_element_output.shape_gradients,
2039 shape_function_data,
2045 template <
int dim,
int spacedim>
2046 template <
class InputVector>
2049 const InputVector &dof_values,
2056 "update_gradients")));
2057 Assert(fe_values->present_cell.get() !=
nullptr,
2058 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2061 internal::do_function_divergences<dim, spacedim>(
2063 fe_values->finite_element_output.shape_gradients,
2064 shape_function_data,
2070 template <
int dim,
int spacedim>
2071 template <
class InputVector>
2074 const InputVector &fe_function,
2081 "update_gradients")));
2082 Assert(fe_values->present_cell.get() !=
nullptr,
2083 ExcMessage(
"FEValues object is not reinited to any cell"));
2085 fe_values->present_cell->n_dofs_for_dof_handler());
2089 fe_values->dofs_per_cell);
2090 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2092 internal::do_function_curls<dim, spacedim>(
2094 fe_values->finite_element_output.shape_gradients,
2095 shape_function_data,
2101 template <
int dim,
int spacedim>
2102 template <
class InputVector>
2105 const InputVector &dof_values,
2112 "update_gradients")));
2113 Assert(fe_values->present_cell.get() !=
nullptr,
2114 ExcMessage(
"FEValues object is not reinited to any cell"));
2117 internal::do_function_curls<dim, spacedim>(
2119 fe_values->finite_element_output.shape_gradients,
2120 shape_function_data,
2126 template <
int dim,
int spacedim>
2127 template <
class InputVector>
2130 const InputVector &fe_function,
2132 typename InputVector::value_type>::type>
2137 "update_hessians")));
2138 Assert(fe_values->present_cell.get() !=
nullptr,
2139 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2141 fe_values->present_cell->n_dofs_for_dof_handler());
2145 fe_values->dofs_per_cell);
2146 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2148 internal::do_function_derivatives<2, dim, spacedim>(
2150 fe_values->finite_element_output.shape_hessians,
2151 shape_function_data,
2157 template <
int dim,
int spacedim>
2158 template <
class InputVector>
2161 const InputVector &dof_values,
2168 "update_hessians")));
2169 Assert(fe_values->present_cell.get() !=
nullptr,
2170 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2173 internal::do_function_derivatives<2, dim, spacedim>(
2175 fe_values->finite_element_output.shape_hessians,
2176 shape_function_data,
2182 template <
int dim,
int spacedim>
2183 template <
class InputVector>
2186 const InputVector &fe_function,
2193 "update_hessians")));
2194 Assert(laplacians.size() == fe_values->n_quadrature_points,
2196 fe_values->n_quadrature_points));
2197 Assert(fe_values->present_cell.get() !=
nullptr,
2198 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2200 fe_function.size() == fe_values->present_cell->n_dofs_for_dof_handler(),
2202 fe_values->present_cell->n_dofs_for_dof_handler()));
2206 fe_values->dofs_per_cell);
2207 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2209 internal::do_function_laplacians<dim, spacedim>(
2211 fe_values->finite_element_output.shape_hessians,
2212 shape_function_data,
2218 template <
int dim,
int spacedim>
2219 template <
class InputVector>
2222 const InputVector &dof_values,
2229 "update_hessians")));
2230 Assert(laplacians.size() == fe_values->n_quadrature_points,
2232 fe_values->n_quadrature_points));
2233 Assert(fe_values->present_cell.get() !=
nullptr,
2234 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2237 internal::do_function_laplacians<dim, spacedim>(
2239 fe_values->finite_element_output.shape_hessians,
2240 shape_function_data,
2246 template <
int dim,
int spacedim>
2247 template <
class InputVector>
2250 const InputVector &fe_function,
2252 typename InputVector::value_type>::type>
2253 &third_derivatives)
const
2257 "update_3rd_derivatives")));
2258 Assert(fe_values->present_cell.get() !=
nullptr,
2259 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2261 fe_values->present_cell->n_dofs_for_dof_handler());
2265 fe_values->dofs_per_cell);
2266 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2268 internal::do_function_derivatives<3, dim, spacedim>(
2270 fe_values->finite_element_output.shape_3rd_derivatives,
2271 shape_function_data,
2277 template <
int dim,
int spacedim>
2278 template <
class InputVector>
2281 const InputVector & dof_values,
2287 "update_3rd_derivatives")));
2288 Assert(fe_values->present_cell.get() !=
nullptr,
2289 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2292 internal::do_function_derivatives<3, dim, spacedim>(
2294 fe_values->finite_element_output.shape_3rd_derivatives,
2295 shape_function_data,
2301 template <
int dim,
int spacedim>
2302 template <
class InputVector>
2305 const InputVector &fe_function,
2313 Assert(fe_values->present_cell.get() !=
nullptr,
2314 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2316 fe_values->present_cell->n_dofs_for_dof_handler());
2320 fe_values->dofs_per_cell);
2321 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2323 internal::do_function_values<dim, spacedim>(
2325 fe_values->finite_element_output.shape_values,
2326 shape_function_data,
2332 template <
int dim,
int spacedim>
2333 template <
class InputVector>
2336 const InputVector &dof_values,
2344 Assert(fe_values->present_cell.get() !=
nullptr,
2345 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2348 internal::do_function_values<dim, spacedim>(
2350 fe_values->finite_element_output.shape_values,
2351 shape_function_data,
2357 template <
int dim,
int spacedim>
2358 template <
class InputVector>
2361 const InputVector &fe_function,
2363 typename InputVector::value_type>::type>
2368 "update_gradients")));
2369 Assert(fe_values->present_cell.get() !=
nullptr,
2370 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2372 fe_values->present_cell->n_dofs_for_dof_handler());
2377 fe_values->dofs_per_cell);
2378 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2380 internal::do_function_divergences<dim, spacedim>(
2382 fe_values->finite_element_output.shape_gradients,
2383 shape_function_data,
2389 template <
int dim,
int spacedim>
2390 template <
class InputVector>
2394 const InputVector &dof_values,
2401 "update_gradients")));
2402 Assert(fe_values->present_cell.get() !=
nullptr,
2403 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2406 internal::do_function_divergences<dim, spacedim>(
2408 fe_values->finite_element_output.shape_gradients,
2409 shape_function_data,
2415 template <
int dim,
int spacedim>
2416 template <
class InputVector>
2419 const InputVector &fe_function,
2427 Assert(fe_values->present_cell.get() !=
nullptr,
2428 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2430 fe_values->present_cell->n_dofs_for_dof_handler());
2434 fe_values->dofs_per_cell);
2435 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2437 internal::do_function_values<dim, spacedim>(
2439 fe_values->finite_element_output.shape_values,
2440 shape_function_data,
2446 template <
int dim,
int spacedim>
2447 template <
class InputVector>
2450 const InputVector &dof_values,
2458 Assert(fe_values->present_cell.get() !=
nullptr,
2459 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2462 internal::do_function_values<dim, spacedim>(
2464 fe_values->finite_element_output.shape_values,
2465 shape_function_data,
2471 template <
int dim,
int spacedim>
2472 template <
class InputVector>
2475 const InputVector &fe_function,
2477 typename InputVector::value_type>::type>
2482 "update_gradients")));
2483 Assert(fe_values->present_cell.get() !=
nullptr,
2484 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2486 fe_values->present_cell->n_dofs_for_dof_handler());
2491 fe_values->dofs_per_cell);
2492 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2494 internal::do_function_divergences<dim, spacedim>(
2496 fe_values->finite_element_output.shape_gradients,
2497 shape_function_data,
2503 template <
int dim,
int spacedim>
2504 template <
class InputVector>
2507 const InputVector &dof_values,
2514 "update_gradients")));
2515 Assert(fe_values->present_cell.get() !=
nullptr,
2516 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2519 internal::do_function_divergences<dim, spacedim>(
2521 fe_values->finite_element_output.shape_gradients,
2522 shape_function_data,
2528 template <
int dim,
int spacedim>
2529 template <
class InputVector>
2532 const InputVector &fe_function,
2534 typename InputVector::value_type>::type>
2539 "update_gradients")));
2540 Assert(fe_values->present_cell.get() !=
nullptr,
2541 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2543 fe_values->present_cell->n_dofs_for_dof_handler());
2548 fe_values->dofs_per_cell);
2549 fe_values->present_cell->get_interpolated_dof_values(fe_function,
2551 internal::do_function_gradients<dim, spacedim>(
2553 fe_values->finite_element_output.shape_gradients,
2554 shape_function_data,
2560 template <
int dim,
int spacedim>
2561 template <
class InputVector>
2564 const InputVector &dof_values,
2571 "update_gradients")));
2572 Assert(fe_values->present_cell.get() !=
nullptr,
2573 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2576 internal::do_function_gradients<dim, spacedim>(
2578 fe_values->finite_element_output.shape_gradients,
2579 shape_function_data,
2590 template <
int dim,
int spacedim>
2596 scalars.reserve(n_scalars);
2597 for (
unsigned int component = 0; component < n_scalars; ++component)
2598 scalars.emplace_back(fe_values, component);
2603 const unsigned int n_vectors =
2605 vectors.reserve(n_vectors);
2606 for (
unsigned int component = 0; component < n_vectors; ++component)
2607 vectors.emplace_back(fe_values, component);
2610 const unsigned int n_symmetric_second_order_tensors =
2614 symmetric_second_order_tensors.reserve(n_symmetric_second_order_tensors);
2615 for (
unsigned int component = 0;
2616 component < n_symmetric_second_order_tensors;
2618 symmetric_second_order_tensors.emplace_back(fe_values, component);
2622 const unsigned int n_second_order_tensors =
2625 second_order_tensors.reserve(n_second_order_tensors);
2626 for (
unsigned int component = 0; component < n_second_order_tensors;
2628 second_order_tensors.emplace_back(fe_values, component);
2636 template <
int dim,
int spacedim>
2660 n_dofs_for_dof_handler()
const = 0;
2662 #include "fe_values.decl.1.inst"
2669 get_interpolated_dof_values(
const IndexSet & in,
2670 Vector<IndexSet::value_type> &out)
const = 0;
2682 template <
int dim,
int spacedim>
2683 template <
typename CI>
2707 n_dofs_for_dof_handler()
const override;
2709 #include "fe_values.decl.2.inst"
2716 get_interpolated_dof_values(
const IndexSet & in,
2717 Vector<IndexSet::value_type> &out)
const override;
2747 template <
int dim,
int spacedim>
2773 n_dofs_for_dof_handler()
const override;
2775 #include "fe_values.decl.2.inst"
2782 get_interpolated_dof_values(
const IndexSet & in,
2783 Vector<IndexSet::value_type> &out)
const override;
2804 template <
int dim,
int spacedim>
2805 template <
typename CI>
2812 template <
int dim,
int spacedim>
2813 template <
typename CI>
2822 template <
int dim,
int spacedim>
2823 template <
typename CI>
2827 return cell->get_dof_handler().n_dofs();
2832 #include "fe_values.impl.1.inst"
2836 template <
int dim,
int spacedim>
2837 template <
typename CI>
2841 Vector<IndexSet::value_type> &out)
const
2846 cell->get_fe().dofs_per_cell);
2849 for (
unsigned int i = 0; i < cell->get_fe().
dofs_per_cell; ++i)
2856 template <
int dim,
int spacedim>
2858 spacedim>::TriaCellIterator::message_string =
2859 (
"You have previously called the FEValues::reinit function with a\n"
2860 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However,\n"
2861 "when you do this, you cannot call some functions in the FEValues\n"
2862 "class, such as the get_function_values/gradients/hessians/third_derivatives\n"
2863 "functions. If you need these functions, then you need to call\n"
2864 "FEValues::reinit with an iterator type that allows to extract\n"
2865 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
2869 template <
int dim,
int spacedim>
2877 template <
int dim,
int spacedim>
2886 template <
int dim,
int spacedim>
2896 #include "fe_values.impl.2.inst"
2900 template <
int dim,
int spacedim>
2904 Vector<IndexSet::value_type> &)
const
2913 namespace FEValuesImplementation
2915 template <
int dim,
int spacedim>
2923 n_quadrature_points,
2928 numbers::signaling_nan<double>());
2931 this->jacobians.resize(
2936 this->jacobian_grads.resize(
2941 this->jacobian_pushed_forward_grads.resize(
2945 this->jacobian_2nd_derivatives.resize(
2950 this->jacobian_pushed_forward_2nd_derivatives.resize(
2957 this->jacobian_pushed_forward_3rd_derivatives.resize(
2961 this->inverse_jacobians.resize(
2966 this->boundary_forms.resize(
2970 this->normal_vectors.resize(
2976 template <
int dim,
int spacedim>
2987 jacobian_pushed_forward_2nd_derivatives) +
2990 jacobian_pushed_forward_3rd_derivatives) +
2999 template <
int dim,
int spacedim>
3009 this->shape_function_to_row_table =
3014 unsigned int n_nonzero_shape_components = 0;
3015 for (
unsigned int i = 0; i <
fe.dofs_per_cell; ++i)
3016 n_nonzero_shape_components +=
fe.n_nonzero_components(i);
3017 Assert(n_nonzero_shape_components >=
fe.dofs_per_cell,
3024 this->shape_values.reinit(n_nonzero_shape_components,
3026 this->shape_values.fill(numbers::signaling_nan<double>());
3031 this->shape_gradients.reinit(n_nonzero_shape_components,
3033 this->shape_gradients.fill(
3039 this->shape_hessians.reinit(n_nonzero_shape_components,
3041 this->shape_hessians.fill(
3047 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
3049 this->shape_3rd_derivatives.fill(
3056 template <
int dim,
int spacedim>
3075 template <
int dim,
int spacedim>
3077 const unsigned int n_q_points,
3085 ,
fe(&
fe, typeid(*this).name())
3090 ExcMessage(
"There is nothing useful you can do with an FEValues "
3091 "object when using a quadrature formula with zero "
3092 "quadrature points!"));
3098 template <
int dim,
int spacedim>
3101 tria_listener_refinement.disconnect();
3102 tria_listener_mesh_transform.disconnect();
3116 template <
typename Number,
typename Number2>
3119 const ::Table<2, double> &shape_values,
3120 std::vector<Number> & values)
3123 const unsigned int dofs_per_cell = shape_values.n_rows();
3124 const unsigned int n_quadrature_points =
3125 dofs_per_cell > 0 ? shape_values.n_cols() : values.size();
3129 std::fill_n(values.begin(),
3130 n_quadrature_points,
3140 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3142 const Number2
value = dof_values_ptr[shape_func];
3150 const double *shape_value_ptr = &shape_values(shape_func, 0);
3152 values[
point] +=
value * (*shape_value_ptr++);
3158 template <
int dim,
int spacedim,
typename VectorType>
3161 const typename VectorType::value_type *dof_values_ptr,
3162 const ::Table<2, double> & shape_values,
3164 const std::vector<unsigned int> & shape_function_to_row_table,
3166 const bool quadrature_points_fastest =
false,
3167 const unsigned int component_multiple = 1)
3169 using Number =
typename VectorType::value_type;
3171 for (
unsigned int i = 0; i < values.
size(); ++i)
3172 std::fill_n(values[i].
begin(),
3174 typename VectorType::value_type());
3179 if (dofs_per_cell == 0)
3182 const unsigned int n_quadrature_points = shape_values.n_cols();
3186 const unsigned result_components =
n_components * component_multiple;
3187 (void)result_components;
3188 if (quadrature_points_fastest)
3191 for (
unsigned int i = 0; i < values.
size(); ++i)
3197 for (
unsigned int i = 0; i < values.
size(); ++i)
3204 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3205 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3208 const Number &
value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3217 const unsigned int comp =
3220 const unsigned int row =
3221 shape_function_to_row_table[shape_func *
n_components + comp];
3223 const double *shape_value_ptr = &shape_values(row, 0);
3225 if (quadrature_points_fastest)
3228 for (
unsigned int point = 0;
point < n_quadrature_points;
3230 values_comp[
point] +=
value * (*shape_value_ptr++);
3233 for (
unsigned int point = 0;
point < n_quadrature_points;
3235 values[
point][comp] +=
value * (*shape_value_ptr++);
3243 const unsigned int row =
3244 shape_function_to_row_table[shape_func *
n_components + c];
3246 const double * shape_value_ptr = &shape_values(row, 0);
3249 if (quadrature_points_fastest)
3252 for (
unsigned int point = 0;
point < n_quadrature_points;
3254 values_comp[
point] +=
value * (*shape_value_ptr++);
3257 for (
unsigned int point = 0;
point < n_quadrature_points;
3259 values[
point][comp] +=
value * (*shape_value_ptr++);
3268 template <
int order,
int spacedim,
typename Number>
3271 const Number * dof_values_ptr,
3275 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
3276 const unsigned int n_quadrature_points =
3277 dofs_per_cell > 0 ? shape_derivatives[0].size() : derivatives.size();
3281 std::fill_n(derivatives.begin(),
3282 n_quadrature_points,
3292 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3294 const Number &
value = dof_values_ptr[shape_func];
3302 &shape_derivatives[shape_func][0];
3304 derivatives[
point] +=
value * (*shape_derivative_ptr++);
3310 template <
int order,
int dim,
int spacedim,
typename Number>
3313 const Number * dof_values_ptr,
3316 const std::vector<unsigned int> &shape_function_to_row_table,
3318 const bool quadrature_points_fastest =
false,
3319 const unsigned int component_multiple = 1)
3322 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3323 std::fill_n(derivatives[i].
begin(),
3324 derivatives[i].size(),
3330 if (dofs_per_cell == 0)
3334 const unsigned int n_quadrature_points = shape_derivatives[0].size();
3338 const unsigned result_components =
n_components * component_multiple;
3339 (void)result_components;
3340 if (quadrature_points_fastest)
3343 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3349 for (
unsigned int i = 0; i < derivatives.size(); ++i)
3356 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3357 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3360 const Number &
value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3369 const unsigned int comp =
3372 const unsigned int row =
3373 shape_function_to_row_table[shape_func *
n_components + comp];
3376 &shape_derivatives[row][0];
3378 if (quadrature_points_fastest)
3379 for (
unsigned int point = 0;
point < n_quadrature_points;
3381 derivatives[comp][
point] +=
value * (*shape_derivative_ptr++);
3383 for (
unsigned int point = 0;
point < n_quadrature_points;
3385 derivatives[
point][comp] +=
value * (*shape_derivative_ptr++);
3393 const unsigned int row =
3394 shape_function_to_row_table[shape_func *
n_components + c];
3397 &shape_derivatives[row][0];
3400 if (quadrature_points_fastest)
3401 for (
unsigned int point = 0;
point < n_quadrature_points;
3403 derivatives[comp][
point] +=
3404 value * (*shape_derivative_ptr++);
3406 for (
unsigned int point = 0;
point < n_quadrature_points;
3408 derivatives[
point][comp] +=
3409 value * (*shape_derivative_ptr++);
3416 template <
int spacedim,
typename Number,
typename Number2>
3419 const Number2 * dof_values_ptr,
3421 std::vector<Number> & laplacians)
3423 const unsigned int dofs_per_cell = shape_hessians.size()[0];
3424 const unsigned int n_quadrature_points =
3425 dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size();
3429 std::fill_n(laplacians.begin(),
3430 n_quadrature_points,
3436 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
3438 const Number2
value = dof_values_ptr[shape_func];
3447 &shape_hessians[shape_func][0];
3455 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3458 const Number * dof_values_ptr,
3461 const std::vector<unsigned int> & shape_function_to_row_table,
3462 std::vector<VectorType> & laplacians,
3463 const bool quadrature_points_fastest =
false,
3464 const unsigned int component_multiple = 1)
3467 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3468 std::fill_n(laplacians[i].
begin(),
3469 laplacians[i].size(),
3470 typename VectorType::value_type());
3475 if (dofs_per_cell == 0)
3479 const unsigned int n_quadrature_points = shape_hessians[0].size();
3483 const unsigned result_components =
n_components * component_multiple;
3484 (void)result_components;
3485 if (quadrature_points_fastest)
3488 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3494 for (
unsigned int i = 0; i < laplacians.size(); ++i)
3501 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3502 for (
unsigned int shape_func = 0; shape_func < dofs_per_cell;
3505 const Number &
value = dof_values_ptr[shape_func + mc * dofs_per_cell];
3514 const unsigned int comp =
3517 const unsigned int row =
3518 shape_function_to_row_table[shape_func *
n_components + comp];
3521 &shape_hessians[row][0];
3522 if (quadrature_points_fastest)
3524 VectorType &laplacians_comp = laplacians[comp];
3525 for (
unsigned int point = 0;
point < n_quadrature_points;
3527 laplacians_comp[
point] +=
3531 for (
unsigned int point = 0;
point < n_quadrature_points;
3533 laplacians[
point][comp] +=
3542 const unsigned int row =
3543 shape_function_to_row_table[shape_func *
n_components + c];
3546 &shape_hessians[row][0];
3549 if (quadrature_points_fastest)
3551 VectorType &laplacians_comp = laplacians[comp];
3552 for (
unsigned int point = 0;
point < n_quadrature_points;
3554 laplacians_comp[
point] +=
3558 for (
unsigned int point = 0;
point < n_quadrature_points;
3560 laplacians[
point][comp] +=
3569 template <
int dim,
int spacedim>
3570 template <
class InputVector>
3573 const InputVector & fe_function,
3574 std::vector<typename InputVector::value_type> &values)
const
3576 using Number =
typename InputVector::value_type;
3580 Assert(present_cell.get() !=
nullptr,
3581 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3582 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3585 Vector<Number> dof_values(dofs_per_cell);
3586 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3588 this->finite_element_output.shape_values,
3594 template <
int dim,
int spacedim>
3595 template <
class InputVector>
3598 const InputVector & fe_function,
3600 std::vector<typename InputVector::value_type> & values)
const
3602 using Number =
typename InputVector::value_type;
3608 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3609 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3612 this->finite_element_output.shape_values,
3618 template <
int dim,
int spacedim>
3619 template <
class InputVector>
3622 const InputVector & fe_function,
3623 std::vector<Vector<typename InputVector::value_type>> &values)
const
3625 using Number =
typename InputVector::value_type;
3626 Assert(present_cell.get() !=
nullptr,
3627 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3631 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3634 Vector<Number> dof_values(dofs_per_cell);
3635 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3638 this->finite_element_output.shape_values,
3640 this->finite_element_output.shape_function_to_row_table,
3646 template <
int dim,
int spacedim>
3647 template <
class InputVector>
3650 const InputVector & fe_function,
3652 std::vector<Vector<typename InputVector::value_type>> &values)
const
3654 using Number =
typename InputVector::value_type;
3662 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3663 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3667 this->finite_element_output.shape_values,
3669 this->finite_element_output.shape_function_to_row_table,
3672 indices.
size() / dofs_per_cell);
3677 template <
int dim,
int spacedim>
3678 template <
class InputVector>
3681 const InputVector & fe_function,
3683 ArrayView<std::vector<typename InputVector::value_type>> values,
3684 bool quadrature_points_fastest)
const
3686 using Number =
typename InputVector::value_type;
3695 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3696 for (
unsigned int i = 0; i < indices.
size(); ++i)
3700 this->finite_element_output.shape_values,
3702 this->finite_element_output.shape_function_to_row_table,
3704 quadrature_points_fastest,
3705 indices.
size() / dofs_per_cell);
3710 template <
int dim,
int spacedim>
3711 template <
class InputVector>
3714 const InputVector &fe_function,
3718 using Number =
typename InputVector::value_type;
3722 Assert(present_cell.get() !=
nullptr,
3723 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3724 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3727 Vector<Number> dof_values(dofs_per_cell);
3728 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3730 this->finite_element_output.shape_gradients,
3736 template <
int dim,
int spacedim>
3737 template <
class InputVector>
3740 const InputVector & fe_function,
3745 using Number =
typename InputVector::value_type;
3751 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3752 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3755 this->finite_element_output.shape_gradients,
3761 template <
int dim,
int spacedim>
3762 template <
class InputVector>
3765 const InputVector &fe_function,
3770 using Number =
typename InputVector::value_type;
3773 Assert(present_cell.get() !=
nullptr,
3774 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3775 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3778 Vector<Number> dof_values(dofs_per_cell);
3779 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3782 this->finite_element_output.shape_gradients,
3784 this->finite_element_output.shape_function_to_row_table,
3790 template <
int dim,
int spacedim>
3791 template <
class InputVector>
3794 const InputVector & fe_function,
3798 bool quadrature_points_fastest)
const
3800 using Number =
typename InputVector::value_type;
3808 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3809 for (
unsigned int i = 0; i < indices.
size(); ++i)
3813 this->finite_element_output.shape_gradients,
3815 this->finite_element_output.shape_function_to_row_table,
3817 quadrature_points_fastest,
3818 indices.
size() / dofs_per_cell);
3823 template <
int dim,
int spacedim>
3824 template <
class InputVector>
3827 const InputVector &fe_function,
3831 using Number =
typename InputVector::value_type;
3835 Assert(present_cell.get() !=
nullptr,
3836 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3837 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3840 Vector<Number> dof_values(dofs_per_cell);
3841 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3843 this->finite_element_output.shape_hessians,
3849 template <
int dim,
int spacedim>
3850 template <
class InputVector>
3853 const InputVector & fe_function,
3858 using Number =
typename InputVector::value_type;
3861 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3864 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3865 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3868 this->finite_element_output.shape_hessians,
3874 template <
int dim,
int spacedim>
3875 template <
class InputVector>
3878 const InputVector &fe_function,
3882 bool quadrature_points_fastest)
const
3884 using Number =
typename InputVector::value_type;
3887 Assert(present_cell.get() !=
nullptr,
3888 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3889 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3892 Vector<Number> dof_values(dofs_per_cell);
3893 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3896 this->finite_element_output.shape_hessians,
3898 this->finite_element_output.shape_function_to_row_table,
3900 quadrature_points_fastest);
3905 template <
int dim,
int spacedim>
3906 template <
class InputVector>
3909 const InputVector & fe_function,
3913 bool quadrature_points_fastest)
const
3915 using Number =
typename InputVector::value_type;
3921 boost::container::small_vector<Number, 200> dof_values(indices.
size());
3922 for (
unsigned int i = 0; i < indices.
size(); ++i)
3926 this->finite_element_output.shape_hessians,
3928 this->finite_element_output.shape_function_to_row_table,
3930 quadrature_points_fastest,
3931 indices.
size() / dofs_per_cell);
3936 template <
int dim,
int spacedim>
3937 template <
class InputVector>
3940 const InputVector & fe_function,
3941 std::vector<typename InputVector::value_type> &laplacians)
const
3943 using Number =
typename InputVector::value_type;
3947 Assert(present_cell.get() !=
nullptr,
3948 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3949 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
3952 Vector<Number> dof_values(dofs_per_cell);
3953 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3955 this->finite_element_output.shape_hessians,
3961 template <
int dim,
int spacedim>
3962 template <
class InputVector>
3965 const InputVector & fe_function,
3967 std::vector<typename InputVector::value_type> & laplacians)
const
3969 using Number =
typename InputVector::value_type;
3975 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3976 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3979 this->finite_element_output.shape_hessians,
3985 template <
int dim,
int spacedim>
3986 template <
class InputVector>
3989 const InputVector & fe_function,
3990 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const
3992 using Number =
typename InputVector::value_type;
3993 Assert(present_cell.get() !=
nullptr,
3994 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
3997 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4000 Vector<Number> dof_values(dofs_per_cell);
4001 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4004 this->finite_element_output.shape_hessians,
4006 this->finite_element_output.shape_function_to_row_table,
4012 template <
int dim,
int spacedim>
4013 template <
class InputVector>
4016 const InputVector & fe_function,
4018 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const
4020 using Number =
typename InputVector::value_type;
4028 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4029 for (
unsigned int i = 0; i < indices.
size(); ++i)
4033 this->finite_element_output.shape_hessians,
4035 this->finite_element_output.shape_function_to_row_table,
4038 indices.
size() / dofs_per_cell);
4043 template <
int dim,
int spacedim>
4044 template <
class InputVector>
4047 const InputVector & fe_function,
4049 std::vector<std::vector<typename InputVector::value_type>> &laplacians,
4050 bool quadrature_points_fastest)
const
4052 using Number =
typename InputVector::value_type;
4058 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4059 for (
unsigned int i = 0; i < indices.
size(); ++i)
4063 this->finite_element_output.shape_hessians,
4065 this->finite_element_output.shape_function_to_row_table,
4067 quadrature_points_fastest,
4068 indices.
size() / dofs_per_cell);
4073 template <
int dim,
int spacedim>
4074 template <
class InputVector>
4077 const InputVector &fe_function,
4079 &third_derivatives)
const
4081 using Number =
typename InputVector::value_type;
4085 Assert(present_cell.get() !=
nullptr,
4086 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4087 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4090 Vector<Number> dof_values(dofs_per_cell);
4091 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4094 this->finite_element_output.shape_3rd_derivatives,
4100 template <
int dim,
int spacedim>
4101 template <
class InputVector>
4104 const InputVector & fe_function,
4107 &third_derivatives)
const
4109 using Number =
typename InputVector::value_type;
4112 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4115 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
4116 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
4120 this->finite_element_output.shape_3rd_derivatives,
4126 template <
int dim,
int spacedim>
4127 template <
class InputVector>
4130 const InputVector &fe_function,
4133 & third_derivatives,
4134 bool quadrature_points_fastest)
const
4136 using Number =
typename InputVector::value_type;
4139 Assert(present_cell.get() !=
nullptr,
4140 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
4141 AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler());
4144 Vector<Number> dof_values(dofs_per_cell);
4145 present_cell->get_interpolated_dof_values(fe_function, dof_values);
4148 this->finite_element_output.shape_3rd_derivatives,
4150 this->finite_element_output.shape_function_to_row_table,
4152 quadrature_points_fastest);
4157 template <
int dim,
int spacedim>
4158 template <
class InputVector>
4161 const InputVector & fe_function,
4165 bool quadrature_points_fastest)
const
4167 using Number =
typename InputVector::value_type;
4173 boost::container::small_vector<Number, 200> dof_values(indices.
size());
4174 for (
unsigned int i = 0; i < indices.
size(); ++i)
4178 this->finite_element_output.shape_3rd_derivatives,
4180 this->finite_element_output.shape_function_to_row_table,
4182 quadrature_points_fastest,
4183 indices.
size() / dofs_per_cell);
4188 template <
int dim,
int spacedim>
4192 return *present_cell;
4197 template <
int dim,
int spacedim>
4198 const std::vector<Tensor<1, spacedim>> &
4203 "update_normal_vectors")));
4205 return this->mapping_output.normal_vectors;
4210 template <
int dim,
int spacedim>
4214 return (
sizeof(this->update_flags) +
4216 sizeof(cell_similarity) +
4230 template <
int dim,
int spacedim>
4241 UpdateFlags flags = update_flags | fe->requires_update_flags(update_flags);
4242 flags |= mapping->requires_update_flags(flags);
4249 template <
int dim,
int spacedim>
4260 tria_listener_refinement.disconnect();
4261 tria_listener_mesh_transform.disconnect();
4262 present_cell.reset();
4267 template <
int dim,
int spacedim>
4272 if (present_cell.get() !=
nullptr)
4274 if (&cell->get_triangulation() !=
4278 ->get_triangulation())
4285 invalidate_present_cell();
4286 tria_listener_refinement =
4287 cell->get_triangulation().signals.any_change.connect(
4288 [
this]() { this->invalidate_present_cell(); });
4289 tria_listener_mesh_transform =
4290 cell->get_triangulation().signals.mesh_movement.connect(
4291 [
this]() { this->invalidate_present_cell(); });
4299 tria_listener_refinement =
4300 cell->get_triangulation().signals.post_refinement.connect(
4301 [
this]() { this->invalidate_present_cell(); });
4302 tria_listener_mesh_transform =
4303 cell->get_triangulation().signals.mesh_movement.connect(
4304 [
this]() { this->invalidate_present_cell(); });
4310 template <
int dim,
int spacedim>
4337 if (this->present_cell.get() ==
nullptr)
4346 (cell->is_translation_of(
4348 &
>(*this->present_cell)) ?
4355 &
>(*this->present_cell)
4356 ->direction_flag() != cell->direction_flag())
4365 template <
int dim,
int spacedim>
4369 return cell_similarity;
4374 template <
int dim,
int spacedim>
4379 template <
int dim,
int spacedim>
4384 template <
int dim,
int spacedim>
4389 template <
int dim,
int spacedim>
4406 template <
int dim,
int spacedim>
4422 template <
int dim,
int spacedim>
4428 if (dim != spacedim - 1)
4430 ExcMessage(
"You can only pass the 'update_normal_vectors' "
4431 "flag to FEFaceValues or FESubfaceValues objects, "
4432 "but not to an FEValues object unless the "
4433 "triangulation it refers to is embedded in a higher "
4434 "dimensional space."));
4436 const UpdateFlags flags = this->compute_update_flags(update_flags);
4440 this->mapping_output.initialize(this->n_quadrature_points, flags);
4441 this->finite_element_output.initialize(this->n_quadrature_points,
4448 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4454 this->finite_element_output);
4456 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4464 this->update_flags = flags;
4467 this->fe_data = std::move(fe_get_data.return_value());
4469 this->mapping_data = std::move(mapping_get_data.return_value());
4471 this->mapping_data = std_cxx14::make_unique<
4483 template <
typename Type,
typename Po
inter,
typename Iterator>
4485 reset_pointer_in_place_if_possible(std::unique_ptr<Pointer> &present_cell,
4491 if (present_cell.get() && (
typeid(*present_cell.get()) ==
typeid(Type)))
4494 static_cast<const Type *
>(present_cell.get())->~Type();
4497 new (
const_cast<void *
>(
static_cast<const void *
>(present_cell.get())))
4502 present_cell = std_cxx14::make_unique<Type>(new_cell);
4508 template <
int dim,
int spacedim>
4515 this->maybe_invalidate_previous_present_cell(cell);
4516 this->check_cell_similarity(cell);
4518 reset_pointer_in_place_if_possible<
4530 template <
int dim,
int spacedim>
4531 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4542 this->maybe_invalidate_previous_present_cell(cell);
4543 this->check_cell_similarity(cell);
4545 reset_pointer_in_place_if_possible<
4548 this->present_cell, cell);
4558 template <
int dim,
int spacedim>
4568 this->cell_similarity =
4569 this->get_mapping().fill_fe_values(*this->present_cell,
4570 this->cell_similarity,
4572 *this->mapping_data,
4573 this->mapping_output);
4580 this->get_fe().fill_fe_values(*this->present_cell,
4581 this->cell_similarity,
4583 this->get_mapping(),
4584 *this->mapping_data,
4585 this->mapping_output,
4587 this->finite_element_output);
4592 template <
int dim,
int spacedim>
4604 template <
int dim,
int spacedim>
4606 const unsigned int n_q_points,
4607 const unsigned int dofs_per_cell,
4618 , quadrature(quadrature)
4623 template <
int dim,
int spacedim>
4624 const std::vector<Tensor<1, spacedim>> &
4629 "update_boundary_forms")));
4630 return this->mapping_output.boundary_forms;
4635 template <
int dim,
int spacedim>
4646 template <
int dim,
int spacedim>
4651 template <
int dim,
int spacedim>
4656 template <
int dim,
int spacedim>
4674 template <
int dim,
int spacedim>
4691 template <
int dim,
int spacedim>
4695 const UpdateFlags flags = this->compute_update_flags(update_flags);
4699 this->mapping_output.initialize(this->n_quadrature_points, flags);
4700 this->finite_element_output.initialize(this->n_quadrature_points,
4707 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4714 this->finite_element_output);
4716 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4724 this->update_flags = flags;
4727 this->fe_data = std::move(fe_get_data.return_value());
4729 this->mapping_data = std::move(mapping_get_data.return_value());
4731 this->mapping_data = std_cxx14::make_unique<
4737 template <
int dim,
int spacedim>
4738 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4742 const unsigned int face_no)
4748 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4753 this->maybe_invalidate_previous_present_cell(cell);
4754 reset_pointer_in_place_if_possible<
4757 this->present_cell, cell);
4767 template <
int dim,
int spacedim>
4768 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4774 const auto face_n = cell->face_iterator_to_index(face);
4780 template <
int dim,
int spacedim>
4784 const unsigned int face_no)
4788 this->maybe_invalidate_previous_present_cell(cell);
4789 reset_pointer_in_place_if_possible<
4801 template <
int dim,
int spacedim>
4807 const auto face_n = cell->face_iterator_to_index(face);
4813 template <
int dim,
int spacedim>
4819 *this->present_cell;
4820 this->present_face_index = cell->face_index(face_no);
4824 this->get_mapping().fill_fe_face_values(*this->present_cell,
4827 *this->mapping_data,
4828 this->mapping_output);
4831 this->get_fe().fill_fe_face_values(*this->present_cell,
4834 this->get_mapping(),
4835 *this->mapping_data,
4836 this->mapping_output,
4838 this->finite_element_output);
4845 template <
int dim,
int spacedim>
4850 template <
int dim,
int spacedim>
4855 template <
int dim,
int spacedim>
4873 template <
int dim,
int spacedim>
4890 template <
int dim,
int spacedim>
4894 const UpdateFlags flags = this->compute_update_flags(update_flags);
4898 this->mapping_output.initialize(this->n_quadrature_points, flags);
4899 this->finite_element_output.initialize(this->n_quadrature_points,
4907 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4914 this->finite_element_output);
4916 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4925 this->update_flags = flags;
4928 this->fe_data = std::move(fe_get_data.return_value());
4930 this->mapping_data = std::move(mapping_get_data.return_value());
4932 this->mapping_data = std_cxx14::make_unique<
4938 template <
int dim,
int spacedim>
4939 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4943 const unsigned int face_no,
4944 const unsigned int subface_no)
4950 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4957 Assert(cell->face(face_no)->has_children() ||
4962 Assert(!cell->face(face_no)->has_children() ||
4963 subface_no < cell->face(face_no)->number_of_children(),
4966 cell->face(face_no)->number_of_children()));
4967 Assert(cell->has_children() ==
false,
4968 ExcMessage(
"You can't use subface data for cells that are "
4969 "already refined. Iterate over their children "
4970 "instead in these cases."));
4972 this->maybe_invalidate_previous_present_cell(cell);
4973 reset_pointer_in_place_if_possible<
4976 this->present_cell, cell);
4981 do_reinit(face_no, subface_no);
4986 template <
int dim,
int spacedim>
4987 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4995 cell->face_iterator_to_index(face),
4996 face->child_iterator_to_index(subface));
5001 template <
int dim,
int spacedim>
5005 const unsigned int face_no,
5006 const unsigned int subface_no)
5014 (cell->has_periodic_neighbor(face_no) ?
5015 cell->periodic_neighbor(face_no)
5016 ->face(cell->periodic_neighbor_face_no(face_no))
5018 cell->face(face_no)->n_children()));
5020 this->maybe_invalidate_previous_present_cell(cell);
5021 reset_pointer_in_place_if_possible<
5028 do_reinit(face_no, subface_no);
5033 template <
int dim,
int spacedim>
5041 cell->face_iterator_to_index(face),
5042 face->child_iterator_to_index(subface));
5047 template <
int dim,
int spacedim>
5050 const unsigned int subface_no)
5054 *this->present_cell;
5056 if (!cell->face(face_no)->has_children())
5059 this->present_face_index = cell->face_index(face_no);
5061 this->present_face_index = cell->face(face_no)->child_index(subface_no);
5067 switch (cell->subface_case(face_no))
5072 subface_index = cell->face(face_no)->child_index(subface_no);
5076 subface_index = cell->face(face_no)
5077 ->child(subface_no / 2)
5078 ->child_index(subface_no % 2);
5087 cell->face(face_no)->child(0)->child_index(subface_no);
5090 subface_index = cell->face(face_no)->child_index(1);
5101 subface_index = cell->face(face_no)->child_index(0);
5106 cell->face(face_no)->child(1)->child_index(subface_no - 1);
5118 this->present_face_index = subface_index;
5124 this->get_mapping().fill_fe_subface_values(*this->present_cell,
5128 *this->mapping_data,
5129 this->mapping_output);
5132 this->get_fe().fill_fe_subface_values(*this->present_cell,
5136 this->get_mapping(),
5137 *this->mapping_data,
5138 this->mapping_output,
5140 this->finite_element_output);
5145 #define SPLIT_INSTANTIATIONS_COUNT 6
5146 #ifndef SPLIT_INSTANTIATIONS_INDEX
5147 # define SPLIT_INSTANTIATIONS_INDEX 0
5149 #include "fe_values.inst"