16 #ifndef dealii_fe_values_h
17 #define dealii_fe_values_h
45 #include <type_traits>
51 #ifdef DEAL_II_WITH_PETSC
59 template <
int dim,
int spacedim = dim>
69 template <
int dim,
class NumberType =
double>
78 template <
class NumberType>
90 template <
class NumberType>
102 template <
class NumberType>
145 template <
int dim,
int spacedim = dim>
181 template <
typename Number>
286 value(
const unsigned int shape_function,
const unsigned int q_point)
const;
299 gradient(
const unsigned int shape_function,
300 const unsigned int q_point)
const;
313 hessian(
const unsigned int shape_function,
314 const unsigned int q_point)
const;
328 const unsigned int q_point)
const;
347 template <
class InputVector>
350 const InputVector &fe_function,
352 typename InputVector::value_type>::type>
377 template <
class InputVector>
380 const InputVector &dof_values,
402 template <
class InputVector>
405 const InputVector &fe_function,
407 typename InputVector::value_type>::type>
413 template <
class InputVector>
416 const InputVector &dof_values,
438 template <
class InputVector>
441 const InputVector &fe_function,
443 typename InputVector::value_type>::type>
449 template <
class InputVector>
452 const InputVector &dof_values,
476 template <
class InputVector>
479 const InputVector &fe_function,
481 typename InputVector::value_type>::type>
487 template <
class InputVector>
490 const InputVector &dof_values,
514 template <
class InputVector>
517 const InputVector &fe_function,
519 typename InputVector::value_type>::type>
520 &third_derivatives)
const;
525 template <
class InputVector>
528 const InputVector & dof_values,
582 template <
int dim,
int spacedim = dim>
628 using curl_type = typename ::internal::CurlType<spacedim>::type;
648 template <
typename Number>
795 value(
const unsigned int shape_function,
const unsigned int q_point)
const;
811 gradient(
const unsigned int shape_function,
812 const unsigned int q_point)
const;
831 const unsigned int q_point)
const;
845 const unsigned int q_point)
const;
868 curl(
const unsigned int shape_function,
const unsigned int q_point)
const;
881 hessian(
const unsigned int shape_function,
882 const unsigned int q_point)
const;
896 const unsigned int q_point)
const;
915 template <
class InputVector>
918 const InputVector &fe_function,
920 typename InputVector::value_type>::type>
945 template <
class InputVector>
948 const InputVector &dof_values,
970 template <
class InputVector>
973 const InputVector &fe_function,
975 typename InputVector::value_type>::type>
981 template <
class InputVector>
984 const InputVector &dof_values,
1012 template <
class InputVector>
1015 const InputVector &fe_function,
1017 typename InputVector::value_type>::type>
1018 &symmetric_gradients)
const;
1023 template <
class InputVector>
1026 const InputVector & dof_values,
1048 template <
class InputVector>
1051 const InputVector &fe_function,
1053 typename InputVector::value_type>::type>
1054 &divergences)
const;
1059 template <
class InputVector>
1062 const InputVector &dof_values,
1065 &divergences)
const;
1085 template <
class InputVector>
1088 const InputVector &fe_function,
1096 template <
class InputVector>
1099 const InputVector &dof_values,
1121 template <
class InputVector>
1124 const InputVector &fe_function,
1126 typename InputVector::value_type>::type>
1132 template <
class InputVector>
1135 const InputVector &dof_values,
1158 template <
class InputVector>
1161 const InputVector &fe_function,
1163 typename InputVector::value_type>::type>
1169 template <
class InputVector>
1172 const InputVector &dof_values,
1195 template <
class InputVector>
1198 const InputVector &fe_function,
1200 typename InputVector::value_type>::type>
1201 &third_derivatives)
const;
1206 template <
class InputVector>
1209 const InputVector & dof_values,
1232 template <
int rank,
int dim,
int spacedim = dim>
1259 template <
int dim,
int spacedim>
1286 template <
typename Number>
1310 struct ShapeFunctionData
1320 bool is_nonzero_shape_function_component
1321 [value_type::n_independent_components];
1332 unsigned int row_index[value_type::n_independent_components];
1365 const unsigned int first_tensor_component);
1392 value(
const unsigned int shape_function,
const unsigned int q_point)
const;
1408 divergence(
const unsigned int shape_function,
1409 const unsigned int q_point)
const;
1428 template <
class InputVector>
1430 get_function_values(
1431 const InputVector &fe_function,
1433 typename InputVector::value_type>::type>
1458 template <
class InputVector>
1460 get_function_values_from_local_dof_values(
1461 const InputVector &dof_values,
1487 template <
class InputVector>
1489 get_function_divergences(
1490 const InputVector &fe_function,
1492 typename InputVector::value_type>::type>
1493 &divergences)
const;
1498 template <
class InputVector>
1500 get_function_divergences_from_local_dof_values(
1501 const InputVector &dof_values,
1504 &divergences)
const;
1525 template <
int rank,
int dim,
int spacedim = dim>
1548 template <
int dim,
int spacedim>
1573 template <
typename Number>
1605 struct ShapeFunctionData
1615 bool is_nonzero_shape_function_component
1616 [value_type::n_independent_components];
1627 unsigned int row_index[value_type::n_independent_components];
1660 const unsigned int first_tensor_component);
1687 value(
const unsigned int shape_function,
const unsigned int q_point)
const;
1703 divergence(
const unsigned int shape_function,
1704 const unsigned int q_point)
const;
1720 gradient(
const unsigned int shape_function,
1721 const unsigned int q_point)
const;
1740 template <
class InputVector>
1742 get_function_values(
1743 const InputVector &fe_function,
1745 typename InputVector::value_type>::type>
1770 template <
class InputVector>
1772 get_function_values_from_local_dof_values(
1773 const InputVector &dof_values,
1799 template <
class InputVector>
1801 get_function_divergences(
1802 const InputVector &fe_function,
1804 typename InputVector::value_type>::type>
1805 &divergences)
const;
1810 template <
class InputVector>
1812 get_function_divergences_from_local_dof_values(
1813 const InputVector &dof_values,
1816 &divergences)
const;
1834 template <
class InputVector>
1836 get_function_gradients(
1837 const InputVector &fe_function,
1839 typename InputVector::value_type>::type>
1845 template <
class InputVector>
1847 get_function_gradients_from_local_dof_values(
1848 const InputVector &dof_values,
1884 template <
int dim,
int spacedim,
typename Extractor>
1895 template <
int dim,
int spacedim>
1898 using type = typename ::FEValuesViews::Scalar<dim, spacedim>;
1908 template <
int dim,
int spacedim>
1911 using type = typename ::FEValuesViews::Vector<dim, spacedim>;
1921 template <
int dim,
int spacedim,
int rank>
1924 using type = typename ::FEValuesViews::Tensor<rank, dim, spacedim>;
1934 template <
int dim,
int spacedim,
int rank>
1938 typename ::FEValuesViews::SymmetricTensor<rank, dim, spacedim>;
1948 template <
int dim,
int spacedim>
1955 std::vector<::FEValuesViews::Scalar<dim, spacedim>>
scalars;
1956 std::vector<::FEValuesViews::Vector<dim, spacedim>>
vectors;
1957 std::vector<::FEValuesViews::SymmetricTensor<2, dim, spacedim>>
1959 std::vector<::FEValuesViews::Tensor<2, dim, spacedim>>
1978 template <
int dim,
int spacedim,
typename Extractor>
1979 using View = typename ::internal::FEValuesViews::
1980 ViewType<dim, spacedim, Extractor>::type;
2084 template <
int dim,
int spacedim>
2170 const unsigned int point_no)
const;
2194 const unsigned int point_no,
2195 const unsigned int component)
const;
2244 const unsigned int point_no,
2245 const unsigned int component)
const;
2268 const unsigned int point_no)
const;
2288 const unsigned int point_no,
2289 const unsigned int component)
const;
2312 const unsigned int point_no)
const;
2332 const unsigned int point_no,
2333 const unsigned int component)
const;
2375 template <
class InputVector>
2378 const InputVector & fe_function,
2379 std::vector<typename InputVector::value_type> &values)
const;
2394 template <
class InputVector>
2397 const InputVector & fe_function,
2398 std::vector<Vector<typename InputVector::value_type>> &values)
const;
2418 template <
class InputVector>
2421 const InputVector & fe_function,
2423 std::vector<typename InputVector::value_type> & values)
const;
2446 template <
class InputVector>
2449 const InputVector & fe_function,
2451 std::vector<Vector<typename InputVector::value_type>> &values)
const;
2484 template <
class InputVector>
2487 const InputVector & fe_function,
2489 ArrayView<std::vector<typename InputVector::value_type>> values,
2490 const bool quadrature_points_fastest)
const;
2532 template <
class InputVector>
2535 const InputVector &fe_function,
2555 template <
class InputVector>
2558 const InputVector &fe_function,
2569 template <
class InputVector>
2572 const InputVector & fe_function,
2583 template <
class InputVector>
2586 const InputVector & fe_function,
2591 bool quadrature_points_fastest =
false)
const;
2636 template <
class InputVector>
2639 const InputVector &fe_function,
2660 template <
class InputVector>
2663 const InputVector &fe_function,
2667 bool quadrature_points_fastest =
false)
const;
2673 template <
class InputVector>
2676 const InputVector & fe_function,
2687 template <
class InputVector>
2690 const InputVector & fe_function,
2695 bool quadrature_points_fastest =
false)
const;
2737 template <
class InputVector>
2740 const InputVector & fe_function,
2741 std::vector<typename InputVector::value_type> &laplacians)
const;
2762 template <
class InputVector>
2765 const InputVector & fe_function,
2766 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const;
2774 template <
class InputVector>
2777 const InputVector & fe_function,
2779 std::vector<typename InputVector::value_type> & laplacians)
const;
2787 template <
class InputVector>
2790 const InputVector & fe_function,
2792 std::vector<Vector<typename InputVector::value_type>> &laplacians)
const;
2800 template <
class InputVector>
2803 const InputVector & fe_function,
2805 std::vector<std::vector<typename InputVector::value_type>> &laplacians,
2806 bool quadrature_points_fastest =
false)
const;
2850 template <
class InputVector>
2853 const InputVector &fe_function,
2855 &third_derivatives)
const;
2875 template <
class InputVector>
2878 const InputVector &fe_function,
2881 & third_derivatives,
2882 bool quadrature_points_fastest =
false)
const;
2888 template <
class InputVector>
2891 const InputVector & fe_function,
2894 &third_derivatives)
const;
2902 template <
class InputVector>
2905 const InputVector & fe_function,
2910 bool quadrature_points_fastest =
false)
const;
3051 const std::vector<Point<spacedim>> &
3075 const std::vector<double> &
3093 const std::vector<DerivativeForm<1, dim, spacedim>> &
3112 const std::vector<DerivativeForm<2, dim, spacedim>> &
3132 const std::vector<Tensor<3, spacedim>> &
3151 const std::vector<DerivativeForm<3, dim, spacedim>> &
3173 const std::vector<Tensor<4, spacedim>> &
3193 const std::vector<DerivativeForm<4, dim, spacedim>> &
3215 const std::vector<Tensor<5, spacedim>> &
3233 const std::vector<DerivativeForm<1, spacedim, dim>> &
3265 const std::vector<Tensor<1, spacedim>> &
3374 <<
"You are requesting information from an FEValues/FEFaceValues/FESubfaceValues "
3375 <<
"object for which this kind of information has not been computed. What "
3376 <<
"information these objects compute is determined by the update_* flags you "
3377 <<
"pass to the constructor. Here, the operation you are attempting requires "
3379 <<
"> flag to be set, but it was apparently not specified "
3380 <<
"upon construction.");
3390 "The FiniteElement you provided to FEValues and the FiniteElement that belongs "
3391 "to the DoFHandler that provided the cell iterator do not match.");
3399 <<
"The shape function with index " << arg1
3400 <<
" is not primitive, i.e. it is vector-valued and "
3401 <<
"has more than one non-zero vector component. This "
3402 <<
"function cannot be called for these shape functions. "
3403 <<
"Maybe you want to use the same function with the "
3404 <<
"_component suffix?");
3414 "The given FiniteElement is not a primitive element but the requested operation "
3415 "only works for those. See FiniteElement::is_primitive() for more information.");
3450 class CellIteratorBase;
3456 template <
typename CI>
3458 class TriaCellIterator;
3517 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
3541 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
3597 template <
int,
int,
int>
3599 template <
int,
int,
int>
3615 template <
int dim,
int spacedim = dim>
3649 template <
template <
int,
int>
class DoFHandlerType,
bool level_dof_access>
3652 level_dof_access>> &cell);
3734 template <
int dim,
int spacedim = dim>
3778 const std::vector<Tensor<1, spacedim>> &
3831 template <
int dim,
int spacedim = dim>
3871 template <
template <
int,
int>
class DoFHandlerType,
bool level_dof_access>
3874 level_dof_access>> &cell,
3875 const unsigned int face_no);
3883 template <
template <
int,
int>
class DoFHandlerType,
bool level_dof_access>
3886 level_dof_access>> & cell,
3904 const unsigned int face_no);
3977 template <
int dim,
int spacedim = dim>
4021 template <
template <
int,
int>
class DoFHandlerType,
bool level_dof_access>
4024 level_dof_access>> &cell,
4025 const unsigned int face_no,
4026 const unsigned int subface_no);
4032 template <
template <
int,
int>
class DoFHandlerType,
bool level_dof_access>
4035 level_dof_access>> & cell,
4054 const unsigned int face_no,
4055 const unsigned int subface_no);
4126 do_reinit(
const unsigned int face_no,
const unsigned int subface_no);
4137 template <
int dim,
int spacedim>
4140 const unsigned int q_point)
const
4146 "update_values"))));
4151 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4152 return fe_values->finite_element_output.shape_values(
4153 shape_function_data[shape_function].row_index, q_point);
4160 template <
int dim,
int spacedim>
4163 const unsigned int q_point)
const
4168 "update_gradients")));
4173 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4174 return fe_values->finite_element_output
4175 .shape_gradients[shape_function_data[shape_function].row_index]
4178 return gradient_type();
4183 template <
int dim,
int spacedim>
4186 const unsigned int q_point)
const
4191 "update_hessians")));
4196 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4197 return fe_values->finite_element_output
4198 .shape_hessians[shape_function_data[shape_function].row_index][q_point];
4200 return hessian_type();
4205 template <
int dim,
int spacedim>
4208 const unsigned int q_point)
const
4213 "update_3rd_derivatives")));
4218 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4219 return fe_values->finite_element_output
4220 .shape_3rd_derivatives[shape_function_data[shape_function].row_index]
4223 return third_derivative_type();
4228 template <
int dim,
int spacedim>
4231 const unsigned int q_point)
const
4240 shape_function_data[shape_function].single_nonzero_component;
4246 return_value[shape_function_data[shape_function]
4247 .single_nonzero_component_index] =
4248 fe_values->finite_element_output.shape_values(snc, q_point);
4249 return return_value;
4254 for (
unsigned int d = 0;
d < dim; ++
d)
4255 if (shape_function_data[shape_function]
4256 .is_nonzero_shape_function_component[
d])
4257 return_value[
d] = fe_values->finite_element_output.shape_values(
4258 shape_function_data[shape_function].row_index[
d], q_point);
4260 return return_value;
4266 template <
int dim,
int spacedim>
4269 const unsigned int q_point)
const
4274 "update_gradients")));
4278 shape_function_data[shape_function].single_nonzero_component;
4280 return gradient_type();
4283 gradient_type return_value;
4284 return_value[shape_function_data[shape_function]
4285 .single_nonzero_component_index] =
4286 fe_values->finite_element_output.shape_gradients[snc][q_point];
4287 return return_value;
4291 gradient_type return_value;
4292 for (
unsigned int d = 0;
d < dim; ++
d)
4293 if (shape_function_data[shape_function]
4294 .is_nonzero_shape_function_component[
d])
4296 fe_values->finite_element_output.shape_gradients
4297 [shape_function_data[shape_function].row_index[
d]][q_point];
4299 return return_value;
4305 template <
int dim,
int spacedim>
4308 const unsigned int q_point)
const
4314 "update_gradients")));
4318 shape_function_data[shape_function].single_nonzero_component;
4320 return divergence_type();
4322 return fe_values->finite_element_output
4323 .shape_gradients[snc][q_point][shape_function_data[shape_function]
4324 .single_nonzero_component_index];
4327 divergence_type return_value = 0;
4328 for (
unsigned int d = 0;
d < dim; ++
d)
4329 if (shape_function_data[shape_function]
4330 .is_nonzero_shape_function_component[
d])
4332 fe_values->finite_element_output.shape_gradients
4333 [shape_function_data[shape_function].row_index[
d]][q_point][
d];
4335 return return_value;
4341 template <
int dim,
int spacedim>
4344 const unsigned int q_point)
const
4351 "update_gradients")));
4354 shape_function_data[shape_function].single_nonzero_component;
4366 "Computing the curl in 1d is not a useful operation"));
4374 curl_type return_value;
4377 if (shape_function_data[shape_function]
4378 .single_nonzero_component_index == 0)
4380 -1.0 * fe_values->finite_element_output
4381 .shape_gradients[snc][q_point][1];
4383 return_value[0] = fe_values->finite_element_output
4384 .shape_gradients[snc][q_point][0];
4386 return return_value;
4391 curl_type return_value;
4393 return_value[0] = 0.0;
4395 if (shape_function_data[shape_function]
4396 .is_nonzero_shape_function_component[0])
4398 fe_values->finite_element_output
4399 .shape_gradients[shape_function_data[shape_function]
4400 .row_index[0]][q_point][1];
4402 if (shape_function_data[shape_function]
4403 .is_nonzero_shape_function_component[1])
4405 fe_values->finite_element_output
4406 .shape_gradients[shape_function_data[shape_function]
4407 .row_index[1]][q_point][0];
4409 return return_value;
4417 curl_type return_value;
4419 switch (shape_function_data[shape_function]
4420 .single_nonzero_component_index)
4424 return_value[0] = 0;
4425 return_value[1] = fe_values->finite_element_output
4426 .shape_gradients[snc][q_point][2];
4428 -1.0 * fe_values->finite_element_output
4429 .shape_gradients[snc][q_point][1];
4430 return return_value;
4436 -1.0 * fe_values->finite_element_output
4437 .shape_gradients[snc][q_point][2];
4438 return_value[1] = 0;
4439 return_value[2] = fe_values->finite_element_output
4440 .shape_gradients[snc][q_point][0];
4441 return return_value;
4446 return_value[0] = fe_values->finite_element_output
4447 .shape_gradients[snc][q_point][1];
4449 -1.0 * fe_values->finite_element_output
4450 .shape_gradients[snc][q_point][0];
4451 return_value[2] = 0;
4452 return return_value;
4459 curl_type return_value;
4461 for (
unsigned int i = 0; i < dim; ++i)
4462 return_value[i] = 0.0;
4464 if (shape_function_data[shape_function]
4465 .is_nonzero_shape_function_component[0])
4468 fe_values->finite_element_output
4469 .shape_gradients[shape_function_data[shape_function]
4470 .row_index[0]][q_point][2];
4472 fe_values->finite_element_output
4473 .shape_gradients[shape_function_data[shape_function]
4474 .row_index[0]][q_point][1];
4477 if (shape_function_data[shape_function]
4478 .is_nonzero_shape_function_component[1])
4481 fe_values->finite_element_output
4482 .shape_gradients[shape_function_data[shape_function]
4483 .row_index[1]][q_point][2];
4485 fe_values->finite_element_output
4486 .shape_gradients[shape_function_data[shape_function]
4487 .row_index[1]][q_point][0];
4490 if (shape_function_data[shape_function]
4491 .is_nonzero_shape_function_component[2])
4494 fe_values->finite_element_output
4495 .shape_gradients[shape_function_data[shape_function]
4496 .row_index[2]][q_point][1];
4498 fe_values->finite_element_output
4499 .shape_gradients[shape_function_data[shape_function]
4500 .row_index[2]][q_point][0];
4503 return return_value;
4514 template <
int dim,
int spacedim>
4517 const unsigned int q_point)
const
4523 "update_hessians")));
4527 shape_function_data[shape_function].single_nonzero_component;
4529 return hessian_type();
4532 hessian_type return_value;
4533 return_value[shape_function_data[shape_function]
4534 .single_nonzero_component_index] =
4535 fe_values->finite_element_output.shape_hessians[snc][q_point];
4536 return return_value;
4540 hessian_type return_value;
4541 for (
unsigned int d = 0;
d < dim; ++
d)
4542 if (shape_function_data[shape_function]
4543 .is_nonzero_shape_function_component[
d])
4545 fe_values->finite_element_output.shape_hessians
4546 [shape_function_data[shape_function].row_index[
d]][q_point];
4548 return return_value;
4554 template <
int dim,
int spacedim>
4557 const unsigned int q_point)
const
4563 "update_3rd_derivatives")));
4567 shape_function_data[shape_function].single_nonzero_component;
4569 return third_derivative_type();
4572 third_derivative_type return_value;
4573 return_value[shape_function_data[shape_function]
4574 .single_nonzero_component_index] =
4575 fe_values->finite_element_output.shape_3rd_derivatives[snc][q_point];
4576 return return_value;
4580 third_derivative_type return_value;
4581 for (
unsigned int d = 0;
d < dim; ++
d)
4582 if (shape_function_data[shape_function]
4583 .is_nonzero_shape_function_component[
d])
4585 fe_values->finite_element_output.shape_3rd_derivatives
4586 [shape_function_data[shape_function].row_index[
d]][q_point];
4588 return return_value;
4600 inline ::SymmetricTensor<2, 1>
4601 symmetrize_single_row(
const unsigned int n, const ::Tensor<1, 1> &t)
4611 inline ::SymmetricTensor<2, 2>
4612 symmetrize_single_row(
const unsigned int n, const ::Tensor<1, 2> &t)
4618 return {{t[0], 0, t[1] / 2}};
4622 return {{0, t[1], t[0] / 2}};
4634 inline ::SymmetricTensor<2, 3>
4635 symmetrize_single_row(
const unsigned int n, const ::Tensor<1, 3> &t)
4641 return {{t[0], 0, 0, t[1] / 2, t[2] / 2, 0}};
4645 return {{0, t[1], 0, t[0] / 2, 0, t[2] / 2}};
4649 return {{0, 0, t[2], 0, t[0] / 2, t[1] / 2}};
4662 template <
int dim,
int spacedim>
4665 const unsigned int q_point)
const
4670 "update_gradients")));
4674 shape_function_data[shape_function].single_nonzero_component;
4676 return symmetric_gradient_type();
4678 return internal::symmetrize_single_row(
4679 shape_function_data[shape_function].single_nonzero_component_index,
4680 fe_values->finite_element_output.shape_gradients[snc][q_point]);
4683 gradient_type return_value;
4684 for (
unsigned int d = 0;
d < dim; ++
d)
4685 if (shape_function_data[shape_function]
4686 .is_nonzero_shape_function_component[
d])
4688 fe_values->finite_element_output.shape_gradients
4689 [shape_function_data[shape_function].row_index[
d]][q_point];
4697 template <
int dim,
int spacedim>
4700 const unsigned int q_point)
const
4710 shape_function_data[shape_function].single_nonzero_component;
4720 const unsigned int comp =
4721 shape_function_data[shape_function].single_nonzero_component_index;
4722 return_value[value_type::unrolled_to_component_indices(comp)] =
4723 fe_values->finite_element_output.shape_values(snc, q_point);
4724 return return_value;
4729 for (
unsigned int d = 0;
d < value_type::n_independent_components; ++
d)
4730 if (shape_function_data[shape_function]
4731 .is_nonzero_shape_function_component[
d])
4732 return_value[value_type::unrolled_to_component_indices(
d)] =
4733 fe_values->finite_element_output.shape_values(
4734 shape_function_data[shape_function].row_index[
d], q_point);
4735 return return_value;
4741 template <
int dim,
int spacedim>
4744 const unsigned int shape_function,
4745 const unsigned int q_point)
const
4750 "update_gradients")));
4753 shape_function_data[shape_function].single_nonzero_component;
4758 return divergence_type();
4781 const unsigned int comp =
4782 shape_function_data[shape_function].single_nonzero_component_index;
4783 const unsigned int ii =
4784 value_type::unrolled_to_component_indices(comp)[0];
4785 const unsigned int jj =
4786 value_type::unrolled_to_component_indices(comp)[1];
4799 const ::Tensor<1, spacedim> &phi_grad =
4800 fe_values->finite_element_output.shape_gradients[snc][q_point];
4802 divergence_type return_value;
4803 return_value[ii] = phi_grad[jj];
4806 return_value[jj] = phi_grad[ii];
4808 return return_value;
4813 divergence_type return_value;
4814 return return_value;
4820 template <
int dim,
int spacedim>
4823 const unsigned int q_point)
const
4833 shape_function_data[shape_function].single_nonzero_component;
4843 const unsigned int comp =
4844 shape_function_data[shape_function].single_nonzero_component_index;
4847 return_value[indices] =
4848 fe_values->finite_element_output.shape_values(snc, q_point);
4849 return return_value;
4854 for (
unsigned int d = 0;
d < dim * dim; ++
d)
4855 if (shape_function_data[shape_function]
4856 .is_nonzero_shape_function_component[
d])
4860 return_value[indices] =
4861 fe_values->finite_element_output.shape_values(
4862 shape_function_data[shape_function].row_index[
d], q_point);
4864 return return_value;
4870 template <
int dim,
int spacedim>
4873 const unsigned int q_point)
const
4878 "update_gradients")));
4881 shape_function_data[shape_function].single_nonzero_component;
4886 return divergence_type();
4900 const unsigned int comp =
4901 shape_function_data[shape_function].single_nonzero_component_index;
4904 const unsigned int ii = indices[0];
4905 const unsigned int jj = indices[1];
4907 const ::Tensor<1, spacedim> &phi_grad =
4908 fe_values->finite_element_output.shape_gradients[snc][q_point];
4910 divergence_type return_value;
4912 return_value[ii] = phi_grad[jj];
4914 return return_value;
4919 divergence_type return_value;
4920 return return_value;
4926 template <
int dim,
int spacedim>
4929 const unsigned int q_point)
const
4934 "update_gradients")));
4937 shape_function_data[shape_function].single_nonzero_component;
4942 return gradient_type();
4956 const unsigned int comp =
4957 shape_function_data[shape_function].single_nonzero_component_index;
4960 const unsigned int ii = indices[0];
4961 const unsigned int jj = indices[1];
4963 const ::Tensor<1, spacedim> &phi_grad =
4964 fe_values->finite_element_output.shape_gradients[snc][q_point];
4966 gradient_type return_value;
4967 return_value[ii][jj] = phi_grad;
4969 return return_value;
4974 gradient_type return_value;
4975 return return_value;
4987 template <
int dim,
int spacedim>
4993 return fe_values_views_cache.scalars[scalar.
component];
4998 template <
int dim,
int spacedim>
5003 fe_values_views_cache.vectors.size());
5010 template <
int dim,
int spacedim>
5017 fe_values_views_cache.symmetric_second_order_tensors.size(),
5020 fe_values_views_cache.symmetric_second_order_tensors.size()));
5022 return fe_values_views_cache
5028 template <
int dim,
int spacedim>
5034 fe_values_views_cache.second_order_tensors.size());
5036 return fe_values_views_cache
5042 template <
int dim,
int spacedim>
5043 inline const double &
5045 const unsigned int j)
const
5050 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5051 Assert(present_cell.get() !=
nullptr,
5052 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5055 if (fe->is_primitive())
5056 return this->finite_element_output.shape_values(i, j);
5067 const unsigned int row =
5068 this->finite_element_output
5069 .shape_function_to_row_table[i * fe->n_components() +
5070 fe->system_to_component_index(i).first];
5071 return this->finite_element_output.shape_values(row, j);
5077 template <
int dim,
int spacedim>
5080 const unsigned int i,
5081 const unsigned int j,
5082 const unsigned int component)
const
5088 Assert(present_cell.get() !=
nullptr,
5089 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5094 if (fe->get_nonzero_components(i)[component] ==
false)
5100 const unsigned int row =
5101 this->finite_element_output
5102 .shape_function_to_row_table[i * fe->n_components() + component];
5103 return this->finite_element_output.shape_values(row, j);
5108 template <
int dim,
int spacedim>
5111 const unsigned int j)
const
5116 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5117 Assert(present_cell.get() !=
nullptr,
5118 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5121 if (fe->is_primitive())
5122 return this->finite_element_output.shape_gradients[i][j];
5133 const unsigned int row =
5134 this->finite_element_output
5135 .shape_function_to_row_table[i * fe->n_components() +
5136 fe->system_to_component_index(i).first];
5137 return this->finite_element_output.shape_gradients[row][j];
5143 template <
int dim,
int spacedim>
5146 const unsigned int i,
5147 const unsigned int j,
5148 const unsigned int component)
const
5154 Assert(present_cell.get() !=
nullptr,
5155 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5159 if (fe->get_nonzero_components(i)[component] ==
false)
5165 const unsigned int row =
5166 this->finite_element_output
5167 .shape_function_to_row_table[i * fe->n_components() + component];
5168 return this->finite_element_output.shape_gradients[row][j];
5173 template <
int dim,
int spacedim>
5176 const unsigned int j)
const
5181 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5182 Assert(present_cell.get() !=
nullptr,
5183 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5186 if (fe->is_primitive())
5187 return this->finite_element_output.shape_hessians[i][j];
5198 const unsigned int row =
5199 this->finite_element_output
5200 .shape_function_to_row_table[i * fe->n_components() +
5201 fe->system_to_component_index(i).first];
5202 return this->finite_element_output.shape_hessians[row][j];
5208 template <
int dim,
int spacedim>
5211 const unsigned int i,
5212 const unsigned int j,
5213 const unsigned int component)
const
5219 Assert(present_cell.get() !=
nullptr,
5220 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5224 if (fe->get_nonzero_components(i)[component] ==
false)
5230 const unsigned int row =
5231 this->finite_element_output
5232 .shape_function_to_row_table[i * fe->n_components() + component];
5233 return this->finite_element_output.shape_hessians[row][j];
5238 template <
int dim,
int spacedim>
5241 const unsigned int j)
const
5246 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5247 Assert(present_cell.get() !=
nullptr,
5248 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5251 if (fe->is_primitive())
5252 return this->finite_element_output.shape_3rd_derivatives[i][j];
5263 const unsigned int row =
5264 this->finite_element_output
5265 .shape_function_to_row_table[i * fe->n_components() +
5266 fe->system_to_component_index(i).first];
5267 return this->finite_element_output.shape_3rd_derivatives[row][j];
5273 template <
int dim,
int spacedim>
5276 const unsigned int i,
5277 const unsigned int j,
5278 const unsigned int component)
const
5284 Assert(present_cell.get() !=
nullptr,
5285 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5289 if (fe->get_nonzero_components(i)[component] ==
false)
5295 const unsigned int row =
5296 this->finite_element_output
5297 .shape_function_to_row_table[i * fe->n_components() + component];
5298 return this->finite_element_output.shape_3rd_derivatives[row][j];
5303 template <
int dim,
int spacedim>
5312 template <
int dim,
int spacedim>
5321 template <
int dim,
int spacedim>
5325 return this->update_flags;
5330 template <
int dim,
int spacedim>
5331 inline const std::vector<Point<spacedim>> &
5336 Assert(present_cell.get() !=
nullptr,
5337 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5338 return this->mapping_output.quadrature_points;
5343 template <
int dim,
int spacedim>
5344 inline const std::vector<double> &
5349 Assert(present_cell.get() !=
nullptr,
5350 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5351 return this->mapping_output.JxW_values;
5356 template <
int dim,
int spacedim>
5357 inline const std::vector<DerivativeForm<1, dim, spacedim>> &
5362 Assert(present_cell.get() !=
nullptr,
5363 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5364 return this->mapping_output.jacobians;
5369 template <
int dim,
int spacedim>
5370 inline const std::vector<DerivativeForm<2, dim, spacedim>> &
5375 Assert(present_cell.get() !=
nullptr,
5376 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5377 return this->mapping_output.jacobian_grads;
5382 template <
int dim,
int spacedim>
5385 const unsigned int i)
const
5389 Assert(present_cell.get() !=
nullptr,
5390 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5391 return this->mapping_output.jacobian_pushed_forward_grads[i];
5396 template <
int dim,
int spacedim>
5397 inline const std::vector<Tensor<3, spacedim>> &
5402 Assert(present_cell.get() !=
nullptr,
5403 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5404 return this->mapping_output.jacobian_pushed_forward_grads;
5409 template <
int dim,
int spacedim>
5415 Assert(present_cell.get() !=
nullptr,
5416 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5417 return this->mapping_output.jacobian_2nd_derivatives[i];
5422 template <
int dim,
int spacedim>
5423 inline const std::vector<DerivativeForm<3, dim, spacedim>> &
5428 Assert(present_cell.get() !=
nullptr,
5429 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5430 return this->mapping_output.jacobian_2nd_derivatives;
5435 template <
int dim,
int spacedim>
5438 const unsigned int i)
const
5442 "update_jacobian_pushed_forward_2nd_derivatives"));
5443 Assert(present_cell.get() !=
nullptr,
5444 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5445 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[i];
5450 template <
int dim,
int spacedim>
5451 inline const std::vector<Tensor<4, spacedim>> &
5456 "update_jacobian_pushed_forward_2nd_derivatives"));
5457 Assert(present_cell.get() !=
nullptr,
5458 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5459 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
5464 template <
int dim,
int spacedim>
5470 Assert(present_cell.get() !=
nullptr,
5471 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5472 return this->mapping_output.jacobian_3rd_derivatives[i];
5477 template <
int dim,
int spacedim>
5478 inline const std::vector<DerivativeForm<4, dim, spacedim>> &
5483 Assert(present_cell.get() !=
nullptr,
5484 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5485 return this->mapping_output.jacobian_3rd_derivatives;
5490 template <
int dim,
int spacedim>
5493 const unsigned int i)
const
5497 "update_jacobian_pushed_forward_3rd_derivatives"));
5498 Assert(present_cell.get() !=
nullptr,
5499 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5500 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[i];
5505 template <
int dim,
int spacedim>
5506 inline const std::vector<Tensor<5, spacedim>> &
5511 "update_jacobian_pushed_forward_3rd_derivatives"));
5512 Assert(present_cell.get() !=
nullptr,
5513 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5514 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
5519 template <
int dim,
int spacedim>
5520 inline const std::vector<DerivativeForm<1, spacedim, dim>> &
5525 Assert(present_cell.get() !=
nullptr,
5526 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5527 return this->mapping_output.inverse_jacobians;
5532 template <
int dim,
int spacedim>
5536 return {0
U, dofs_per_cell};
5541 template <
int dim,
int spacedim>
5544 const unsigned int start_dof_index)
const
5546 Assert(start_dof_index <= dofs_per_cell,
5548 return {start_dof_index, dofs_per_cell};
5553 template <
int dim,
int spacedim>
5556 const unsigned int end_dof_index)
const
5558 Assert(end_dof_index < dofs_per_cell,
5560 return {0
U, end_dof_index + 1};
5565 template <
int dim,
int spacedim>
5569 return {0
U, n_quadrature_points};
5574 template <
int dim,
int spacedim>
5581 Assert(present_cell.get() !=
nullptr,
5582 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5584 return this->mapping_output.quadrature_points[i];
5589 template <
int dim,
int spacedim>
5596 Assert(present_cell.get() !=
nullptr,
5597 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5599 return this->mapping_output.JxW_values[i];
5604 template <
int dim,
int spacedim>
5611 Assert(present_cell.get() !=
nullptr,
5612 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5614 return this->mapping_output.jacobians[i];
5619 template <
int dim,
int spacedim>
5626 Assert(present_cell.get() !=
nullptr,
5627 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5629 return this->mapping_output.jacobian_grads[i];
5634 template <
int dim,
int spacedim>
5641 Assert(present_cell.get() !=
nullptr,
5642 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5644 return this->mapping_output.inverse_jacobians[i];
5649 template <
int dim,
int spacedim>
5655 "update_normal_vectors")));
5657 Assert(present_cell.get() !=
nullptr,
5658 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
5660 return this->mapping_output.normal_vectors[i];
5668 template <
int dim,
int spacedim>
5677 template <
int dim,
int spacedim>
5688 template <
int dim,
int spacedim>
5692 return present_face_index;
5698 template <
int dim,
int spacedim>
5707 template <
int dim,
int spacedim>
5716 template <
int dim,
int spacedim>
5725 template <
int dim,
int spacedim>
5732 "update_boundary_forms")));
5734 return this->mapping_output.boundary_forms[i];