Reference documentation for deal.II version GIT 6a72d26406 2023-06-07 13:05:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
fe_values.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2022 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_fe_values_h
17 #define dealii_fe_values_h
18 
19 
20 #include <deal.II/base/config.h>
21 
24 #include <deal.II/base/point.h>
29 
32 
33 #include <deal.II/fe/fe.h>
36 #include <deal.II/fe/mapping.h>
38 
39 #include <deal.II/grid/tria.h>
41 
43 
44 #include <algorithm>
45 #include <memory>
46 #include <type_traits>
47 
48 
49 // dummy include in order to have the
50 // definition of PetscScalar available
51 // without including other PETSc stuff
52 #ifdef DEAL_II_WITH_PETSC
53 # include <petsc.h>
54 #endif
55 
57 
58 // Forward declaration
59 #ifndef DOXYGEN
60 template <int dim, int spacedim = dim>
61 class FEValuesBase;
62 #endif
63 
64 namespace internal
65 {
70  template <int dim, class NumberType = double>
71  struct CurlType;
72 
79  template <class NumberType>
80  struct CurlType<1, NumberType>
81  {
83  };
84 
91  template <class NumberType>
92  struct CurlType<2, NumberType>
93  {
95  };
96 
103  template <class NumberType>
104  struct CurlType<3, NumberType>
105  {
107  };
108 } // namespace internal
109 
110 
111 
133 namespace FEValuesViews
134 {
146  template <int dim, int spacedim = dim>
147  class Scalar
148  {
149  public:
156 
163 
170 
177 
184  template <typename Number>
186 
193  template <typename Number>
196 
203  template <typename Number>
206 
213  template <typename Number>
216 
223  template <typename Number>
226 
233  template <typename Number>
235  {
240  using value_type =
241  typename ProductType<Number,
242  typename Scalar<dim, spacedim>::value_type>::type;
243 
248  using gradient_type = typename ProductType<
249  Number,
250  typename Scalar<dim, spacedim>::gradient_type>::type;
251 
257  typename ProductType<Number,
258  typename Scalar<dim, spacedim>::value_type>::type;
259 
264  using hessian_type = typename ProductType<
265  Number,
266  typename Scalar<dim, spacedim>::hessian_type>::type;
267 
273  Number,
275  };
276 
282  {
292 
301  unsigned int row_index;
302  };
303 
307  Scalar();
308 
314  Scalar(const FEValuesBase<dim, spacedim> &fe_values_base,
315  const unsigned int component);
316 
321  Scalar(const Scalar<dim, spacedim> &) = delete;
322 
326  // NOLINTNEXTLINE OSX does not compile with noexcept
328 
332  ~Scalar() = default;
333 
338  Scalar &
339  operator=(const Scalar<dim, spacedim> &) = delete;
340 
344  Scalar &
345  operator=(Scalar<dim, spacedim> &&) noexcept = default;
346 
360  value_type
361  value(const unsigned int shape_function, const unsigned int q_point) const;
362 
374  gradient(const unsigned int shape_function,
375  const unsigned int q_point) const;
376 
388  hessian(const unsigned int shape_function,
389  const unsigned int q_point) const;
390 
402  third_derivative(const unsigned int shape_function,
403  const unsigned int q_point) const;
404 
422  template <class InputVector>
423  void
425  const InputVector &fe_function,
426  std::vector<solution_value_type<typename InputVector::value_type>>
427  &values) const;
428 
463  template <class InputVector>
464  void
466  const InputVector &dof_values,
467  std::vector<solution_value_type<typename InputVector::value_type>>
468  &values) const;
469 
487  template <class InputVector>
488  void
490  const InputVector &fe_function,
491  std::vector<solution_gradient_type<typename InputVector::value_type>>
492  &gradients) const;
493 
500  template <class InputVector>
501  void
503  const InputVector &dof_values,
504  std::vector<solution_gradient_type<typename InputVector::value_type>>
505  &gradients) const;
506 
524  template <class InputVector>
525  void
527  const InputVector &fe_function,
528  std::vector<solution_hessian_type<typename InputVector::value_type>>
529  &hessians) const;
530 
537  template <class InputVector>
538  void
540  const InputVector &dof_values,
541  std::vector<solution_hessian_type<typename InputVector::value_type>>
542  &hessians) const;
543 
544 
563  template <class InputVector>
564  void
566  const InputVector &fe_function,
567  std::vector<solution_laplacian_type<typename InputVector::value_type>>
568  &laplacians) const;
569 
576  template <class InputVector>
577  void
579  const InputVector &dof_values,
580  std::vector<solution_laplacian_type<typename InputVector::value_type>>
581  &laplacians) const;
582 
583 
602  template <class InputVector>
603  void
605  const InputVector &fe_function,
606  std::vector<
607  solution_third_derivative_type<typename InputVector::value_type>>
608  &third_derivatives) const;
609 
616  template <class InputVector>
617  void
619  const InputVector &dof_values,
620  std::vector<
621  solution_third_derivative_type<typename InputVector::value_type>>
622  &third_derivatives) const;
623 
624 
625  private:
629  const SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
630 
635  const unsigned int component;
636 
641  };
642 
643 
644 
674  template <int dim, int spacedim = dim>
675  class Vector
676  {
677  public:
684 
694 
706 
713 
720  using curl_type = typename ::internal::CurlType<spacedim>::type;
721 
728 
735 
742  template <typename Number>
744 
751  template <typename Number>
754 
761  template <typename Number>
764 
771  template <typename Number>
774 
781  template <typename Number>
784 
791  template <typename Number>
793 
800  template <typename Number>
803 
810  template <typename Number>
813 
820  template <typename Number>
822  {
827  using value_type =
828  typename ProductType<Number,
829  typename Vector<dim, spacedim>::value_type>::type;
830 
835  using gradient_type = typename ProductType<
836  Number,
837  typename Vector<dim, spacedim>::gradient_type>::type;
838 
844  Number,
846 
851  using divergence_type = typename ProductType<
852  Number,
854 
860  typename ProductType<Number,
861  typename Vector<dim, spacedim>::value_type>::type;
862 
867  using curl_type =
868  typename ProductType<Number,
869  typename Vector<dim, spacedim>::curl_type>::type;
870 
875  using hessian_type = typename ProductType<
876  Number,
877  typename Vector<dim, spacedim>::hessian_type>::type;
878 
884  Number,
886  };
887 
893  {
903 
913  unsigned int row_index[spacedim];
914 
925  };
926 
930  Vector();
931 
940  Vector(const FEValuesBase<dim, spacedim> &fe_values_base,
941  const unsigned int first_vector_component);
942 
947  Vector(const Vector<dim, spacedim> &) = delete;
948 
952  // NOLINTNEXTLINE OSX does not compile with noexcept
954 
958  ~Vector() = default;
959 
964  Vector &
965  operator=(const Vector<dim, spacedim> &) = delete;
966 
970  // NOLINTNEXTLINE OSX does not compile with noexcept
971  Vector &
972  operator=(Vector<dim, spacedim> &&) = default; // NOLINT
973 
990  value_type
991  value(const unsigned int shape_function, const unsigned int q_point) const;
992 
1007  gradient(const unsigned int shape_function,
1008  const unsigned int q_point) const;
1009 
1026  symmetric_gradient(const unsigned int shape_function,
1027  const unsigned int q_point) const;
1028 
1040  divergence(const unsigned int shape_function,
1041  const unsigned int q_point) const;
1042 
1063  curl_type
1064  curl(const unsigned int shape_function, const unsigned int q_point) const;
1065 
1076  hessian_type
1077  hessian(const unsigned int shape_function,
1078  const unsigned int q_point) const;
1079 
1091  third_derivative(const unsigned int shape_function,
1092  const unsigned int q_point) const;
1093 
1111  template <class InputVector>
1112  void
1114  const InputVector &fe_function,
1116  &values) const;
1117 
1152  template <class InputVector>
1153  void
1155  const InputVector &dof_values,
1157  &values) const;
1158 
1176  template <class InputVector>
1177  void
1179  const InputVector &fe_function,
1181  &gradients) const;
1182 
1189  template <class InputVector>
1190  void
1192  const InputVector &dof_values,
1194  &gradients) const;
1195 
1219  template <class InputVector>
1220  void
1221  get_function_symmetric_gradients(
1222  const InputVector &fe_function,
1223  std::vector<
1225  &symmetric_gradients) const;
1226 
1233  template <class InputVector>
1234  void
1235  get_function_symmetric_gradients_from_local_dof_values(
1236  const InputVector &dof_values,
1237  std::vector<
1239  &symmetric_gradients) const;
1240 
1259  template <class InputVector>
1260  void
1261  get_function_divergences(
1262  const InputVector &fe_function,
1264  &divergences) const;
1265 
1272  template <class InputVector>
1273  void
1274  get_function_divergences_from_local_dof_values(
1275  const InputVector &dof_values,
1277  &divergences) const;
1278 
1297  template <class InputVector>
1298  void
1299  get_function_curls(
1300  const InputVector &fe_function,
1302  const;
1303 
1310  template <class InputVector>
1311  void
1312  get_function_curls_from_local_dof_values(
1313  const InputVector &dof_values,
1315  const;
1316 
1334  template <class InputVector>
1335  void
1337  const InputVector &fe_function,
1339  &hessians) const;
1340 
1347  template <class InputVector>
1348  void
1350  const InputVector &dof_values,
1352  &hessians) const;
1353 
1372  template <class InputVector>
1373  void
1375  const InputVector &fe_function,
1377  &laplacians) const;
1378 
1385  template <class InputVector>
1386  void
1388  const InputVector &dof_values,
1390  &laplacians) const;
1391 
1410  template <class InputVector>
1411  void
1413  const InputVector &fe_function,
1414  std::vector<
1416  &third_derivatives) const;
1417 
1424  template <class InputVector>
1425  void
1427  const InputVector &dof_values,
1428  std::vector<
1430  &third_derivatives) const;
1431 
1432  private:
1437 
1442  const unsigned int first_vector_component;
1443 
1447  std::vector<ShapeFunctionData> shape_function_data;
1448  };
1449 
1450 
1451  template <int rank, int dim, int spacedim = dim>
1453 
1476  template <int dim, int spacedim>
1477  class SymmetricTensor<2, dim, spacedim>
1478  {
1479  public:
1487 
1498 
1505  template <typename Number>
1507 
1514  template <typename Number>
1517 
1518 
1525  template <typename Number>
1526  struct DEAL_II_DEPRECATED OutputType
1527  {
1532  using value_type = typename ProductType<
1533  Number,
1535 
1540  using divergence_type = typename ProductType<
1541  Number,
1543  };
1544 
1549  struct ShapeFunctionData
1550  {
1559  bool is_nonzero_shape_function_component
1560  [value_type::n_independent_components];
1561 
1571  unsigned int row_index[value_type::n_independent_components];
1572 
1582 
1587  };
1588 
1592  SymmetricTensor();
1593 
1603  SymmetricTensor(const FEValuesBase<dim, spacedim> &fe_values_base,
1604  const unsigned int first_tensor_component);
1605 
1611 
1615  // NOLINTNEXTLINE OSX does not compile with noexcept
1617 
1622  SymmetricTensor &
1624 
1628  SymmetricTensor &
1630 
1648  value_type
1649  value(const unsigned int shape_function, const unsigned int q_point) const;
1650 
1665  divergence(const unsigned int shape_function,
1666  const unsigned int q_point) const;
1667 
1685  template <class InputVector>
1686  void
1688  const InputVector &fe_function,
1689  std::vector<solution_value_type<typename InputVector::value_type>>
1690  &values) const;
1691 
1726  template <class InputVector>
1727  void
1729  const InputVector &dof_values,
1730  std::vector<solution_value_type<typename InputVector::value_type>>
1731  &values) const;
1732 
1754  template <class InputVector>
1755  void
1756  get_function_divergences(
1757  const InputVector &fe_function,
1758  std::vector<solution_divergence_type<typename InputVector::value_type>>
1759  &divergences) const;
1760 
1767  template <class InputVector>
1768  void
1769  get_function_divergences_from_local_dof_values(
1770  const InputVector &dof_values,
1771  std::vector<solution_divergence_type<typename InputVector::value_type>>
1772  &divergences) const;
1773 
1774  private:
1778  const SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
1779 
1784  const unsigned int first_tensor_component;
1785 
1789  std::vector<ShapeFunctionData> shape_function_data;
1790  };
1791 
1792 
1793  template <int rank, int dim, int spacedim = dim>
1794  class Tensor;
1795 
1814  template <int dim, int spacedim>
1815  class Tensor<2, dim, spacedim>
1816  {
1817  public:
1823 
1828 
1834 
1841  template <typename Number>
1843 
1850  template <typename Number>
1853 
1860  template <typename Number>
1863 
1864 
1871  template <typename Number>
1872  struct DEAL_II_DEPRECATED OutputType
1873  {
1878  using value_type = typename ProductType<
1879  Number,
1880  typename Tensor<2, dim, spacedim>::value_type>::type;
1881 
1886  using divergence_type = typename ProductType<
1887  Number,
1889 
1894  using gradient_type = typename ProductType<
1895  Number,
1897  };
1898 
1903  struct ShapeFunctionData
1904  {
1913  bool is_nonzero_shape_function_component
1914  [value_type::n_independent_components];
1915 
1925  unsigned int row_index[value_type::n_independent_components];
1926 
1936 
1941  };
1942 
1946  Tensor();
1947 
1953 
1957  // NOLINTNEXTLINE OSX does not compile with noexcept
1959 
1963  ~Tensor() = default;
1964 
1974  Tensor(const FEValuesBase<dim, spacedim> &fe_values_base,
1975  const unsigned int first_tensor_component);
1976 
1977 
1982  Tensor &
1984 
1988  Tensor &
1989  operator=(Tensor<2, dim, spacedim> &&) = default; // NOLINT
1990 
2007  value_type
2008  value(const unsigned int shape_function, const unsigned int q_point) const;
2009 
2024  divergence(const unsigned int shape_function,
2025  const unsigned int q_point) const;
2026 
2041  gradient(const unsigned int shape_function,
2042  const unsigned int q_point) const;
2043 
2061  template <class InputVector>
2062  void
2064  const InputVector &fe_function,
2066  &values) const;
2067 
2102  template <class InputVector>
2103  void
2105  const InputVector &dof_values,
2107  &values) const;
2108 
2130  template <class InputVector>
2131  void
2132  get_function_divergences(
2133  const InputVector &fe_function,
2135  &divergences) const;
2136 
2143  template <class InputVector>
2144  void
2145  get_function_divergences_from_local_dof_values(
2146  const InputVector &dof_values,
2148  &divergences) const;
2149 
2166  template <class InputVector>
2167  void
2169  const InputVector &fe_function,
2171  &gradients) const;
2172 
2179  template <class InputVector>
2180  void
2182  const InputVector &dof_values,
2184  &gradients) const;
2185 
2186  private:
2191 
2196  const unsigned int first_tensor_component;
2197 
2201  std::vector<ShapeFunctionData> shape_function_data;
2202  };
2203 
2204 } // namespace FEValuesViews
2205 
2206 
2207 namespace internal
2208 {
2209  namespace FEValuesViews
2210  {
2215  template <int dim, int spacedim, typename Extractor>
2216  struct ViewType
2217  {};
2218 
2226  template <int dim, int spacedim>
2227  struct ViewType<dim, spacedim, FEValuesExtractors::Scalar>
2228  {
2229  using type = typename ::FEValuesViews::Scalar<dim, spacedim>;
2230  };
2231 
2239  template <int dim, int spacedim>
2240  struct ViewType<dim, spacedim, FEValuesExtractors::Vector>
2241  {
2242  using type = typename ::FEValuesViews::Vector<dim, spacedim>;
2243  };
2244 
2252  template <int dim, int spacedim, int rank>
2253  struct ViewType<dim, spacedim, FEValuesExtractors::Tensor<rank>>
2254  {
2255  using type = typename ::FEValuesViews::Tensor<rank, dim, spacedim>;
2256  };
2257 
2265  template <int dim, int spacedim, int rank>
2266  struct ViewType<dim, spacedim, FEValuesExtractors::SymmetricTensor<rank>>
2267  {
2268  using type =
2269  typename ::FEValuesViews::SymmetricTensor<rank, dim, spacedim>;
2270  };
2271 
2279  template <int dim, int spacedim>
2280  struct Cache
2281  {
2286  std::vector<::FEValuesViews::Scalar<dim, spacedim>> scalars;
2287  std::vector<::FEValuesViews::Vector<dim, spacedim>> vectors;
2288  std::vector<::FEValuesViews::SymmetricTensor<2, dim, spacedim>>
2290  std::vector<::FEValuesViews::Tensor<2, dim, spacedim>>
2292 
2297  };
2298  } // namespace FEValuesViews
2299 } // namespace internal
2300 
2301 namespace FEValuesViews
2302 {
2307  template <int dim, int spacedim, typename Extractor>
2308  using View = typename ::internal::FEValuesViews::
2309  ViewType<dim, spacedim, Extractor>::type;
2310 } // namespace FEValuesViews
2311 
2312 
2412 template <int dim, int spacedim>
2414 {
2415 public:
2419  static constexpr unsigned int dimension = dim;
2420 
2424  static constexpr unsigned int space_dimension = spacedim;
2425 
2433  const unsigned int n_quadrature_points;
2434 
2444  const unsigned int max_n_quadrature_points;
2445 
2451  const unsigned int dofs_per_cell;
2452 
2453 
2461  FEValuesBase(const unsigned int n_q_points,
2462  const unsigned int dofs_per_cell,
2463  const UpdateFlags update_flags,
2464  const Mapping<dim, spacedim> & mapping,
2465  const FiniteElement<dim, spacedim> &fe);
2466 
2471  FEValuesBase &
2472  operator=(const FEValuesBase &) = delete;
2473 
2478  FEValuesBase(const FEValuesBase &) = delete;
2479 
2483  virtual ~FEValuesBase() override;
2484 
2485 
2489 
2511  const double &
2512  shape_value(const unsigned int i, const unsigned int q_point) const;
2513 
2534  double
2535  shape_value_component(const unsigned int i,
2536  const unsigned int q_point,
2537  const unsigned int component) const;
2538 
2564  const Tensor<1, spacedim> &
2565  shape_grad(const unsigned int i, const unsigned int q_point) const;
2566 
2584  shape_grad_component(const unsigned int i,
2585  const unsigned int q_point,
2586  const unsigned int component) const;
2587 
2607  const Tensor<2, spacedim> &
2608  shape_hessian(const unsigned int i, const unsigned int q_point) const;
2609 
2627  shape_hessian_component(const unsigned int i,
2628  const unsigned int q_point,
2629  const unsigned int component) const;
2630 
2650  const Tensor<3, spacedim> &
2651  shape_3rd_derivative(const unsigned int i, const unsigned int q_point) const;
2652 
2670  shape_3rd_derivative_component(const unsigned int i,
2671  const unsigned int q_point,
2672  const unsigned int component) const;
2673 
2676 
2714  template <class InputVector>
2715  void
2717  const InputVector & fe_function,
2718  std::vector<typename InputVector::value_type> &values) const;
2719 
2733  template <class InputVector>
2734  void
2736  const InputVector & fe_function,
2737  std::vector<Vector<typename InputVector::value_type>> &values) const;
2738 
2795  template <class InputVector>
2796  void
2798  const InputVector & fe_function,
2800  std::vector<typename InputVector::value_type> & values) const;
2801 
2810  template <class InputVector>
2811  void
2813  const InputVector & fe_function,
2815  std::vector<Vector<typename InputVector::value_type>> &values) const;
2816 
2817 
2839  template <class InputVector>
2840  void
2842  const InputVector & fe_function,
2844  ArrayView<std::vector<typename InputVector::value_type>> values,
2845  const bool quadrature_points_fastest) const;
2846 
2849 
2887  template <class InputVector>
2888  void
2890  const InputVector &fe_function,
2892  &gradients) const;
2893 
2910  template <class InputVector>
2911  void
2913  const InputVector &fe_function,
2914  std::vector<
2916  &gradients) const;
2917 
2926  template <class InputVector>
2927  void
2929  const InputVector & fe_function,
2932  &gradients) const;
2933 
2942  template <class InputVector>
2943  void
2945  const InputVector & fe_function,
2947  ArrayView<
2949  gradients,
2950  const bool quadrature_points_fastest = false) const;
2951 
2956 
2995  template <class InputVector>
2996  void
2998  const InputVector &fe_function,
3000  &hessians) const;
3001 
3019  template <class InputVector>
3020  void
3022  const InputVector &fe_function,
3023  std::vector<
3025  & hessians,
3026  const bool quadrature_points_fastest = false) const;
3027 
3036  template <class InputVector>
3037  void
3039  const InputVector & fe_function,
3042  &hessians) const;
3043 
3052  template <class InputVector>
3053  void
3055  const InputVector & fe_function,
3057  ArrayView<
3059  hessians,
3060  const bool quadrature_points_fastest = false) const;
3061 
3102  template <class InputVector>
3103  void
3105  const InputVector & fe_function,
3106  std::vector<typename InputVector::value_type> &laplacians) const;
3107 
3127  template <class InputVector>
3128  void
3130  const InputVector & fe_function,
3131  std::vector<Vector<typename InputVector::value_type>> &laplacians) const;
3132 
3141  template <class InputVector>
3142  void
3144  const InputVector & fe_function,
3146  std::vector<typename InputVector::value_type> & laplacians) const;
3147 
3156  template <class InputVector>
3157  void
3159  const InputVector & fe_function,
3161  std::vector<Vector<typename InputVector::value_type>> &laplacians) const;
3162 
3171  template <class InputVector>
3172  void
3174  const InputVector & fe_function,
3176  std::vector<std::vector<typename InputVector::value_type>> &laplacians,
3177  const bool quadrature_points_fastest = false) const;
3178 
3181 
3221  template <class InputVector>
3222  void
3224  const InputVector &fe_function,
3226  &third_derivatives) const;
3227 
3246  template <class InputVector>
3247  void
3249  const InputVector &fe_function,
3250  std::vector<
3252  & third_derivatives,
3253  const bool quadrature_points_fastest = false) const;
3254 
3263  template <class InputVector>
3264  void
3266  const InputVector & fe_function,
3269  &third_derivatives) const;
3270 
3279  template <class InputVector>
3280  void
3282  const InputVector & fe_function,
3284  ArrayView<
3286  third_derivatives,
3287  const bool quadrature_points_fastest = false) const;
3291 
3317  dof_indices() const;
3318 
3352  dof_indices_starting_at(const unsigned int start_dof_index) const;
3353 
3385  dof_indices_ending_at(const unsigned int end_dof_index) const;
3386 
3390 
3414 
3421  const Point<spacedim> &
3422  quadrature_point(const unsigned int q_point) const;
3423 
3429  const std::vector<Point<spacedim>> &
3431 
3448  double
3449  JxW(const unsigned int q_point) const;
3450 
3454  const std::vector<double> &
3456 
3464  jacobian(const unsigned int q_point) const;
3465 
3472  const std::vector<DerivativeForm<1, dim, spacedim>> &
3473  get_jacobians() const;
3474 
3483  jacobian_grad(const unsigned int q_point) const;
3484 
3491  const std::vector<DerivativeForm<2, dim, spacedim>> &
3493 
3502  const Tensor<3, spacedim> &
3503  jacobian_pushed_forward_grad(const unsigned int q_point) const;
3504 
3511  const std::vector<Tensor<3, spacedim>> &
3513 
3522  jacobian_2nd_derivative(const unsigned int q_point) const;
3523 
3530  const std::vector<DerivativeForm<3, dim, spacedim>> &
3532 
3542  const Tensor<4, spacedim> &
3543  jacobian_pushed_forward_2nd_derivative(const unsigned int q_point) const;
3544 
3551  const std::vector<Tensor<4, spacedim>> &
3553 
3563  jacobian_3rd_derivative(const unsigned int q_point) const;
3564 
3571  const std::vector<DerivativeForm<4, dim, spacedim>> &
3573 
3583  const Tensor<5, spacedim> &
3584  jacobian_pushed_forward_3rd_derivative(const unsigned int q_point) const;
3585 
3592  const std::vector<Tensor<5, spacedim>> &
3594 
3602  inverse_jacobian(const unsigned int q_point) const;
3603 
3610  const std::vector<DerivativeForm<1, spacedim, dim>> &
3612 
3632  const Tensor<1, spacedim> &
3633  normal_vector(const unsigned int q_point) const;
3634 
3642  const std::vector<Tensor<1, spacedim>> &
3643  get_normal_vectors() const;
3644 
3648 
3660 
3671 
3683 
3684 
3695 
3699 
3704  const Mapping<dim, spacedim> &
3705  get_mapping() const;
3706 
3711  get_fe() const;
3712 
3716  UpdateFlags
3718 
3723  get_cell() const;
3724 
3731  get_cell_similarity() const;
3732 
3737  std::size_t
3738  memory_consumption() const;
3750  std::string,
3751  << "You are requesting information from an FEValues/FEFaceValues/FESubfaceValues "
3752  << "object for which this kind of information has not been computed. What "
3753  << "information these objects compute is determined by the update_* flags you "
3754  << "pass to the constructor. Here, the operation you are attempting requires "
3755  << "the <" << arg1
3756  << "> flag to be set, but it was apparently not specified "
3757  << "upon construction.");
3758 
3764  DeclExceptionMsg(ExcNotReinited,
3765  "FEValues object is not reinit'ed to any cell");
3766 
3774  ExcFEDontMatch,
3775  "The FiniteElement you provided to FEValues and the FiniteElement that belongs "
3776  "to the DoFHandler that provided the cell iterator do not match.");
3782  DeclException1(ExcShapeFunctionNotPrimitive,
3783  int,
3784  << "The shape function with index " << arg1
3785  << " is not primitive, i.e. it is vector-valued and "
3786  << "has more than one non-zero vector component. This "
3787  << "function cannot be called for these shape functions. "
3788  << "Maybe you want to use the same function with the "
3789  << "_component suffix?");
3790 
3799  "The given FiniteElement is not a primitive element but the requested operation "
3800  "only works for those. See FiniteElement::is_primitive() for more information.");
3801 
3802 protected:
3810  {
3811  public:
3813  ExcNeedsDoFHandler,
3814  "You have previously called the FEValues::reinit() function with a "
3815  "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However, "
3816  "when you do this, you cannot call some functions in the FEValues "
3817  "class, such as the get_function_values/gradients/hessians/third_derivatives "
3818  "functions. If you need these functions, then you need to call "
3819  "FEValues::reinit() with an iterator type that allows to extract "
3820  "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
3821 
3826 
3830  template <bool lda>
3833 
3838  const typename Triangulation<dim, spacedim>::cell_iterator &cell);
3839 
3843  bool
3844  is_initialized() const;
3845 
3852  operator typename Triangulation<dim, spacedim>::cell_iterator() const;
3853 
3859  n_dofs_for_dof_handler() const;
3860 
3865  template <typename VectorType>
3866  void
3867  get_interpolated_dof_values(
3868  const VectorType & in,
3870 
3875  void
3876  get_interpolated_dof_values(const IndexSet & in,
3877  Vector<IndexSet::value_type> &out) const;
3878 
3879  private:
3884  };
3885 
3892 
3900  boost::signals2::connection tria_listener_refinement;
3901 
3909  boost::signals2::connection tria_listener_mesh_transform;
3910 
3916  void
3917  invalidate_present_cell();
3918 
3928  void
3929  maybe_invalidate_previous_present_cell(
3930  const typename Triangulation<dim, spacedim>::cell_iterator &cell);
3931 
3937 
3943  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
3945 
3952 
3960 
3966  std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
3968 
3974  spacedim>
3976 
3977 
3982 
3991  UpdateFlags
3992  compute_update_flags(const UpdateFlags update_flags) const;
3993 
4000 
4006  void
4007  check_cell_similarity(
4008  const typename Triangulation<dim, spacedim>::cell_iterator &cell);
4009 
4010 private:
4015 
4016  // Make the view classes friends of this class, since they access internal
4017  // data.
4018  template <int, int>
4020  template <int, int>
4022  template <int, int, int>
4024  template <int, int, int>
4026 };
4027 
4028 
4029 
4039 template <int dim, int spacedim = dim>
4040 class FEValues : public FEValuesBase<dim, spacedim>
4041 {
4042 public:
4047  static constexpr unsigned int integral_dimension = dim;
4048 
4053  FEValues(const Mapping<dim, spacedim> & mapping,
4054  const FiniteElement<dim, spacedim> &fe,
4055  const Quadrature<dim> & quadrature,
4056  const UpdateFlags update_flags);
4057 
4064  FEValues(const Mapping<dim, spacedim> & mapping,
4065  const FiniteElement<dim, spacedim> &fe,
4066  const hp::QCollection<dim> & quadrature,
4067  const UpdateFlags update_flags);
4068 
4075  const Quadrature<dim> & quadrature,
4076  const UpdateFlags update_flags);
4077 
4085  const hp::QCollection<dim> & quadrature,
4086  const UpdateFlags update_flags);
4087 
4094  template <bool level_dof_access>
4095  void
4098 
4112  void
4114 
4119  const Quadrature<dim> &
4121 
4126  std::size_t
4127  memory_consumption() const;
4128 
4143  const FEValues<dim, spacedim> &
4145 
4146 private:
4151 
4155  void
4156  initialize(const UpdateFlags update_flags);
4157 
4164  void
4165  do_reinit();
4166 };
4167 
4168 
4178 template <int dim, int spacedim = dim>
4179 class FEFaceValuesBase : public FEValuesBase<dim, spacedim>
4180 {
4181 public:
4186  static constexpr unsigned int integral_dimension = dim - 1;
4187 
4199  FEFaceValuesBase(const unsigned int dofs_per_cell,
4200  const UpdateFlags update_flags,
4201  const Mapping<dim, spacedim> & mapping,
4202  const FiniteElement<dim, spacedim> &fe,
4203  const Quadrature<dim - 1> & quadrature);
4204 
4211  FEFaceValuesBase(const unsigned int dofs_per_cell,
4212  const UpdateFlags update_flags,
4213  const Mapping<dim, spacedim> & mapping,
4214  const FiniteElement<dim, spacedim> &fe,
4215  const hp::QCollection<dim - 1> & quadrature);
4216 
4224  const Tensor<1, spacedim> &
4225  boundary_form(const unsigned int q_point) const;
4226 
4233  const std::vector<Tensor<1, spacedim>> &
4234  get_boundary_forms() const;
4235 
4240  unsigned int
4242 
4247  unsigned int
4249 
4254  const Quadrature<dim - 1> &
4256 
4261  std::size_t
4262  memory_consumption() const;
4263 
4264 protected:
4269  unsigned int present_face_no;
4270 
4275  unsigned int present_face_index;
4276 
4280  const hp::QCollection<dim - 1> quadrature;
4281 };
4282 
4283 
4284 
4298 template <int dim, int spacedim = dim>
4299 class FEFaceValues : public FEFaceValuesBase<dim, spacedim>
4300 {
4301 public:
4306  static constexpr unsigned int dimension = dim;
4307 
4308  static constexpr unsigned int space_dimension = spacedim;
4309 
4314  static constexpr unsigned int integral_dimension = dim - 1;
4315 
4320  FEFaceValues(const Mapping<dim, spacedim> & mapping,
4321  const FiniteElement<dim, spacedim> &fe,
4322  const Quadrature<dim - 1> & quadrature,
4323  const UpdateFlags update_flags);
4324 
4331  FEFaceValues(const Mapping<dim, spacedim> & mapping,
4332  const FiniteElement<dim, spacedim> &fe,
4333  const hp::QCollection<dim - 1> & quadrature,
4334  const UpdateFlags update_flags);
4335 
4342  const Quadrature<dim - 1> & quadrature,
4343  const UpdateFlags update_flags);
4344 
4352  const hp::QCollection<dim - 1> & quadrature,
4353  const UpdateFlags update_flags);
4354 
4359  template <bool level_dof_access>
4360  void
4363  const unsigned int face_no);
4364 
4371  template <bool level_dof_access>
4372  void
4375  const typename Triangulation<dim, spacedim>::face_iterator & face);
4376 
4390  void
4392  const unsigned int face_no);
4393 
4394  /*
4395  * Reinitialize the gradients, Jacobi determinants, etc for the given face
4396  * on a given cell of type "iterator into a Triangulation object", and the
4397  * given finite element. Since iterators into a triangulation alone only
4398  * convey information about the geometry of a cell, but not about degrees of
4399  * freedom possibly associated with this cell, you will not be able to call
4400  * some functions of this class if they need information about degrees of
4401  * freedom. These functions are, above all, the
4402  * <tt>get_function_value/gradients/hessians/third_derivatives</tt>
4403  * functions. If you want to call these functions, you have to call the @p
4404  * reinit variants that take iterators into DoFHandler or other DoF handler
4405  * type objects.
4406  *
4407  * @note @p face must be one of @p cell's face iterators.
4408  */
4409  void
4411  const typename Triangulation<dim, spacedim>::face_iterator &face);
4412 
4429 
4430 private:
4434  void
4435  initialize(const UpdateFlags update_flags);
4436 
4443  void
4444  do_reinit(const unsigned int face_no);
4445 };
4446 
4447 
4464 template <int dim, int spacedim = dim>
4465 class FESubfaceValues : public FEFaceValuesBase<dim, spacedim>
4466 {
4467 public:
4471  static constexpr unsigned int dimension = dim;
4472 
4476  static constexpr unsigned int space_dimension = spacedim;
4477 
4482  static constexpr unsigned int integral_dimension = dim - 1;
4483 
4488  FESubfaceValues(const Mapping<dim, spacedim> & mapping,
4489  const FiniteElement<dim, spacedim> &fe,
4490  const Quadrature<dim - 1> & face_quadrature,
4491  const UpdateFlags update_flags);
4492 
4499  FESubfaceValues(const Mapping<dim, spacedim> & mapping,
4500  const FiniteElement<dim, spacedim> &fe,
4501  const hp::QCollection<dim - 1> & face_quadrature,
4502  const UpdateFlags update_flags);
4503 
4510  const Quadrature<dim - 1> & face_quadrature,
4511  const UpdateFlags update_flags);
4512 
4520  const hp::QCollection<dim - 1> & face_quadrature,
4521  const UpdateFlags update_flags);
4522 
4529  template <bool level_dof_access>
4530  void
4533  const unsigned int face_no,
4534  const unsigned int subface_no);
4535 
4540  template <bool level_dof_access>
4541  void
4544  const typename Triangulation<dim, spacedim>::face_iterator & face,
4545  const typename Triangulation<dim, spacedim>::face_iterator &subface);
4546 
4560  void
4562  const unsigned int face_no,
4563  const unsigned int subface_no);
4564 
4584  void
4586  const typename Triangulation<dim, spacedim>::face_iterator &face,
4587  const typename Triangulation<dim, spacedim>::face_iterator &subface);
4588 
4605 
4611  DeclException0(ExcReinitCalledWithBoundaryFace);
4612 
4618  DeclException0(ExcFaceHasNoSubfaces);
4619 
4620 private:
4624  void
4625  initialize(const UpdateFlags update_flags);
4626 
4633  void
4634  do_reinit(const unsigned int face_no, const unsigned int subface_no);
4635 };
4636 
4637 
4638 #ifndef DOXYGEN
4639 
4640 
4641 /*------------------------ Inline functions: namespace FEValuesViews --------*/
4642 
4643 namespace FEValuesViews
4644 {
4645  template <int dim, int spacedim>
4646  inline typename Scalar<dim, spacedim>::value_type
4647  Scalar<dim, spacedim>::value(const unsigned int shape_function,
4648  const unsigned int q_point) const
4649  {
4650  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4651  Assert(
4652  fe_values->update_flags & update_values,
4654  "update_values"))));
4655 
4656  // an adaptation of the FEValuesBase::shape_value_component function
4657  // except that here we know the component as fixed and we have
4658  // pre-computed and cached a bunch of information. See the comments there.
4659  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4660  return fe_values->finite_element_output.shape_values(
4661  shape_function_data[shape_function].row_index, q_point);
4662  else
4663  return 0;
4664  }
4665 
4666 
4667 
4668  template <int dim, int spacedim>
4669  inline typename Scalar<dim, spacedim>::gradient_type
4670  Scalar<dim, spacedim>::gradient(const unsigned int shape_function,
4671  const unsigned int q_point) const
4672  {
4673  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4674  Assert(fe_values->update_flags & update_gradients,
4676  "update_gradients")));
4677 
4678  // an adaptation of the FEValuesBase::shape_grad_component
4679  // function except that here we know the component as fixed and we have
4680  // pre-computed and cached a bunch of information. See the comments there.
4681  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4682  return fe_values->finite_element_output
4683  .shape_gradients[shape_function_data[shape_function].row_index]
4684  [q_point];
4685  else
4686  return gradient_type();
4687  }
4688 
4689 
4690 
4691  template <int dim, int spacedim>
4692  inline typename Scalar<dim, spacedim>::hessian_type
4693  Scalar<dim, spacedim>::hessian(const unsigned int shape_function,
4694  const unsigned int q_point) const
4695  {
4696  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4697  Assert(fe_values->update_flags & update_hessians,
4699  "update_hessians")));
4700 
4701  // an adaptation of the FEValuesBase::shape_hessian_component
4702  // function except that here we know the component as fixed and we have
4703  // pre-computed and cached a bunch of information. See the comments there.
4704  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4705  return fe_values->finite_element_output
4706  .shape_hessians[shape_function_data[shape_function].row_index][q_point];
4707  else
4708  return hessian_type();
4709  }
4710 
4711 
4712 
4713  template <int dim, int spacedim>
4715  Scalar<dim, spacedim>::third_derivative(const unsigned int shape_function,
4716  const unsigned int q_point) const
4717  {
4718  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4719  Assert(fe_values->update_flags & update_3rd_derivatives,
4721  "update_3rd_derivatives")));
4722 
4723  // an adaptation of the FEValuesBase::shape_3rdderivative_component
4724  // function except that here we know the component as fixed and we have
4725  // pre-computed and cached a bunch of information. See the comments there.
4726  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
4727  return fe_values->finite_element_output
4728  .shape_3rd_derivatives[shape_function_data[shape_function].row_index]
4729  [q_point];
4730  else
4731  return third_derivative_type();
4732  }
4733 
4734 
4735 
4736  template <int dim, int spacedim>
4737  inline typename Vector<dim, spacedim>::value_type
4738  Vector<dim, spacedim>::value(const unsigned int shape_function,
4739  const unsigned int q_point) const
4740  {
4741  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4742  Assert(fe_values->update_flags & update_values,
4744  "update_values")));
4745 
4746  // same as for the scalar case except that we have one more index
4747  const int snc =
4748  shape_function_data[shape_function].single_nonzero_component;
4749  if (snc == -2)
4750  return value_type();
4751  else if (snc != -1)
4752  {
4753  value_type return_value;
4754  return_value[shape_function_data[shape_function]
4755  .single_nonzero_component_index] =
4756  fe_values->finite_element_output.shape_values(snc, q_point);
4757  return return_value;
4758  }
4759  else
4760  {
4761  value_type return_value;
4762  for (unsigned int d = 0; d < dim; ++d)
4763  if (shape_function_data[shape_function]
4764  .is_nonzero_shape_function_component[d])
4765  return_value[d] = fe_values->finite_element_output.shape_values(
4766  shape_function_data[shape_function].row_index[d], q_point);
4767 
4768  return return_value;
4769  }
4770  }
4771 
4772 
4773 
4774  template <int dim, int spacedim>
4775  inline typename Vector<dim, spacedim>::gradient_type
4776  Vector<dim, spacedim>::gradient(const unsigned int shape_function,
4777  const unsigned int q_point) const
4778  {
4779  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4780  Assert(fe_values->update_flags & update_gradients,
4782  "update_gradients")));
4783 
4784  // same as for the scalar case except that we have one more index
4785  const int snc =
4786  shape_function_data[shape_function].single_nonzero_component;
4787  if (snc == -2)
4788  return gradient_type();
4789  else if (snc != -1)
4790  {
4791  gradient_type return_value;
4792  return_value[shape_function_data[shape_function]
4793  .single_nonzero_component_index] =
4794  fe_values->finite_element_output.shape_gradients[snc][q_point];
4795  return return_value;
4796  }
4797  else
4798  {
4799  gradient_type return_value;
4800  for (unsigned int d = 0; d < dim; ++d)
4801  if (shape_function_data[shape_function]
4802  .is_nonzero_shape_function_component[d])
4803  return_value[d] =
4804  fe_values->finite_element_output.shape_gradients
4805  [shape_function_data[shape_function].row_index[d]][q_point];
4806 
4807  return return_value;
4808  }
4809  }
4810 
4811 
4812 
4813  template <int dim, int spacedim>
4815  Vector<dim, spacedim>::divergence(const unsigned int shape_function,
4816  const unsigned int q_point) const
4817  {
4818  // this function works like in the case above
4819  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4820  Assert(fe_values->update_flags & update_gradients,
4822  "update_gradients")));
4823 
4824  // same as for the scalar case except that we have one more index
4825  const int snc =
4826  shape_function_data[shape_function].single_nonzero_component;
4827  if (snc == -2)
4828  return divergence_type();
4829  else if (snc != -1)
4830  return fe_values->finite_element_output
4831  .shape_gradients[snc][q_point][shape_function_data[shape_function]
4832  .single_nonzero_component_index];
4833  else
4834  {
4835  divergence_type return_value = 0;
4836  for (unsigned int d = 0; d < dim; ++d)
4837  if (shape_function_data[shape_function]
4838  .is_nonzero_shape_function_component[d])
4839  return_value +=
4840  fe_values->finite_element_output.shape_gradients
4841  [shape_function_data[shape_function].row_index[d]][q_point][d];
4842 
4843  return return_value;
4844  }
4845  }
4846 
4847 
4848 
4849  template <int dim, int spacedim>
4850  inline typename Vector<dim, spacedim>::curl_type
4851  Vector<dim, spacedim>::curl(const unsigned int shape_function,
4852  const unsigned int q_point) const
4853  {
4854  // this function works like in the case above
4855 
4856  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
4857  Assert(fe_values->update_flags & update_gradients,
4859  "update_gradients")));
4860  // same as for the scalar case except that we have one more index
4861  const int snc =
4862  shape_function_data[shape_function].single_nonzero_component;
4863 
4864  if (snc == -2)
4865  return curl_type();
4866 
4867  else
4868  switch (dim)
4869  {
4870  case 1:
4871  {
4872  Assert(false,
4873  ExcMessage(
4874  "Computing the curl in 1d is not a useful operation"));
4875  return curl_type();
4876  }
4877 
4878  case 2:
4879  {
4880  if (snc != -1)
4881  {
4882  curl_type return_value;
4883 
4884  // the single nonzero component can only be zero or one in 2d
4885  if (shape_function_data[shape_function]
4886  .single_nonzero_component_index == 0)
4887  return_value[0] =
4888  -1.0 * fe_values->finite_element_output
4889  .shape_gradients[snc][q_point][1];
4890  else
4891  return_value[0] = fe_values->finite_element_output
4892  .shape_gradients[snc][q_point][0];
4893 
4894  return return_value;
4895  }
4896 
4897  else
4898  {
4899  curl_type return_value;
4900 
4901  return_value[0] = 0.0;
4902 
4903  if (shape_function_data[shape_function]
4904  .is_nonzero_shape_function_component[0])
4905  return_value[0] -=
4906  fe_values->finite_element_output
4907  .shape_gradients[shape_function_data[shape_function]
4908  .row_index[0]][q_point][1];
4909 
4910  if (shape_function_data[shape_function]
4911  .is_nonzero_shape_function_component[1])
4912  return_value[0] +=
4913  fe_values->finite_element_output
4914  .shape_gradients[shape_function_data[shape_function]
4915  .row_index[1]][q_point][0];
4916 
4917  return return_value;
4918  }
4919  }
4920 
4921  case 3:
4922  {
4923  if (snc != -1)
4924  {
4925  curl_type return_value;
4926 
4927  switch (shape_function_data[shape_function]
4928  .single_nonzero_component_index)
4929  {
4930  case 0:
4931  {
4932  return_value[0] = 0;
4933  return_value[1] = fe_values->finite_element_output
4934  .shape_gradients[snc][q_point][2];
4935  return_value[2] =
4936  -1.0 * fe_values->finite_element_output
4937  .shape_gradients[snc][q_point][1];
4938  return return_value;
4939  }
4940 
4941  case 1:
4942  {
4943  return_value[0] =
4944  -1.0 * fe_values->finite_element_output
4945  .shape_gradients[snc][q_point][2];
4946  return_value[1] = 0;
4947  return_value[2] = fe_values->finite_element_output
4948  .shape_gradients[snc][q_point][0];
4949  return return_value;
4950  }
4951 
4952  default:
4953  {
4954  return_value[0] = fe_values->finite_element_output
4955  .shape_gradients[snc][q_point][1];
4956  return_value[1] =
4957  -1.0 * fe_values->finite_element_output
4958  .shape_gradients[snc][q_point][0];
4959  return_value[2] = 0;
4960  return return_value;
4961  }
4962  }
4963  }
4964 
4965  else
4966  {
4967  curl_type return_value;
4968 
4969  for (unsigned int i = 0; i < dim; ++i)
4970  return_value[i] = 0.0;
4971 
4972  if (shape_function_data[shape_function]
4973  .is_nonzero_shape_function_component[0])
4974  {
4975  return_value[1] +=
4976  fe_values->finite_element_output
4977  .shape_gradients[shape_function_data[shape_function]
4978  .row_index[0]][q_point][2];
4979  return_value[2] -=
4980  fe_values->finite_element_output
4981  .shape_gradients[shape_function_data[shape_function]
4982  .row_index[0]][q_point][1];
4983  }
4984 
4985  if (shape_function_data[shape_function]
4986  .is_nonzero_shape_function_component[1])
4987  {
4988  return_value[0] -=
4989  fe_values->finite_element_output
4990  .shape_gradients[shape_function_data[shape_function]
4991  .row_index[1]][q_point][2];
4992  return_value[2] +=
4993  fe_values->finite_element_output
4994  .shape_gradients[shape_function_data[shape_function]
4995  .row_index[1]][q_point][0];
4996  }
4997 
4998  if (shape_function_data[shape_function]
4999  .is_nonzero_shape_function_component[2])
5000  {
5001  return_value[0] +=
5002  fe_values->finite_element_output
5003  .shape_gradients[shape_function_data[shape_function]
5004  .row_index[2]][q_point][1];
5005  return_value[1] -=
5006  fe_values->finite_element_output
5007  .shape_gradients[shape_function_data[shape_function]
5008  .row_index[2]][q_point][0];
5009  }
5010 
5011  return return_value;
5012  }
5013  }
5014  }
5015  // should not end up here
5016  Assert(false, ExcInternalError());
5017  return curl_type();
5018  }
5019 
5020 
5021 
5022  template <int dim, int spacedim>
5023  inline typename Vector<dim, spacedim>::hessian_type
5024  Vector<dim, spacedim>::hessian(const unsigned int shape_function,
5025  const unsigned int q_point) const
5026  {
5027  // this function works like in the case above
5028  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5029  Assert(fe_values->update_flags & update_hessians,
5031  "update_hessians")));
5032 
5033  // same as for the scalar case except that we have one more index
5034  const int snc =
5035  shape_function_data[shape_function].single_nonzero_component;
5036  if (snc == -2)
5037  return hessian_type();
5038  else if (snc != -1)
5039  {
5040  hessian_type return_value;
5041  return_value[shape_function_data[shape_function]
5042  .single_nonzero_component_index] =
5043  fe_values->finite_element_output.shape_hessians[snc][q_point];
5044  return return_value;
5045  }
5046  else
5047  {
5048  hessian_type return_value;
5049  for (unsigned int d = 0; d < dim; ++d)
5050  if (shape_function_data[shape_function]
5051  .is_nonzero_shape_function_component[d])
5052  return_value[d] =
5053  fe_values->finite_element_output.shape_hessians
5054  [shape_function_data[shape_function].row_index[d]][q_point];
5055 
5056  return return_value;
5057  }
5058  }
5059 
5060 
5061 
5062  template <int dim, int spacedim>
5064  Vector<dim, spacedim>::third_derivative(const unsigned int shape_function,
5065  const unsigned int q_point) const
5066  {
5067  // this function works like in the case above
5068  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5069  Assert(fe_values->update_flags & update_3rd_derivatives,
5071  "update_3rd_derivatives")));
5072 
5073  // same as for the scalar case except that we have one more index
5074  const int snc =
5075  shape_function_data[shape_function].single_nonzero_component;
5076  if (snc == -2)
5077  return third_derivative_type();
5078  else if (snc != -1)
5079  {
5080  third_derivative_type return_value;
5081  return_value[shape_function_data[shape_function]
5082  .single_nonzero_component_index] =
5083  fe_values->finite_element_output.shape_3rd_derivatives[snc][q_point];
5084  return return_value;
5085  }
5086  else
5087  {
5088  third_derivative_type return_value;
5089  for (unsigned int d = 0; d < dim; ++d)
5090  if (shape_function_data[shape_function]
5091  .is_nonzero_shape_function_component[d])
5092  return_value[d] =
5093  fe_values->finite_element_output.shape_3rd_derivatives
5094  [shape_function_data[shape_function].row_index[d]][q_point];
5095 
5096  return return_value;
5097  }
5098  }
5099 
5100 
5101 
5102  namespace internal
5103  {
5108  inline ::SymmetricTensor<2, 1>
5109  symmetrize_single_row(const unsigned int n, const ::Tensor<1, 1> &t)
5110  {
5111  AssertIndexRange(n, 1);
5112  (void)n;
5113 
5114  return {{t[0]}};
5115  }
5116 
5117 
5118 
5119  inline ::SymmetricTensor<2, 2>
5120  symmetrize_single_row(const unsigned int n, const ::Tensor<1, 2> &t)
5121  {
5122  switch (n)
5123  {
5124  case 0:
5125  {
5126  return {{t[0], 0, t[1] / 2}};
5127  }
5128  case 1:
5129  {
5130  return {{0, t[1], t[0] / 2}};
5131  }
5132  default:
5133  {
5134  AssertIndexRange(n, 2);
5135  return {};
5136  }
5137  }
5138  }
5139 
5140 
5141 
5142  inline ::SymmetricTensor<2, 3>
5143  symmetrize_single_row(const unsigned int n, const ::Tensor<1, 3> &t)
5144  {
5145  switch (n)
5146  {
5147  case 0:
5148  {
5149  return {{t[0], 0, 0, t[1] / 2, t[2] / 2, 0}};
5150  }
5151  case 1:
5152  {
5153  return {{0, t[1], 0, t[0] / 2, 0, t[2] / 2}};
5154  }
5155  case 2:
5156  {
5157  return {{0, 0, t[2], 0, t[0] / 2, t[1] / 2}};
5158  }
5159  default:
5160  {
5161  AssertIndexRange(n, 3);
5162  return {};
5163  }
5164  }
5165  }
5166  } // namespace internal
5167 
5168 
5169 
5170  template <int dim, int spacedim>
5172  Vector<dim, spacedim>::symmetric_gradient(const unsigned int shape_function,
5173  const unsigned int q_point) const
5174  {
5175  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5176  Assert(fe_values->update_flags & update_gradients,
5178  "update_gradients")));
5179 
5180  // same as for the scalar case except that we have one more index
5181  const int snc =
5182  shape_function_data[shape_function].single_nonzero_component;
5183  if (snc == -2)
5184  return symmetric_gradient_type();
5185  else if (snc != -1)
5186  return internal::symmetrize_single_row(
5187  shape_function_data[shape_function].single_nonzero_component_index,
5188  fe_values->finite_element_output.shape_gradients[snc][q_point]);
5189  else
5190  {
5191  gradient_type return_value;
5192  for (unsigned int d = 0; d < dim; ++d)
5193  if (shape_function_data[shape_function]
5194  .is_nonzero_shape_function_component[d])
5195  return_value[d] =
5196  fe_values->finite_element_output.shape_gradients
5197  [shape_function_data[shape_function].row_index[d]][q_point];
5198 
5199  return symmetrize(return_value);
5200  }
5201  }
5202 
5203 
5204 
5205  template <int dim, int spacedim>
5207  SymmetricTensor<2, dim, spacedim>::value(const unsigned int shape_function,
5208  const unsigned int q_point) const
5209  {
5210  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5211  Assert(fe_values->update_flags & update_values,
5213  "update_values")));
5214 
5215  // similar to the vector case where we have more then one index and we need
5216  // to convert between unrolled and component indexing for tensors
5217  const int snc =
5218  shape_function_data[shape_function].single_nonzero_component;
5219 
5220  if (snc == -2)
5221  {
5222  // shape function is zero for the selected components
5223  return value_type();
5224  }
5225  else if (snc != -1)
5226  {
5227  value_type return_value;
5228  const unsigned int comp =
5229  shape_function_data[shape_function].single_nonzero_component_index;
5230  return_value[value_type::unrolled_to_component_indices(comp)] =
5231  fe_values->finite_element_output.shape_values(snc, q_point);
5232  return return_value;
5233  }
5234  else
5235  {
5236  value_type return_value;
5237  for (unsigned int d = 0; d < value_type::n_independent_components; ++d)
5238  if (shape_function_data[shape_function]
5239  .is_nonzero_shape_function_component[d])
5240  return_value[value_type::unrolled_to_component_indices(d)] =
5241  fe_values->finite_element_output.shape_values(
5242  shape_function_data[shape_function].row_index[d], q_point);
5243  return return_value;
5244  }
5245  }
5246 
5247 
5248 
5249  template <int dim, int spacedim>
5252  const unsigned int shape_function,
5253  const unsigned int q_point) const
5254  {
5255  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5256  Assert(fe_values->update_flags & update_gradients,
5258  "update_gradients")));
5259 
5260  const int snc =
5261  shape_function_data[shape_function].single_nonzero_component;
5262 
5263  if (snc == -2)
5264  {
5265  // shape function is zero for the selected components
5266  return divergence_type();
5267  }
5268  else if (snc != -1)
5269  {
5270  // we have a single non-zero component when the symmetric tensor is
5271  // represented in unrolled form. this implies we potentially have
5272  // two non-zero components when represented in component form! we
5273  // will only have one non-zero entry if the non-zero component lies on
5274  // the diagonal of the tensor.
5275  //
5276  // the divergence of a second-order tensor is a first order tensor.
5277  //
5278  // assume the second-order tensor is A with components A_{ij}. then
5279  // A_{ij} = A_{ji} and there is only one (if diagonal) or two non-zero
5280  // entries in the tensorial representation. define the
5281  // divergence as:
5282  // b_i \dealcoloneq \dfrac{\partial phi_{ij}}{\partial x_j}.
5283  // (which is incidentally also
5284  // b_j \dealcoloneq \dfrac{\partial phi_{ij}}{\partial x_i}).
5285  // In both cases, a sum is implied.
5286  //
5287  // Now, we know the nonzero component in unrolled form: it is indicated
5288  // by 'snc'. we can figure out which tensor components belong to this:
5289  const unsigned int comp =
5290  shape_function_data[shape_function].single_nonzero_component_index;
5291  const unsigned int ii =
5292  value_type::unrolled_to_component_indices(comp)[0];
5293  const unsigned int jj =
5294  value_type::unrolled_to_component_indices(comp)[1];
5295 
5296  // given the form of the divergence above, if ii=jj there is only a
5297  // single nonzero component of the full tensor and the gradient
5298  // equals
5299  // b_ii \dealcoloneq \dfrac{\partial phi_{ii,ii}}{\partial x_ii}.
5300  // all other entries of 'b' are zero
5301  //
5302  // on the other hand, if ii!=jj, then there are two nonzero entries in
5303  // the full tensor and
5304  // b_ii \dealcoloneq \dfrac{\partial phi_{ii,jj}}{\partial x_ii}.
5305  // b_jj \dealcoloneq \dfrac{\partial phi_{ii,jj}}{\partial x_jj}.
5306  // again, all other entries of 'b' are zero
5307  const ::Tensor<1, spacedim> &phi_grad =
5308  fe_values->finite_element_output.shape_gradients[snc][q_point];
5309 
5310  divergence_type return_value;
5311  return_value[ii] = phi_grad[jj];
5312 
5313  if (ii != jj)
5314  return_value[jj] = phi_grad[ii];
5315 
5316  return return_value;
5317  }
5318  else
5319  {
5320  Assert(false, ExcNotImplemented());
5321  divergence_type return_value;
5322  return return_value;
5323  }
5324  }
5325 
5326 
5327 
5328  template <int dim, int spacedim>
5329  inline typename Tensor<2, dim, spacedim>::value_type
5330  Tensor<2, dim, spacedim>::value(const unsigned int shape_function,
5331  const unsigned int q_point) const
5332  {
5333  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5334  Assert(fe_values->update_flags & update_values,
5336  "update_values")));
5337 
5338  // similar to the vector case where we have more then one index and we need
5339  // to convert between unrolled and component indexing for tensors
5340  const int snc =
5341  shape_function_data[shape_function].single_nonzero_component;
5342 
5343  if (snc == -2)
5344  {
5345  // shape function is zero for the selected components
5346  return value_type();
5347  }
5348  else if (snc != -1)
5349  {
5350  value_type return_value;
5351  const unsigned int comp =
5352  shape_function_data[shape_function].single_nonzero_component_index;
5353  const TableIndices<2> indices =
5355  return_value[indices] =
5356  fe_values->finite_element_output.shape_values(snc, q_point);
5357  return return_value;
5358  }
5359  else
5360  {
5361  value_type return_value;
5362  for (unsigned int d = 0; d < dim * dim; ++d)
5363  if (shape_function_data[shape_function]
5364  .is_nonzero_shape_function_component[d])
5365  {
5366  const TableIndices<2> indices =
5368  return_value[indices] =
5369  fe_values->finite_element_output.shape_values(
5370  shape_function_data[shape_function].row_index[d], q_point);
5371  }
5372  return return_value;
5373  }
5374  }
5375 
5376 
5377 
5378  template <int dim, int spacedim>
5380  Tensor<2, dim, spacedim>::divergence(const unsigned int shape_function,
5381  const unsigned int q_point) const
5382  {
5383  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5384  Assert(fe_values->update_flags & update_gradients,
5386  "update_gradients")));
5387 
5388  const int snc =
5389  shape_function_data[shape_function].single_nonzero_component;
5390 
5391  if (snc == -2)
5392  {
5393  // shape function is zero for the selected components
5394  return divergence_type();
5395  }
5396  else if (snc != -1)
5397  {
5398  // we have a single non-zero component when the tensor is
5399  // represented in unrolled form.
5400  //
5401  // the divergence of a second-order tensor is a first order tensor.
5402  //
5403  // assume the second-order tensor is A with components A_{ij},
5404  // then divergence is d_i := \frac{\partial A_{ij}}{\partial x_j}
5405  //
5406  // Now, we know the nonzero component in unrolled form: it is indicated
5407  // by 'snc'. we can figure out which tensor components belong to this:
5408  const unsigned int comp =
5409  shape_function_data[shape_function].single_nonzero_component_index;
5410  const TableIndices<2> indices =
5412  const unsigned int ii = indices[0];
5413  const unsigned int jj = indices[1];
5414 
5415  const ::Tensor<1, spacedim> &phi_grad =
5416  fe_values->finite_element_output.shape_gradients[snc][q_point];
5417 
5418  divergence_type return_value;
5419  // note that we contract \nabla from the right
5420  return_value[ii] = phi_grad[jj];
5421 
5422  return return_value;
5423  }
5424  else
5425  {
5426  Assert(false, ExcNotImplemented());
5427  divergence_type return_value;
5428  return return_value;
5429  }
5430  }
5431 
5432 
5433 
5434  template <int dim, int spacedim>
5436  Tensor<2, dim, spacedim>::gradient(const unsigned int shape_function,
5437  const unsigned int q_point) const
5438  {
5439  AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell());
5440  Assert(fe_values->update_flags & update_gradients,
5442  "update_gradients")));
5443 
5444  const int snc =
5445  shape_function_data[shape_function].single_nonzero_component;
5446 
5447  if (snc == -2)
5448  {
5449  // shape function is zero for the selected components
5450  return gradient_type();
5451  }
5452  else if (snc != -1)
5453  {
5454  // we have a single non-zero component when the tensor is
5455  // represented in unrolled form.
5456  //
5457  // the gradient of a second-order tensor is a third order tensor.
5458  //
5459  // assume the second-order tensor is A with components A_{ij},
5460  // then gradient is B_{ijk} := \frac{\partial A_{ij}}{\partial x_k}
5461  //
5462  // Now, we know the nonzero component in unrolled form: it is indicated
5463  // by 'snc'. we can figure out which tensor components belong to this:
5464  const unsigned int comp =
5465  shape_function_data[shape_function].single_nonzero_component_index;
5466  const TableIndices<2> indices =
5468  const unsigned int ii = indices[0];
5469  const unsigned int jj = indices[1];
5470 
5471  const ::Tensor<1, spacedim> &phi_grad =
5472  fe_values->finite_element_output.shape_gradients[snc][q_point];
5473 
5474  gradient_type return_value;
5475  return_value[ii][jj] = phi_grad;
5476 
5477  return return_value;
5478  }
5479  else
5480  {
5481  Assert(false, ExcNotImplemented());
5482  gradient_type return_value;
5483  return return_value;
5484  }
5485  }
5486 
5487 } // namespace FEValuesViews
5488 
5489 
5490 
5491 /*---------------------- Inline functions: FEValuesBase ---------------------*/
5492 
5493 
5494 
5495 template <int dim, int spacedim>
5496 template <bool lda>
5500  : initialized(true)
5501  , cell(cell)
5502  , dof_handler(&cell->get_dof_handler())
5503  , level_dof_access(lda)
5504 {}
5505 
5506 
5507 
5508 template <int dim, int spacedim>
5511  const FEValuesExtractors::Scalar &scalar) const
5512 {
5513  AssertIndexRange(scalar.component, fe_values_views_cache.scalars.size());
5514 
5515  return fe_values_views_cache.scalars[scalar.component];
5516 }
5517 
5518 
5519 
5520 template <int dim, int spacedim>
5523  const FEValuesExtractors::Vector &vector) const
5524 {
5526  fe_values_views_cache.vectors.size());
5527 
5528  return fe_values_views_cache.vectors[vector.first_vector_component];
5529 }
5530 
5531 
5532 
5533 template <int dim, int spacedim>
5536  const FEValuesExtractors::SymmetricTensor<2> &tensor) const
5537 {
5538  Assert(
5539  tensor.first_tensor_component <
5540  fe_values_views_cache.symmetric_second_order_tensors.size(),
5542  0,
5543  fe_values_views_cache.symmetric_second_order_tensors.size()));
5544 
5545  return fe_values_views_cache
5546  .symmetric_second_order_tensors[tensor.first_tensor_component];
5547 }
5548 
5549 
5550 
5551 template <int dim, int spacedim>
5554  const FEValuesExtractors::Tensor<2> &tensor) const
5555 {
5557  fe_values_views_cache.second_order_tensors.size());
5558 
5559  return fe_values_views_cache
5560  .second_order_tensors[tensor.first_tensor_component];
5561 }
5562 
5563 
5564 
5565 template <int dim, int spacedim>
5566 inline const double &
5567 FEValuesBase<dim, spacedim>::shape_value(const unsigned int i,
5568  const unsigned int q_point) const
5569 {
5570  AssertIndexRange(i, fe->n_dofs_per_cell());
5571  Assert(this->update_flags & update_values,
5572  ExcAccessToUninitializedField("update_values"));
5573  Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5574  Assert(present_cell.is_initialized(), ExcNotReinited());
5575  // if the entire FE is primitive,
5576  // then we can take a short-cut:
5577  if (fe->is_primitive())
5578  return this->finite_element_output.shape_values(i, q_point);
5579  else
5580  {
5581  // otherwise, use the mapping
5582  // between shape function
5583  // numbers and rows. note that
5584  // by the assertions above, we
5585  // know that this particular
5586  // shape function is primitive,
5587  // so we can call
5588  // system_to_component_index
5589  const unsigned int row =
5590  this->finite_element_output
5591  .shape_function_to_row_table[i * fe->n_components() +
5592  fe->system_to_component_index(i).first];
5593  return this->finite_element_output.shape_values(row, q_point);
5594  }
5595 }
5596 
5597 
5598 
5599 template <int dim, int spacedim>
5600 inline double
5602  const unsigned int i,
5603  const unsigned int q_point,
5604  const unsigned int component) const
5605 {
5606  AssertIndexRange(i, fe->n_dofs_per_cell());
5607  Assert(this->update_flags & update_values,
5608  ExcAccessToUninitializedField("update_values"));
5609  AssertIndexRange(component, fe->n_components());
5610  Assert(present_cell.is_initialized(), ExcNotReinited());
5611 
5612  // check whether the shape function
5613  // is non-zero at all within
5614  // this component:
5615  if (fe->get_nonzero_components(i)[component] == false)
5616  return 0;
5617 
5618  // look up the right row in the
5619  // table and take the data from
5620  // there
5621  const unsigned int row =
5622  this->finite_element_output
5623  .shape_function_to_row_table[i * fe->n_components() + component];
5624  return this->finite_element_output.shape_values(row, q_point);
5625 }
5626 
5627 
5628 
5629 template <int dim, int spacedim>
5630 inline const Tensor<1, spacedim> &
5631 FEValuesBase<dim, spacedim>::shape_grad(const unsigned int i,
5632  const unsigned int q_point) const
5633 {
5634  AssertIndexRange(i, fe->n_dofs_per_cell());
5635  Assert(this->update_flags & update_gradients,
5636  ExcAccessToUninitializedField("update_gradients"));
5637  Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5638  Assert(present_cell.is_initialized(), ExcNotReinited());
5639  // if the entire FE is primitive,
5640  // then we can take a short-cut:
5641  if (fe->is_primitive())
5642  return this->finite_element_output.shape_gradients[i][q_point];
5643  else
5644  {
5645  // otherwise, use the mapping
5646  // between shape function
5647  // numbers and rows. note that
5648  // by the assertions above, we
5649  // know that this particular
5650  // shape function is primitive,
5651  // so we can call
5652  // system_to_component_index
5653  const unsigned int row =
5654  this->finite_element_output
5655  .shape_function_to_row_table[i * fe->n_components() +
5656  fe->system_to_component_index(i).first];
5657  return this->finite_element_output.shape_gradients[row][q_point];
5658  }
5659 }
5660 
5661 
5662 
5663 template <int dim, int spacedim>
5664 inline Tensor<1, spacedim>
5666  const unsigned int i,
5667  const unsigned int q_point,
5668  const unsigned int component) const
5669 {
5670  AssertIndexRange(i, fe->n_dofs_per_cell());
5671  Assert(this->update_flags & update_gradients,
5672  ExcAccessToUninitializedField("update_gradients"));
5673  AssertIndexRange(component, fe->n_components());
5674  Assert(present_cell.is_initialized(), ExcNotReinited());
5675  // check whether the shape function
5676  // is non-zero at all within
5677  // this component:
5678  if (fe->get_nonzero_components(i)[component] == false)
5679  return Tensor<1, spacedim>();
5680 
5681  // look up the right row in the
5682  // table and take the data from
5683  // there
5684  const unsigned int row =
5685  this->finite_element_output
5686  .shape_function_to_row_table[i * fe->n_components() + component];
5687  return this->finite_element_output.shape_gradients[row][q_point];
5688 }
5689 
5690 
5691 
5692 template <int dim, int spacedim>
5693 inline const Tensor<2, spacedim> &
5694 FEValuesBase<dim, spacedim>::shape_hessian(const unsigned int i,
5695  const unsigned int q_point) const
5696 {
5697  AssertIndexRange(i, fe->n_dofs_per_cell());
5698  Assert(this->update_flags & update_hessians,
5699  ExcAccessToUninitializedField("update_hessians"));
5700  Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5701  Assert(present_cell.is_initialized(), ExcNotReinited());
5702  // if the entire FE is primitive,
5703  // then we can take a short-cut:
5704  if (fe->is_primitive())
5705  return this->finite_element_output.shape_hessians[i][q_point];
5706  else
5707  {
5708  // otherwise, use the mapping
5709  // between shape function
5710  // numbers and rows. note that
5711  // by the assertions above, we
5712  // know that this particular
5713  // shape function is primitive,
5714  // so we can call
5715  // system_to_component_index
5716  const unsigned int row =
5717  this->finite_element_output
5718  .shape_function_to_row_table[i * fe->n_components() +
5719  fe->system_to_component_index(i).first];
5720  return this->finite_element_output.shape_hessians[row][q_point];
5721  }
5722 }
5723 
5724 
5725 
5726 template <int dim, int spacedim>
5727 inline Tensor<2, spacedim>
5729  const unsigned int i,
5730  const unsigned int q_point,
5731  const unsigned int component) const
5732 {
5733  AssertIndexRange(i, fe->n_dofs_per_cell());
5734  Assert(this->update_flags & update_hessians,
5735  ExcAccessToUninitializedField("update_hessians"));
5736  AssertIndexRange(component, fe->n_components());
5737  Assert(present_cell.is_initialized(), ExcNotReinited());
5738  // check whether the shape function
5739  // is non-zero at all within
5740  // this component:
5741  if (fe->get_nonzero_components(i)[component] == false)
5742  return Tensor<2, spacedim>();
5743 
5744  // look up the right row in the
5745  // table and take the data from
5746  // there
5747  const unsigned int row =
5748  this->finite_element_output
5749  .shape_function_to_row_table[i * fe->n_components() + component];
5750  return this->finite_element_output.shape_hessians[row][q_point];
5751 }
5752 
5753 
5754 
5755 template <int dim, int spacedim>
5756 inline const Tensor<3, spacedim> &
5758  const unsigned int i,
5759  const unsigned int q_point) const
5760 {
5761  AssertIndexRange(i, fe->n_dofs_per_cell());
5762  Assert(this->update_flags & update_3rd_derivatives,
5763  ExcAccessToUninitializedField("update_3rd_derivatives"));
5764  Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
5765  Assert(present_cell.is_initialized(), ExcNotReinited());
5766  // if the entire FE is primitive,
5767  // then we can take a short-cut:
5768  if (fe->is_primitive())
5769  return this->finite_element_output.shape_3rd_derivatives[i][q_point];
5770  else
5771  {
5772  // otherwise, use the mapping
5773  // between shape function
5774  // numbers and rows. note that
5775  // by the assertions above, we
5776  // know that this particular
5777  // shape function is primitive,
5778  // so we can call
5779  // system_to_component_index
5780  const unsigned int row =
5781  this->finite_element_output
5782  .shape_function_to_row_table[i * fe->n_components() +
5783  fe->system_to_component_index(i).first];
5784  return this->finite_element_output.shape_3rd_derivatives[row][q_point];
5785  }
5786 }
5787 
5788 
5789 
5790 template <int dim, int spacedim>
5791 inline Tensor<3, spacedim>
5793  const unsigned int i,
5794  const unsigned int q_point,
5795  const unsigned int component) const
5796 {
5797  AssertIndexRange(i, fe->n_dofs_per_cell());
5798  Assert(this->update_flags & update_3rd_derivatives,
5799  ExcAccessToUninitializedField("update_3rd_derivatives"));
5800  AssertIndexRange(component, fe->n_components());
5801  Assert(present_cell.is_initialized(), ExcNotReinited());
5802  // check whether the shape function
5803  // is non-zero at all within
5804  // this component:
5805  if (fe->get_nonzero_components(i)[component] == false)
5806  return Tensor<3, spacedim>();
5807 
5808  // look up the right row in the
5809  // table and take the data from
5810  // there
5811  const unsigned int row =
5812  this->finite_element_output
5813  .shape_function_to_row_table[i * fe->n_components() + component];
5814  return this->finite_element_output.shape_3rd_derivatives[row][q_point];
5815 }
5816 
5817 
5818 
5819 template <int dim, int spacedim>
5820 inline const FiniteElement<dim, spacedim> &
5822 {
5823  return *fe;
5824 }
5825 
5826 
5827 
5828 template <int dim, int spacedim>
5829 inline const Mapping<dim, spacedim> &
5831 {
5832  return *mapping;
5833 }
5834 
5835 
5836 
5837 template <int dim, int spacedim>
5838 inline UpdateFlags
5840 {
5841  return this->update_flags;
5842 }
5843 
5844 
5845 
5846 template <int dim, int spacedim>
5847 inline const std::vector<Point<spacedim>> &
5849 {
5850  Assert(this->update_flags & update_quadrature_points,
5851  ExcAccessToUninitializedField("update_quadrature_points"));
5852  Assert(present_cell.is_initialized(), ExcNotReinited());
5853  return this->mapping_output.quadrature_points;
5854 }
5855 
5856 
5857 
5858 template <int dim, int spacedim>
5859 inline const std::vector<double> &
5861 {
5862  Assert(this->update_flags & update_JxW_values,
5863  ExcAccessToUninitializedField("update_JxW_values"));
5864  Assert(present_cell.is_initialized(), ExcNotReinited());
5865  return this->mapping_output.JxW_values;
5866 }
5867 
5868 
5869 
5870 template <int dim, int spacedim>
5871 inline const std::vector<DerivativeForm<1, dim, spacedim>> &
5873 {
5874  Assert(this->update_flags & update_jacobians,
5875  ExcAccessToUninitializedField("update_jacobians"));
5876  Assert(present_cell.is_initialized(), ExcNotReinited());
5877  return this->mapping_output.jacobians;
5878 }
5879 
5880 
5881 
5882 template <int dim, int spacedim>
5883 inline const std::vector<DerivativeForm<2, dim, spacedim>> &
5885 {
5886  Assert(this->update_flags & update_jacobian_grads,
5887  ExcAccessToUninitializedField("update_jacobians_grads"));
5888  Assert(present_cell.is_initialized(), ExcNotReinited());
5889  return this->mapping_output.jacobian_grads;
5890 }
5891 
5892 
5893 
5894 template <int dim, int spacedim>
5895 inline const Tensor<3, spacedim> &
5897  const unsigned int q_point) const
5898 {
5899  Assert(this->update_flags & update_jacobian_pushed_forward_grads,
5900  ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
5901  Assert(present_cell.is_initialized(), ExcNotReinited());
5902  return this->mapping_output.jacobian_pushed_forward_grads[q_point];
5903 }
5904 
5905 
5906 
5907 template <int dim, int spacedim>
5908 inline const std::vector<Tensor<3, spacedim>> &
5910 {
5911  Assert(this->update_flags & update_jacobian_pushed_forward_grads,
5912  ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
5913  Assert(present_cell.is_initialized(), ExcNotReinited());
5914  return this->mapping_output.jacobian_pushed_forward_grads;
5915 }
5916 
5917 
5918 
5919 template <int dim, int spacedim>
5920 inline const DerivativeForm<3, dim, spacedim> &
5922  const unsigned int q_point) const
5923 {
5924  Assert(this->update_flags & update_jacobian_2nd_derivatives,
5925  ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
5926  Assert(present_cell.is_initialized(), ExcNotReinited());
5927  return this->mapping_output.jacobian_2nd_derivatives[q_point];
5928 }
5929 
5930 
5931 
5932 template <int dim, int spacedim>
5933 inline const std::vector<DerivativeForm<3, dim, spacedim>> &
5935 {
5936  Assert(this->update_flags & update_jacobian_2nd_derivatives,
5937  ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
5938  Assert(present_cell.is_initialized(), ExcNotReinited());
5939  return this->mapping_output.jacobian_2nd_derivatives;
5940 }
5941 
5942 
5943 
5944 template <int dim, int spacedim>
5945 inline const Tensor<4, spacedim> &
5947  const unsigned int q_point) const
5948 {
5951  "update_jacobian_pushed_forward_2nd_derivatives"));
5952  Assert(present_cell.is_initialized(), ExcNotReinited());
5953  return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[q_point];
5954 }
5955 
5956 
5957 
5958 template <int dim, int spacedim>
5959 inline const std::vector<Tensor<4, spacedim>> &
5961 {
5964  "update_jacobian_pushed_forward_2nd_derivatives"));
5965  Assert(present_cell.is_initialized(), ExcNotReinited());
5966  return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
5967 }
5968 
5969 
5970 
5971 template <int dim, int spacedim>
5972 inline const DerivativeForm<4, dim, spacedim> &
5974  const unsigned int q_point) const
5975 {
5976  Assert(this->update_flags & update_jacobian_3rd_derivatives,
5977  ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
5978  Assert(present_cell.is_initialized(), ExcNotReinited());
5979  return this->mapping_output.jacobian_3rd_derivatives[q_point];
5980 }
5981 
5982 
5983 
5984 template <int dim, int spacedim>
5985 inline const std::vector<DerivativeForm<4, dim, spacedim>> &
5987 {
5988  Assert(this->update_flags & update_jacobian_3rd_derivatives,
5989  ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
5990  Assert(present_cell.is_initialized(), ExcNotReinited());
5991  return this->mapping_output.jacobian_3rd_derivatives;
5992 }
5993 
5994 
5995 
5996 template <int dim, int spacedim>
5997 inline const Tensor<5, spacedim> &
5999  const unsigned int q_point) const
6000 {
6003  "update_jacobian_pushed_forward_3rd_derivatives"));
6004  Assert(present_cell.is_initialized(), ExcNotReinited());
6005  return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[q_point];
6006 }
6007 
6008 
6009 
6010 template <int dim, int spacedim>
6011 inline const std::vector<Tensor<5, spacedim>> &
6013 {
6016  "update_jacobian_pushed_forward_3rd_derivatives"));
6017  Assert(present_cell.is_initialized(), ExcNotReinited());
6018  return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
6019 }
6020 
6021 
6022 
6023 template <int dim, int spacedim>
6024 inline const std::vector<DerivativeForm<1, spacedim, dim>> &
6026 {
6027  Assert(this->update_flags & update_inverse_jacobians,
6028  ExcAccessToUninitializedField("update_inverse_jacobians"));
6029  Assert(present_cell.is_initialized(), ExcNotReinited());
6030  return this->mapping_output.inverse_jacobians;
6031 }
6032 
6033 
6034 
6035 template <int dim, int spacedim>
6038 {
6039  return {0U, dofs_per_cell};
6040 }
6041 
6042 
6043 
6044 template <int dim, int spacedim>
6047  const unsigned int start_dof_index) const
6048 {
6049  Assert(start_dof_index <= dofs_per_cell,
6050  ExcIndexRange(start_dof_index, 0, dofs_per_cell + 1));
6051  return {start_dof_index, dofs_per_cell};
6052 }
6053 
6054 
6055 
6056 template <int dim, int spacedim>
6059  const unsigned int end_dof_index) const
6060 {
6061  Assert(end_dof_index < dofs_per_cell,
6062  ExcIndexRange(end_dof_index, 0, dofs_per_cell));
6063  return {0U, end_dof_index + 1};
6064 }
6065 
6066 
6067 
6068 template <int dim, int spacedim>
6071 {
6072  return {0U, n_quadrature_points};
6073 }
6074 
6075 
6076 
6077 template <int dim, int spacedim>
6078 inline const Point<spacedim> &
6079 FEValuesBase<dim, spacedim>::quadrature_point(const unsigned int q_point) const
6080 {
6081  Assert(this->update_flags & update_quadrature_points,
6082  ExcAccessToUninitializedField("update_quadrature_points"));
6083  AssertIndexRange(q_point, this->mapping_output.quadrature_points.size());
6084  Assert(present_cell.is_initialized(), ExcNotReinited());
6085 
6086  return this->mapping_output.quadrature_points[q_point];
6087 }
6088 
6089 
6090 
6091 template <int dim, int spacedim>
6092 inline double
6093 FEValuesBase<dim, spacedim>::JxW(const unsigned int q_point) const
6094 {
6095  Assert(this->update_flags & update_JxW_values,
6096  ExcAccessToUninitializedField("update_JxW_values"));
6097  AssertIndexRange(q_point, this->mapping_output.JxW_values.size());
6098  Assert(present_cell.is_initialized(), ExcNotReinited());
6099 
6100  return this->mapping_output.JxW_values[q_point];
6101 }
6102 
6103 
6104 
6105 template <int dim, int spacedim>
6106 inline const DerivativeForm<1, dim, spacedim> &
6107 FEValuesBase<dim, spacedim>::jacobian(const unsigned int q_point) const
6108 {
6109  Assert(this->update_flags & update_jacobians,
6110  ExcAccessToUninitializedField("update_jacobians"));
6111  AssertIndexRange(q_point, this->mapping_output.jacobians.size());
6112  Assert(present_cell.is_initialized(), ExcNotReinited());
6113 
6114  return this->mapping_output.jacobians[q_point];
6115 }
6116 
6117 
6118 
6119 template <int dim, int spacedim>
6120 inline const DerivativeForm<2, dim, spacedim> &
6121 FEValuesBase<dim, spacedim>::jacobian_grad(const unsigned int q_point) const
6122 {
6123  Assert(this->update_flags & update_jacobian_grads,
6124  ExcAccessToUninitializedField("update_jacobians_grads"));
6125  AssertIndexRange(q_point, this->mapping_output.jacobian_grads.size());
6126  Assert(present_cell.is_initialized(), ExcNotReinited());
6127 
6128  return this->mapping_output.jacobian_grads[q_point];
6129 }
6130 
6131 
6132 
6133 template <int dim, int spacedim>
6134 inline const DerivativeForm<1, spacedim, dim> &
6135 FEValuesBase<dim, spacedim>::inverse_jacobian(const unsigned int q_point) const
6136 {
6137  Assert(this->update_flags & update_inverse_jacobians,
6138  ExcAccessToUninitializedField("update_inverse_jacobians"));
6139  AssertIndexRange(q_point, this->mapping_output.inverse_jacobians.size());
6140  Assert(present_cell.is_initialized(), ExcNotReinited());
6141 
6142  return this->mapping_output.inverse_jacobians[q_point];
6143 }
6144 
6145 
6146 
6147 template <int dim, int spacedim>
6148 inline const Tensor<1, spacedim> &
6149 FEValuesBase<dim, spacedim>::normal_vector(const unsigned int q_point) const
6150 {
6151  Assert(this->update_flags & update_normal_vectors,
6153  "update_normal_vectors")));
6154  AssertIndexRange(q_point, this->mapping_output.normal_vectors.size());
6155  Assert(present_cell.is_initialized(), ExcNotReinited());
6156 
6157  return this->mapping_output.normal_vectors[q_point];
6158 }
6159 
6160 
6161 
6162 /*--------------------- Inline functions: FEValues --------------------------*/
6163 
6164 
6165 template <int dim, int spacedim>
6166 inline const Quadrature<dim> &
6168 {
6169  return quadrature;
6170 }
6171 
6172 
6173 
6174 template <int dim, int spacedim>
6175 inline const FEValues<dim, spacedim> &
6177 {
6178  return *this;
6179 }
6180 
6181 
6182 /*---------------------- Inline functions: FEFaceValuesBase -----------------*/
6183 
6184 
6185 template <int dim, int spacedim>
6186 inline unsigned int
6188 {
6189  return present_face_no;
6190 }
6191 
6192 
6193 template <int dim, int spacedim>
6194 inline unsigned int
6196 {
6197  return present_face_index;
6198 }
6199 
6200 
6201 /*----------------------- Inline functions: FE*FaceValues -------------------*/
6202 
6203 template <int dim, int spacedim>
6204 inline const Quadrature<dim - 1> &
6206 {
6207  return quadrature[quadrature.size() == 1 ? 0 : present_face_no];
6208 }
6209 
6210 
6211 
6212 template <int dim, int spacedim>
6213 inline const FEFaceValues<dim, spacedim> &
6215 {
6216  return *this;
6217 }
6218 
6219 
6220 
6221 template <int dim, int spacedim>
6222 inline const FESubfaceValues<dim, spacedim> &
6224 {
6225  return *this;
6226 }
6227 
6228 
6229 
6230 template <int dim, int spacedim>
6231 inline const Tensor<1, spacedim> &
6232 FEFaceValuesBase<dim, spacedim>::boundary_form(const unsigned int q_point) const
6233 {
6234  AssertIndexRange(q_point, this->mapping_output.boundary_forms.size());
6235  Assert(this->update_flags & update_boundary_forms,
6237  "update_boundary_forms")));
6238 
6239  return this->mapping_output.boundary_forms[q_point];
6240 }
6241 
6242 #endif // DOXYGEN
6243 
6245 
6246 #endif
unsigned int get_face_index() const
unsigned int present_face_no
Definition: fe_values.h:4269
const Tensor< 1, spacedim > & boundary_form(const unsigned int q_point) const
const Quadrature< dim - 1 > & get_quadrature() const
unsigned int present_face_index
Definition: fe_values.h:4275
unsigned int get_face_number() const
const hp::QCollection< dim - 1 > quadrature
Definition: fe_values.h:4280
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access >> &cell, const unsigned int face_no)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access >> &cell, const typename Triangulation< dim, spacedim >::face_iterator &face)
const FEFaceValues< dim, spacedim > & get_present_fe_values() const
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access >> &cell, const unsigned int face_no, const unsigned int subface_no)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access >> &cell, const typename Triangulation< dim, spacedim >::face_iterator &face, const typename Triangulation< dim, spacedim >::face_iterator &subface)
const FESubfaceValues< dim, spacedim > & get_present_fe_values() const
CellIteratorContainer(const TriaIterator< DoFCellAccessor< dim, spacedim, lda >> &cell)
const DoFHandler< dim, spacedim > * dof_handler
Definition: fe_values.h:3882
Triangulation< dim, spacedim >::cell_iterator cell
Definition: fe_values.h:3881
CellSimilarity::Similarity cell_similarity
Definition: fe_values.h:3999
const double & shape_value(const unsigned int i, const unsigned int q_point) const
Tensor< 2, spacedim > shape_hessian_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
const Tensor< 4, spacedim > & jacobian_pushed_forward_2nd_derivative(const unsigned int q_point) const
CellIteratorContainer present_cell
Definition: fe_values.h:3891
const Tensor< 2, spacedim > & shape_hessian(const unsigned int i, const unsigned int q_point) const
const Point< spacedim > & quadrature_point(const unsigned int q_point) const
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
Definition: fe_values.h:4014
FEValuesBase(const FEValuesBase &)=delete
const DerivativeForm< 1, spacedim, dim > & inverse_jacobian(const unsigned int q_point) const
boost::signals2::connection tria_listener_mesh_transform
Definition: fe_values.h:3909
const Tensor< 3, spacedim > & shape_3rd_derivative(const unsigned int i, const unsigned int q_point) const
const Tensor< 1, spacedim > & normal_vector(const unsigned int q_point) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices_ending_at(const unsigned int end_dof_index) const
const FEValuesViews::Vector< dim, spacedim > & operator[](const FEValuesExtractors::Vector &vector) const
internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > mapping_output
Definition: fe_values.h:3951
const Tensor< 3, spacedim > & jacobian_pushed_forward_grad(const unsigned int q_point) const
const std::vector< DerivativeForm< 1, spacedim, dim > > & get_inverse_jacobians() const
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
Definition: fe_values.h:3936
UpdateFlags get_update_flags() const
const std::vector< Tensor< 3, spacedim > > & get_jacobian_pushed_forward_grads() const
const unsigned int dofs_per_cell
Definition: fe_values.h:2451
Tensor< 3, spacedim > shape_3rd_derivative_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
UpdateFlags update_flags
Definition: fe_values.h:3981
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
Definition: fe_values.h:3959
const DerivativeForm< 1, dim, spacedim > & jacobian(const unsigned int q_point) const
const std::vector< double > & get_JxW_values() const
const FEValuesViews::Scalar< dim, spacedim > & operator[](const FEValuesExtractors::Scalar &scalar) const
const DerivativeForm< 2, dim, spacedim > & jacobian_grad(const unsigned int q_point) const
double shape_value_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices_starting_at(const unsigned int start_dof_index) const
FEValuesBase & operator=(const FEValuesBase &)=delete
const unsigned int n_quadrature_points
Definition: fe_values.h:2433
const Tensor< 1, spacedim > & shape_grad(const unsigned int i, const unsigned int q_point) const
const FEValuesViews::SymmetricTensor< 2, dim, spacedim > & operator[](const FEValuesExtractors::SymmetricTensor< 2 > &tensor) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
const std::vector< DerivativeForm< 2, dim, spacedim > > & get_jacobian_grads() const
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > mapping_data
Definition: fe_values.h:3944
boost::signals2::connection tria_listener_refinement
Definition: fe_values.h:3900
const std::vector< DerivativeForm< 3, dim, spacedim > > & get_jacobian_2nd_derivatives() const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > quadrature_point_indices() const
const DerivativeForm< 4, dim, spacedim > & jacobian_3rd_derivative(const unsigned int q_point) const
const std::vector< Tensor< 4, spacedim > > & get_jacobian_pushed_forward_2nd_derivatives() const
const std::vector< DerivativeForm< 1, dim, spacedim > > & get_jacobians() const
::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > finite_element_output
Definition: fe_values.h:3975
const Tensor< 5, spacedim > & jacobian_pushed_forward_3rd_derivative(const unsigned int q_point) const
const DerivativeForm< 3, dim, spacedim > & jacobian_2nd_derivative(const unsigned int q_point) const
Tensor< 1, spacedim > shape_grad_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
const Mapping< dim, spacedim > & get_mapping() const
const std::vector< Tensor< 5, spacedim > > & get_jacobian_pushed_forward_3rd_derivatives() const
const FiniteElement< dim, spacedim > & get_fe() const
const std::vector< DerivativeForm< 4, dim, spacedim > > & get_jacobian_3rd_derivatives() const
const std::vector< Point< spacedim > > & get_quadrature_points() const
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
Definition: fe_values.h:3967
double JxW(const unsigned int q_point) const
const FEValuesViews::Tensor< 2, dim, spacedim > & operator[](const FEValuesExtractors::Tensor< 2 > &tensor) const
const unsigned int max_n_quadrature_points
Definition: fe_values.h:2444
typename ProductType< Number, hessian_type >::type solution_hessian_type
Definition: fe_values.h:215
value_type value(const unsigned int shape_function, const unsigned int q_point) const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type >> &values) const
Definition: fe_values.cc:1576
void get_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type >> &values) const
Definition: fe_values.cc:1545
const unsigned int component
Definition: fe_values.h:635
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type >> &gradients) const
Definition: fe_values.cc:1630
void get_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type >> &third_derivatives) const
Definition: fe_values.cc:1762
gradient_type gradient(const unsigned int shape_function, const unsigned int q_point) const
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:640
::Tensor< 1, spacedim > gradient_type
Definition: fe_values.h:162
typename ProductType< Number, value_type >::type solution_laplacian_type
Definition: fe_values.h:205
third_derivative_type third_derivative(const unsigned int shape_function, const unsigned int q_point) const
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
Definition: fe_values.h:225
void get_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type >> &gradients) const
Definition: fe_values.cc:1600
typename ProductType< Number, value_type >::type solution_value_type
Definition: fe_values.h:185
::Tensor< 2, spacedim > hessian_type
Definition: fe_values.h:169
typename ProductType< Number, gradient_type >::type solution_gradient_type
Definition: fe_values.h:195
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_hessian_type< typename InputVector::value_type >> &hessians) const
Definition: fe_values.cc:1684
Scalar & operator=(const Scalar< dim, spacedim > &)=delete
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:629
Scalar(Scalar< dim, spacedim > &&)=default
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_laplacian_type< typename InputVector::value_type >> &laplacians) const
Definition: fe_values.cc:1738
Scalar(const Scalar< dim, spacedim > &)=delete
void get_function_laplacians(const InputVector &fe_function, std::vector< solution_laplacian_type< typename InputVector::value_type >> &laplacians) const
Definition: fe_values.cc:1708
void get_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type >> &hessians) const
Definition: fe_values.cc:1654
hessian_type hessian(const unsigned int shape_function, const unsigned int q_point) const
Scalar & operator=(Scalar< dim, spacedim > &&) noexcept=default
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type >> &third_derivatives) const
Definition: fe_values.cc:1793
::Tensor< 3, spacedim > third_derivative_type
Definition: fe_values.h:176
SymmetricTensor(const SymmetricTensor< 2, dim, spacedim > &)=delete
SymmetricTensor(SymmetricTensor< 2, dim, spacedim > &&)=default
SymmetricTensor & operator=(const SymmetricTensor< 2, dim, spacedim > &)=delete
SymmetricTensor & operator=(SymmetricTensor< 2, dim, spacedim > &&) noexcept=default
typename ProductType< Number, value_type >::type solution_value_type
Definition: fe_values.h:1506
typename ProductType< Number, divergence_type >::type solution_divergence_type
Definition: fe_values.h:1516
typename ProductType< Number, value_type >::type solution_value_type
Definition: fe_values.h:1842
typename ProductType< Number, divergence_type >::type solution_divergence_type
Definition: fe_values.h:1852
typename ProductType< Number, gradient_type >::type solution_gradient_type
Definition: fe_values.h:1862
divergence_type divergence(const unsigned int shape_function, const unsigned int q_point) const
Tensor(const Tensor< 2, dim, spacedim > &)=delete
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:2190
value_type value(const unsigned int shape_function, const unsigned int q_point) const
gradient_type gradient(const unsigned int shape_function, const unsigned int q_point) const
Tensor(Tensor< 2, dim, spacedim > &&)=default
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:2201
Tensor & operator=(const Tensor< 2, dim, spacedim > &)=delete
Tensor & operator=(Tensor< 2, dim, spacedim > &&)=default
Vector & operator=(Vector< dim, spacedim > &&)=default
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
Definition: fe_values.h:812
typename ProductType< Number, divergence_type >::type solution_divergence_type
Definition: fe_values.h:773
Vector(const Vector< dim, spacedim > &)=delete
hessian_type hessian(const unsigned int shape_function, const unsigned int q_point) const
typename ProductType< Number, hessian_type >::type solution_hessian_type
Definition: fe_values.h:802
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:1436
Vector & operator=(const Vector< dim, spacedim > &)=delete
typename ProductType< Number, symmetric_gradient_type >::type solution_symmetric_gradient_type
Definition: fe_values.h:763
gradient_type gradient(const unsigned int shape_function, const unsigned int q_point) const
divergence_type divergence(const unsigned int shape_function, const unsigned int q_point) const
third_derivative_type third_derivative(const unsigned int shape_function, const unsigned int q_point) const
typename ProductType< Number, gradient_type >::type solution_gradient_type
Definition: fe_values.h:753
typename ProductType< Number, value_type >::type solution_value_type
Definition: fe_values.h:743
symmetric_gradient_type symmetric_gradient(const unsigned int shape_function, const unsigned int q_point) const
Vector(Vector< dim, spacedim > &&)=default
typename ::internal::CurlType< spacedim >::type curl_type
Definition: fe_values.h:720
const unsigned int first_vector_component
Definition: fe_values.h:1442
typename ProductType< Number, curl_type >::type solution_curl_type
Definition: fe_values.h:792
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:1447
value_type value(const unsigned int shape_function, const unsigned int q_point) const
curl_type curl(const unsigned int shape_function, const unsigned int q_point) const
typename ProductType< Number, value_type >::type solution_laplacian_type
Definition: fe_values.h:783
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access >> &cell)
const Quadrature< dim > quadrature
Definition: fe_values.h:4150
const FEValues< dim, spacedim > & get_present_fe_values() const
const Quadrature< dim > & get_quadrature() const
Definition: tensor.h:516
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
typename Tensor< rank_ - 1, dim, Number >::tensor_type value_type
Definition: tensor.h:549
Definition: vector.h:109
#define DEAL_II_DEPRECATED
Definition: config.h:174
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:474
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:475
#define DeclException0(Exception0)
Definition: exceptions.h:465
static ::ExceptionBase & ExcAccessToUninitializedField()
static ::ExceptionBase & ExcInternalError()
#define Assert(cond, exc)
Definition: exceptions.h:1614
static ::ExceptionBase & ExcNotImplemented()
#define AssertIndexRange(index, range)
Definition: exceptions.h:1855
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:488
static ::ExceptionBase & ExcFENotPrimitive()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:510
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
Definition: tria.h:1371
UpdateFlags
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_jacobian_pushed_forward_grads
@ update_hessians
Second derivatives of shape functions.
@ update_jacobian_3rd_derivatives
@ update_values
Shape function values.
@ update_jacobian_grads
Gradient of volume element.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_JxW_values
Transformed quadrature weights.
@ update_jacobians
Volume element.
@ update_inverse_jacobians
Volume element.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
@ update_jacobian_pushed_forward_3rd_derivatives
@ update_boundary_forms
Outer normal vector, not normalized.
@ update_jacobian_2nd_derivatives
typename ::internal::FEValuesViews::ViewType< dim, spacedim, Extractor >::type View
Definition: fe_values.h:2309
static const char U
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
Definition: matrix_block.h:618
boost::integer_range< IncrementableType > iota_view
Definition: iota_view.h:46
unsigned int global_dof_index
Definition: types.h:82
typename ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type laplacian_type
Definition: fe_values.h:258
typename ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:242
typename ProductType< Number, typename Scalar< dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:250
typename ProductType< Number, typename Scalar< dim, spacedim >::hessian_type >::type hessian_type
Definition: fe_values.h:266
typename ProductType< Number, typename Scalar< dim, spacedim >::third_derivative_type >::type third_derivative_type
Definition: fe_values.h:274
typename ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:1542
typename ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:1534
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:1896
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:1880
typename ProductType< Number, typename Tensor< 2, dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:1888
typename ProductType< Number, typename Vector< dim, spacedim >::third_derivative_type >::type third_derivative_type
Definition: fe_values.h:885
typename ProductType< Number, typename Vector< dim, spacedim >::value_type >::type laplacian_type
Definition: fe_values.h:861
typename ProductType< Number, typename Vector< dim, spacedim >::hessian_type >::type hessian_type
Definition: fe_values.h:877
typename ProductType< Number, typename Vector< dim, spacedim >::symmetric_gradient_type >::type symmetric_gradient_type
Definition: fe_values.h:845
typename ProductType< Number, typename Vector< dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:837
typename ProductType< Number, typename Vector< dim, spacedim >::curl_type >::type curl_type
Definition: fe_values.h:869
typename ProductType< Number, typename Vector< dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:853
typename ProductType< Number, typename Vector< dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:829
typename internal::ProductTypeImpl< typename std::decay< T >::type, typename std::decay< U >::type >::type type
std::vector<::FEValuesViews::Scalar< dim, spacedim > > scalars
Definition: fe_values.h:2286
std::vector<::FEValuesViews::Vector< dim, spacedim > > vectors
Definition: fe_values.h:2287
std::vector<::FEValuesViews::SymmetricTensor< 2, dim, spacedim > > symmetric_second_order_tensors
Definition: fe_values.h:2289
std::vector<::FEValuesViews::Tensor< 2, dim, spacedim > > second_order_tensors
Definition: fe_values.h:2291
typename ::FEValuesViews::SymmetricTensor< rank, dim, spacedim > type
Definition: fe_values.h:2269
typename ::FEValuesViews::Tensor< rank, dim, spacedim > type
Definition: fe_values.h:2255
constexpr DEAL_II_HOST SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)