Reference documentation for deal.II version 9.0.0
fe_values.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/exceptions.h>
22 #include <deal.II/base/subscriptor.h>
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/derivative_form.h>
26 #include <deal.II/base/vector_slice.h>
27 #include <deal.II/base/quadrature.h>
28 #include <deal.II/base/table.h>
29 #include <deal.II/grid/tria.h>
30 #include <deal.II/grid/tria_iterator.h>
31 #include <deal.II/dofs/dof_handler.h>
32 #include <deal.II/dofs/dof_accessor.h>
33 #include <deal.II/hp/dof_handler.h>
34 #include <deal.II/fe/fe.h>
35 #include <deal.II/fe/fe_update_flags.h>
36 #include <deal.II/fe/fe_values_extractors.h>
37 #include <deal.II/fe/mapping.h>
38 
39 #include <algorithm>
40 #include <memory>
41 #include <type_traits>
42 
43 
44 // dummy include in order to have the
45 // definition of PetscScalar available
46 // without including other PETSc stuff
47 #ifdef DEAL_II_WITH_PETSC
48 # include <petsc.h>
49 #endif
50 
51 DEAL_II_NAMESPACE_OPEN
52 
53 template <int dim, int spacedim=dim> class FEValuesBase;
54 
55 namespace internal
56 {
61  template <int dim, class NumberType=double>
62  struct CurlType;
63 
70  template <class NumberType>
71  struct CurlType<1, NumberType>
72  {
74  };
75 
82  template <class NumberType>
83  struct CurlType<2,NumberType>
84  {
86  };
87 
94  template <class NumberType>
95  struct CurlType<3,NumberType>
96  {
98  };
99 }
100 
101 
102 
103 
125 namespace FEValuesViews
126 {
138  template <int dim, int spacedim=dim>
139  class Scalar
140  {
141  public:
147  typedef double value_type;
148 
154  typedef ::Tensor<1,spacedim> gradient_type;
155 
161  typedef ::Tensor<2,spacedim> hessian_type;
162 
168  typedef ::Tensor<3,spacedim> third_derivative_type;
169 
174  template <typename Number>
175  struct OutputType
176  {
182 
188 
194 
200 
206  };
207 
213  {
223 
232  unsigned int row_index;
233  };
234 
238  Scalar ();
239 
245  Scalar (const FEValuesBase<dim,spacedim> &fe_values_base,
246  const unsigned int component);
247 
253 
267  value_type
268  value (const unsigned int shape_function,
269  const unsigned int q_point) const;
270 
282  gradient (const unsigned int shape_function,
283  const unsigned int q_point) const;
284 
296  hessian (const unsigned int shape_function,
297  const unsigned int q_point) const;
298 
310  third_derivative (const unsigned int shape_function,
311  const unsigned int q_point) const;
312 
330  template <class InputVector>
331  void get_function_values (const InputVector &fe_function,
332  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const;
333 
354  template <class InputVector>
355  void get_function_values_from_local_dof_values (const InputVector &dof_values,
356  std::vector<typename OutputType<typename InputVector::value_type>::value_type> &values) const;
357 
375  template <class InputVector>
376  void get_function_gradients (const InputVector &fe_function,
377  std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const;
378 
382  template <class InputVector>
383  void get_function_gradients_from_local_dof_values (const InputVector &dof_values,
384  std::vector<typename OutputType<typename InputVector::value_type>::gradient_type> &gradients) const;
385 
403  template <class InputVector>
404  void get_function_hessians (const InputVector &fe_function,
405  std::vector<typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians) const;
406 
410  template <class InputVector>
411  void get_function_hessians_from_local_dof_values (const InputVector &dof_values,
412  std::vector<typename OutputType<typename InputVector::value_type>::hessian_type> &hessians) const;
413 
414 
433  template <class InputVector>
434  void get_function_laplacians (const InputVector &fe_function,
435  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians) const;
436 
440  template <class InputVector>
441  void get_function_laplacians_from_local_dof_values (const InputVector &dof_values,
442  std::vector<typename OutputType<typename InputVector::value_type>::laplacian_type> &laplacians) const;
443 
444 
463  template <class InputVector>
464  void get_function_third_derivatives (const InputVector &fe_function,
465  std::vector<typename ProductType<third_derivative_type,
466  typename InputVector::value_type>::type> &third_derivatives) const;
467 
471  template <class InputVector>
472  void get_function_third_derivatives_from_local_dof_values (const InputVector &dof_values,
473  std::vector<typename OutputType<typename InputVector::value_type>::third_derivative_type> &third_derivatives) const;
474 
475 
476  private:
481 
486  const unsigned int component;
487 
491  std::vector<ShapeFunctionData> shape_function_data;
492  };
493 
494 
495 
525  template <int dim, int spacedim=dim>
526  class Vector
527  {
528  public:
534  typedef ::Tensor<1,spacedim> value_type;
535 
544  typedef ::Tensor<2,spacedim> gradient_type;
545 
556  typedef ::SymmetricTensor<2,spacedim> symmetric_gradient_type;
557 
563  typedef double divergence_type;
564 
571  typedef typename ::internal::CurlType<spacedim>::type curl_type;
572 
578  typedef ::Tensor<3,spacedim> hessian_type;
579 
585  typedef ::Tensor<4,spacedim> third_derivative_type;
586 
591  template <typename Number>
592  struct OutputType
593  {
599 
605 
611 
617 
623 
629 
635 
641  };
642 
648  {
658 
668  unsigned int row_index[spacedim];
669 
679  unsigned int single_nonzero_component_index;
680  };
681 
685  Vector ();
686 
695  Vector (const FEValuesBase<dim,spacedim> &fe_values_base,
696  const unsigned int first_vector_component);
697 
703 
720  value_type
721  value (const unsigned int shape_function,
722  const unsigned int q_point) const;
723 
738  gradient (const unsigned int shape_function,
739  const unsigned int q_point) const;
740 
757  symmetric_gradient (const unsigned int shape_function,
758  const unsigned int q_point) const;
759 
771  divergence (const unsigned int shape_function,
772  const unsigned int q_point) const;
773 
794  curl_type
795  curl (const unsigned int shape_function,
796  const unsigned int q_point) const;
797 
809  hessian (const unsigned int shape_function,
810  const unsigned int q_point) const;
811 
823  third_derivative (const unsigned int shape_function,
824  const unsigned int q_point) const;
825 
843  template <class InputVector>
844  void get_function_values (const InputVector &fe_function,
845  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const;
846 
867  template <class InputVector>
868  void get_function_values_from_local_dof_values (const InputVector &dof_values,
869  std::vector<typename OutputType<typename InputVector::value_type>::value_type> &values) const;
870 
888  template <class InputVector>
889  void get_function_gradients (const InputVector &fe_function,
890  std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const;
891 
895  template <class InputVector>
896  void get_function_gradients_from_local_dof_values (const InputVector &dof_values,
897  std::vector<typename OutputType<typename InputVector::value_type>::gradient_type> &gradients) const;
898 
922  template <class InputVector>
923  void
924  get_function_symmetric_gradients (const InputVector &fe_function,
925  std::vector<typename ProductType<symmetric_gradient_type,typename InputVector::value_type>::type> &symmetric_gradients) const;
926 
930  template <class InputVector>
931  void
932  get_function_symmetric_gradients_from_local_dof_values (const InputVector &dof_values,
933  std::vector<typename OutputType<typename InputVector::value_type>::symmetric_gradient_type> &symmetric_gradients) const;
934 
953  template <class InputVector>
954  void get_function_divergences (const InputVector &fe_function,
955  std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const;
956 
960  template <class InputVector>
961  void get_function_divergences_from_local_dof_values (const InputVector &dof_values,
962  std::vector<typename OutputType<typename InputVector::value_type>::divergence_type> &divergences) const;
963 
982  template <class InputVector>
983  void get_function_curls (const InputVector &fe_function,
984  std::vector<typename ProductType<curl_type,typename InputVector::value_type>::type> &curls) const;
985 
989  template <class InputVector>
990  void get_function_curls_from_local_dof_values (const InputVector &dof_values,
991  std::vector<typename OutputType<typename InputVector::value_type>::curl_type> &curls) const;
992 
1010  template <class InputVector>
1011  void get_function_hessians (const InputVector &fe_function,
1012  std::vector<typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians) const;
1013 
1017  template <class InputVector>
1018  void get_function_hessians_from_local_dof_values (const InputVector &dof_values,
1019  std::vector<typename OutputType<typename InputVector::value_type>::hessian_type> &hessians) const;
1020 
1039  template <class InputVector>
1040  void get_function_laplacians (const InputVector &fe_function,
1041  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians) const;
1042 
1046  template <class InputVector>
1047  void get_function_laplacians_from_local_dof_values (const InputVector &dof_values,
1048  std::vector<typename OutputType<typename InputVector::value_type>::laplacian_type> &laplacians) const;
1049 
1068  template <class InputVector>
1069  void get_function_third_derivatives (const InputVector &fe_function,
1070  std::vector<typename ProductType<third_derivative_type,
1071  typename InputVector::value_type>::type> &third_derivatives) const;
1072 
1076  template <class InputVector>
1077  void get_function_third_derivatives_from_local_dof_values (const InputVector &dof_values,
1078  std::vector<typename OutputType<typename InputVector::value_type>::third_derivative_type> &third_derivatives) const;
1079 
1080  private:
1085 
1090  const unsigned int first_vector_component;
1091 
1095  std::vector<ShapeFunctionData> shape_function_data;
1096  };
1097 
1098 
1099  template <int rank, int dim, int spacedim = dim>
1100  class SymmetricTensor;
1101 
1126  template <int dim, int spacedim>
1127  class SymmetricTensor<2,dim,spacedim>
1128  {
1129  public:
1136  typedef ::SymmetricTensor<2, spacedim> value_type;
1137 
1147  typedef ::Tensor<1, spacedim> divergence_type;
1148 
1153  template <typename Number>
1154  struct OutputType
1155  {
1161 
1167  };
1168 
1173  struct ShapeFunctionData
1174  {
1183  bool is_nonzero_shape_function_component[value_type::n_independent_components];
1184 
1194  unsigned int row_index[value_type::n_independent_components];
1195 
1205 
1210  };
1211 
1215  SymmetricTensor();
1216 
1226  SymmetricTensor(const FEValuesBase<dim, spacedim> &fe_values_base,
1227  const unsigned int first_tensor_component);
1228 
1233  SymmetricTensor &operator=(const SymmetricTensor<2, dim, spacedim> &);
1234 
1252  value_type
1253  value (const unsigned int shape_function,
1254  const unsigned int q_point) const;
1255 
1270  divergence (const unsigned int shape_function,
1271  const unsigned int q_point) const;
1272 
1290  template <class InputVector>
1291  void get_function_values (const InputVector &fe_function,
1292  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const;
1293 
1314  template <class InputVector>
1315  void get_function_values_from_local_dof_values (const InputVector &dof_values,
1316  std::vector<typename OutputType<typename InputVector::value_type>::value_type> &values) const;
1317 
1339  template <class InputVector>
1340  void get_function_divergences (const InputVector &fe_function,
1341  std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const;
1342 
1346  template <class InputVector>
1347  void get_function_divergences_from_local_dof_values (const InputVector &dof_values,
1348  std::vector<typename OutputType<typename InputVector::value_type>::divergence_type> &divergences) const;
1349 
1350  private:
1355 
1360  const unsigned int first_tensor_component;
1361 
1365  std::vector<ShapeFunctionData> shape_function_data;
1366  };
1367 
1368 
1369  template <int rank, int dim, int spacedim = dim>
1370  class Tensor;
1371 
1392  template <int dim, int spacedim>
1393  class Tensor<2,dim,spacedim>
1394  {
1395  public:
1396 
1401  typedef ::Tensor<2, spacedim> value_type;
1402 
1406  typedef ::Tensor<1, spacedim> divergence_type;
1407 
1411  typedef ::Tensor<3, spacedim> gradient_type;
1412 
1417  template <typename Number>
1418  struct OutputType
1419  {
1425 
1431 
1437  };
1438 
1443  struct ShapeFunctionData
1444  {
1453  bool is_nonzero_shape_function_component[value_type::n_independent_components];
1454 
1464  unsigned int row_index[value_type::n_independent_components];
1465 
1475 
1480  };
1481 
1485  Tensor();
1486 
1496  Tensor(const FEValuesBase<dim, spacedim> &fe_values_base,
1497  const unsigned int first_tensor_component);
1498 
1499 
1504  Tensor &operator=(const Tensor<2, dim, spacedim> &);
1505 
1522  value_type
1523  value (const unsigned int shape_function,
1524  const unsigned int q_point) const;
1525 
1540  divergence (const unsigned int shape_function,
1541  const unsigned int q_point) const;
1542 
1557  gradient (const unsigned int shape_function,
1558  const unsigned int q_point) const;
1559 
1577  template <class InputVector>
1578  void get_function_values (const InputVector &fe_function,
1579  std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &values) const;
1580 
1601  template <class InputVector>
1602  void get_function_values_from_local_dof_values (const InputVector &dof_values,
1603  std::vector<typename OutputType<typename InputVector::value_type>::value_type> &values) const;
1604 
1626  template <class InputVector>
1627  void get_function_divergences (const InputVector &fe_function,
1628  std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const;
1629 
1633  template <class InputVector>
1634  void get_function_divergences_from_local_dof_values (const InputVector &dof_values,
1635  std::vector<typename OutputType<typename InputVector::value_type>::divergence_type> &divergences) const;
1636 
1653  template <class InputVector>
1654  void get_function_gradients (const InputVector &fe_function,
1655  std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const;
1656 
1660  template <class InputVector>
1661  void get_function_gradients_from_local_dof_values (const InputVector &dof_values,
1662  std::vector<typename OutputType<typename InputVector::value_type>::gradient_type> &gradients) const;
1663 
1664  private:
1669 
1674  const unsigned int first_tensor_component;
1675 
1679  std::vector<ShapeFunctionData> shape_function_data;
1680  };
1681 
1682 }
1683 
1684 
1685 namespace internal
1686 {
1687  namespace FEValuesViews
1688  {
1696  template <int dim, int spacedim>
1697  struct Cache
1698  {
1703  std::vector<::FEValuesViews::Scalar<dim,spacedim> > scalars;
1704  std::vector<::FEValuesViews::Vector<dim,spacedim> > vectors;
1705  std::vector<::FEValuesViews::SymmetricTensor<2,dim,spacedim> >
1706  symmetric_second_order_tensors;
1707  std::vector<::FEValuesViews::Tensor<2,dim,spacedim> >
1708  second_order_tensors;
1709 
1713  Cache (const FEValuesBase<dim,spacedim> &fe_values);
1714  };
1715  }
1716 }
1717 
1718 
1719 
1822 template <int dim, int spacedim>
1823 class FEValuesBase :
1824  public Subscriptor
1825 {
1826 public:
1830  static const unsigned int dimension = dim;
1831 
1835  static const unsigned int space_dimension = spacedim;
1836 
1840  const unsigned int n_quadrature_points;
1841 
1847  const unsigned int dofs_per_cell;
1848 
1849 
1857  FEValuesBase (const unsigned int n_q_points,
1858  const unsigned int dofs_per_cell,
1859  const UpdateFlags update_flags,
1862 
1863 
1867  ~FEValuesBase ();
1868 
1869 
1871 
1872 
1893  const double &shape_value (const unsigned int function_no,
1894  const unsigned int point_no) const;
1895 
1916  double shape_value_component (const unsigned int function_no,
1917  const unsigned int point_no,
1918  const unsigned int component) const;
1919 
1945  const Tensor<1,spacedim> &
1946  shape_grad (const unsigned int function_no,
1947  const unsigned int quadrature_point) const;
1948 
1966  shape_grad_component (const unsigned int function_no,
1967  const unsigned int point_no,
1968  const unsigned int component) const;
1969 
1989  const Tensor<2,spacedim> &
1990  shape_hessian (const unsigned int function_no,
1991  const unsigned int point_no) const;
1992 
2010  shape_hessian_component (const unsigned int function_no,
2011  const unsigned int point_no,
2012  const unsigned int component) const;
2013 
2033  const Tensor<3,spacedim> &
2034  shape_3rd_derivative (const unsigned int function_no,
2035  const unsigned int point_no) const;
2036 
2054  shape_3rd_derivative_component (const unsigned int function_no,
2055  const unsigned int point_no,
2056  const unsigned int component) const;
2057 
2059 
2061 
2100  template <class InputVector>
2101  void get_function_values (const InputVector &fe_function,
2102  std::vector<typename InputVector::value_type> &values) const;
2103 
2117  template <class InputVector>
2118  void get_function_values (const InputVector &fe_function,
2119  std::vector<Vector<typename InputVector::value_type> > &values) const;
2120 
2139  template <class InputVector>
2140  void get_function_values (const InputVector &fe_function,
2141  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2142  std::vector<typename InputVector::value_type> &values) const;
2143 
2165  template <class InputVector>
2166  void get_function_values (const InputVector &fe_function,
2167  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2168  std::vector<Vector<typename InputVector::value_type> > &values) const;
2169 
2170 
2201  template <class InputVector>
2202  void get_function_values (const InputVector &fe_function,
2203  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2204  VectorSlice<std::vector<std::vector<typename InputVector::value_type> > > values,
2205  const bool quadrature_points_fastest) const;
2206 
2208 
2210 
2249  template <class InputVector>
2250  void get_function_gradients (const InputVector &fe_function,
2251  std::vector<Tensor<1,spacedim,typename InputVector::value_type> > &gradients) const;
2252 
2269  template <class InputVector>
2270  void get_function_gradients (const InputVector &fe_function,
2271  std::vector<std::vector<Tensor<1,spacedim,typename InputVector::value_type> > > &gradients) const;
2272 
2279  template <class InputVector>
2280  void get_function_gradients (const InputVector &fe_function,
2281  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2282  std::vector<Tensor<1,spacedim,typename InputVector::value_type> > &gradients) const;
2283 
2290  template <class InputVector>
2291  void get_function_gradients (const InputVector &fe_function,
2292  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2293  VectorSlice<std::vector<std::vector<Tensor<1,spacedim,typename InputVector::value_type> > > > gradients,
2294  bool quadrature_points_fastest = false) const;
2295 
2297 
2299 
2339  template <class InputVector>
2340  void
2341  get_function_hessians (const InputVector &fe_function,
2342  std::vector<Tensor<2,spacedim,typename InputVector::value_type> > &hessians) const;
2343 
2361  template <class InputVector>
2362  void
2363  get_function_hessians (const InputVector &fe_function,
2364  std::vector<std::vector<Tensor<2,spacedim,typename InputVector::value_type> > > &hessians,
2365  bool quadrature_points_fastest = false) const;
2366 
2371  template <class InputVector>
2372  void get_function_hessians (
2373  const InputVector &fe_function,
2374  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2375  std::vector<Tensor<2,spacedim,typename InputVector::value_type> > &hessians) const;
2376 
2383  template <class InputVector>
2384  void get_function_hessians (
2385  const InputVector &fe_function,
2386  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2387  VectorSlice<std::vector<std::vector<Tensor<2,spacedim,typename InputVector::value_type> > > > hessians,
2388  bool quadrature_points_fastest = false) const;
2389 
2432  template <class InputVector>
2433  void
2434  get_function_laplacians (const InputVector &fe_function,
2435  std::vector<typename InputVector::value_type> &laplacians) const;
2436 
2456  template <class InputVector>
2457  void
2458  get_function_laplacians (const InputVector &fe_function,
2459  std::vector<Vector<typename InputVector::value_type> > &laplacians) const;
2460 
2467  template <class InputVector>
2469  const InputVector &fe_function,
2470  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2471  std::vector<typename InputVector::value_type> &laplacians) const;
2472 
2479  template <class InputVector>
2481  const InputVector &fe_function,
2482  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2483  std::vector<Vector<typename InputVector::value_type> > &laplacians) const;
2484 
2491  template <class InputVector>
2493  const InputVector &fe_function,
2494  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2495  std::vector<std::vector<typename InputVector::value_type> > &laplacians,
2496  bool quadrature_points_fastest = false) const;
2497 
2499 
2501 
2542  template <class InputVector>
2543  void
2544  get_function_third_derivatives (const InputVector &fe_function,
2545  std::vector<Tensor<3,spacedim,typename InputVector::value_type> > &third_derivatives) const;
2546 
2565  template <class InputVector>
2566  void
2567  get_function_third_derivatives (const InputVector &fe_function,
2568  std::vector<std::vector<Tensor<3,spacedim,typename InputVector::value_type> > > &third_derivatives,
2569  bool quadrature_points_fastest = false) const;
2570 
2575  template <class InputVector>
2577  const InputVector &fe_function,
2578  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2579  std::vector<Tensor<3,spacedim,typename InputVector::value_type> > &third_derivatives) const;
2580 
2587  template <class InputVector>
2589  const InputVector &fe_function,
2590  const VectorSlice<const std::vector<types::global_dof_index> > &indices,
2591  VectorSlice<std::vector<std::vector<Tensor<3,spacedim,typename InputVector::value_type> > > > third_derivatives,
2592  bool quadrature_points_fastest = false) const;
2594 
2596 
2597 
2603  const Point<spacedim> &
2604  quadrature_point (const unsigned int q) const;
2605 
2611  const std::vector<Point<spacedim> > &get_quadrature_points () const;
2612 
2628  double JxW (const unsigned int quadrature_point) const;
2629 
2633  const std::vector<double> &get_JxW_values () const;
2634 
2641  const DerivativeForm<1,dim,spacedim> &jacobian (const unsigned int quadrature_point) const;
2642 
2649  const std::vector<DerivativeForm<1,dim,spacedim> > &get_jacobians () const;
2650 
2658  const DerivativeForm<2,dim,spacedim> &jacobian_grad (const unsigned int quadrature_point) const;
2659 
2666  const std::vector<DerivativeForm<2,dim,spacedim> > &get_jacobian_grads () const;
2667 
2676  const Tensor<3,spacedim> &jacobian_pushed_forward_grad (const unsigned int quadrature_point) const;
2677 
2684  const std::vector<Tensor<3,spacedim> > &get_jacobian_pushed_forward_grads () const;
2685 
2694 
2701  const std::vector<DerivativeForm<3,dim,spacedim> > &get_jacobian_2nd_derivatives () const;
2702 
2713 
2720  const std::vector<Tensor<4,spacedim> > &get_jacobian_pushed_forward_2nd_derivatives () const;
2721 
2731 
2738  const std::vector<DerivativeForm<4,dim,spacedim> > &get_jacobian_3rd_derivatives () const;
2739 
2750 
2757  const std::vector<Tensor<5,spacedim> > &get_jacobian_pushed_forward_3rd_derivatives () const;
2758 
2765  const DerivativeForm<1,spacedim,dim> &inverse_jacobian (const unsigned int quadrature_point) const;
2766 
2773  const std::vector<DerivativeForm<1,spacedim,dim> > &get_inverse_jacobians () const;
2774 
2788  const Tensor<1,spacedim> &normal_vector (const unsigned int i) const;
2789 
2800  DEAL_II_DEPRECATED
2801  const std::vector<Tensor<1,spacedim> > &get_all_normal_vectors () const;
2802 
2810  const std::vector<Tensor<1,spacedim> > &get_normal_vectors () const;
2811 
2813 
2815 
2816 
2826  operator[] (const FEValuesExtractors::Scalar &scalar) const;
2827 
2837  operator[] (const FEValuesExtractors::Vector &vector) const;
2838 
2850 
2851 
2861  operator[] (const FEValuesExtractors::Tensor<2> &tensor) const;
2862 
2864 
2866 
2867 
2871  const Mapping<dim,spacedim> &get_mapping () const;
2872 
2876  const FiniteElement<dim,spacedim> &get_fe () const;
2877 
2881  UpdateFlags get_update_flags () const;
2882 
2886  const typename Triangulation<dim,spacedim>::cell_iterator get_cell () const;
2887 
2894 
2899  std::size_t memory_consumption () const;
2901 
2902 
2910  char *,
2911  << "You are requesting information from an FEValues/FEFaceValues/FESubfaceValues "
2912  << "object for which this kind of information has not been computed. What "
2913  << "information these objects compute is determined by the update_* flags you "
2914  << "pass to the constructor. Here, the operation you are attempting requires "
2915  << "the <" << arg1 << "> flag to be set, but it was apparently not specified "
2916  << "upon construction.");
2917 
2924  "The FiniteElement you provided to FEValues and the FiniteElement that belongs "
2925  "to the DoFHandler that provided the cell iterator do not match.");
2932  int,
2933  << "The shape function with index " << arg1
2934  << " is not primitive, i.e. it is vector-valued and "
2935  << "has more than one non-zero vector component. This "
2936  << "function cannot be called for these shape functions. "
2937  << "Maybe you want to use the same function with the "
2938  << "_component suffix?");
2939 
2946  "The given FiniteElement is not a primitive element but the requested operation "
2947  "only works for those. See FiniteElement::is_primitive() for more information.");
2948 
2949 protected:
2978  class CellIteratorBase;
2979 
2984  template <typename CI> class CellIterator;
2986 
2992  std::unique_ptr<const CellIteratorBase> present_cell;
2993 
3001  boost::signals2::connection tria_listener_refinement;
3002 
3010  boost::signals2::connection tria_listener_mesh_transform;
3011 
3017  void invalidate_present_cell ();
3018 
3028  void
3030 
3035 
3041  std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase> mapping_data;
3042 
3048 
3049 
3055 
3061  std::unique_ptr<typename FiniteElement<dim,spacedim>::InternalDataBase> fe_data;
3062 
3068 
3069 
3074 
3084 
3091 
3097  void
3099 
3100 private:
3105  FEValuesBase (const FEValuesBase &);
3106 
3112 
3117 
3122  template <int, int> friend class FEValuesViews::Scalar;
3123  template <int, int> friend class FEValuesViews::Vector;
3124  template <int, int, int> friend class FEValuesViews::SymmetricTensor;
3125  template <int, int, int> friend class FEValuesViews::Tensor;
3126 };
3127 
3128 
3129 
3140 template <int dim, int spacedim=dim>
3141 class FEValues : public FEValuesBase<dim,spacedim>
3142 {
3143 public:
3148  static const unsigned int integral_dimension = dim;
3149 
3156  const Quadrature<dim> &quadrature,
3157  const UpdateFlags update_flags);
3158 
3165  const Quadrature<dim> &quadrature,
3166  const UpdateFlags update_flags);
3167 
3174  template <template <int, int> class DoFHandlerType, bool level_dof_access>
3175  void reinit (const TriaIterator<DoFCellAccessor<DoFHandlerType<dim,spacedim>,level_dof_access> > &cell);
3176 
3190  void reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell);
3191 
3196  const Quadrature<dim> &get_quadrature () const;
3197 
3202  std::size_t memory_consumption () const;
3203 
3219 
3220 private:
3225 
3229  void initialize (const UpdateFlags update_flags);
3230 
3237  void do_reinit ();
3238 };
3239 
3240 
3251 template <int dim, int spacedim=dim>
3252 class FEFaceValuesBase : public FEValuesBase<dim,spacedim>
3253 {
3254 public:
3259  static const unsigned int integral_dimension = dim-1;
3260 
3272  FEFaceValuesBase (const unsigned int n_q_points,
3273  const unsigned int dofs_per_cell,
3274  const UpdateFlags update_flags,
3277  const Quadrature<dim-1>& quadrature);
3278 
3286  const Tensor<1,spacedim> &boundary_form (const unsigned int i) const;
3287 
3294  const std::vector<Tensor<1,spacedim> > &get_boundary_forms () const;
3295 
3300  unsigned int get_face_index() const;
3301 
3306  const Quadrature<dim-1> & get_quadrature () const;
3307 
3312  std::size_t memory_consumption () const;
3313 
3314 protected:
3315 
3320  unsigned int present_face_index;
3321 
3325  const Quadrature<dim-1> quadrature;
3326 };
3327 
3328 
3329 
3344 template <int dim, int spacedim=dim>
3345 class FEFaceValues : public FEFaceValuesBase<dim,spacedim>
3346 {
3347 public:
3352  static const unsigned int dimension = dim;
3353 
3354  static const unsigned int space_dimension = spacedim;
3355 
3360  static const unsigned int integral_dimension = dim-1;
3361 
3369  const UpdateFlags update_flags);
3370 
3378  const UpdateFlags update_flags);
3379 
3384  template <template <int, int> class DoFHandlerType, bool level_dof_access>
3385  void reinit (const TriaIterator<DoFCellAccessor<DoFHandlerType<dim,spacedim>,level_dof_access> > &cell,
3386  const unsigned int face_no);
3387 
3401  void reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
3402  const unsigned int face_no);
3403 
3419 private:
3420 
3424  void initialize (const UpdateFlags update_flags);
3425 
3432  void do_reinit (const unsigned int face_no);
3433 };
3434 
3435 
3453 template <int dim, int spacedim=dim>
3454 class FESubfaceValues : public FEFaceValuesBase<dim,spacedim>
3455 {
3456 public:
3460  static const unsigned int dimension = dim;
3461 
3465  static const unsigned int space_dimension = spacedim;
3466 
3471  static const unsigned int integral_dimension = dim-1;
3472 
3479  const Quadrature<dim-1> &face_quadrature,
3480  const UpdateFlags update_flags);
3481 
3488  const Quadrature<dim-1> &face_quadrature,
3489  const UpdateFlags update_flags);
3490 
3497  template <template <int, int> class DoFHandlerType, bool level_dof_access>
3498  void reinit (const TriaIterator<DoFCellAccessor<DoFHandlerType<dim,spacedim>,level_dof_access> > &cell,
3499  const unsigned int face_no,
3500  const unsigned int subface_no);
3501 
3515  void reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
3516  const unsigned int face_no,
3517  const unsigned int subface_no);
3518 
3534 
3541 
3548 
3549 private:
3550 
3554  void initialize (const UpdateFlags update_flags);
3555 
3562  void do_reinit (const unsigned int face_no,
3563  const unsigned int subface_no);
3564 };
3565 
3566 
3567 #ifndef DOXYGEN
3568 
3569 
3570 /*------------------------ Inline functions: namespace FEValuesViews --------*/
3571 
3572 namespace FEValuesViews
3573 {
3574  template <int dim, int spacedim>
3575  inline
3577  Scalar<dim,spacedim>::value (const unsigned int shape_function,
3578  const unsigned int q_point) const
3579  {
3580  Assert (shape_function < fe_values->fe->dofs_per_cell,
3581  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3582  Assert (fe_values->update_flags & update_values,
3583  ((typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values"))));
3584 
3585  // an adaptation of the FEValuesBase::shape_value_component function
3586  // except that here we know the component as fixed and we have
3587  // pre-computed and cached a bunch of information. See the comments there.
3588  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
3589  return fe_values->finite_element_output.shape_values(shape_function_data[shape_function]
3590  .row_index,
3591  q_point);
3592  else
3593  return 0;
3594  }
3595 
3596 
3597 
3598  template <int dim, int spacedim>
3599  inline
3601  Scalar<dim,spacedim>::gradient (const unsigned int shape_function,
3602  const unsigned int q_point) const
3603  {
3604  Assert (shape_function < fe_values->fe->dofs_per_cell,
3605  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3606  Assert (fe_values->update_flags & update_gradients,
3607  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
3608 
3609  // an adaptation of the FEValuesBase::shape_grad_component
3610  // function except that here we know the component as fixed and we have
3611  // pre-computed and cached a bunch of information. See the comments there.
3612  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
3613  return fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function]
3614  .row_index][q_point];
3615  else
3616  return gradient_type();
3617  }
3618 
3619 
3620 
3621  template <int dim, int spacedim>
3622  inline
3624  Scalar<dim,spacedim>::hessian (const unsigned int shape_function,
3625  const unsigned int q_point) const
3626  {
3627  Assert (shape_function < fe_values->fe->dofs_per_cell,
3628  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3629  Assert (fe_values->update_flags & update_hessians,
3630  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
3631 
3632  // an adaptation of the FEValuesBase::shape_hessian_component
3633  // function except that here we know the component as fixed and we have
3634  // pre-computed and cached a bunch of information. See the comments there.
3635  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
3636  return fe_values->finite_element_output.shape_hessians[shape_function_data[shape_function].row_index][q_point];
3637  else
3638  return hessian_type();
3639  }
3640 
3641 
3642 
3643  template <int dim, int spacedim>
3644  inline
3646  Scalar<dim,spacedim>::third_derivative (const unsigned int shape_function,
3647  const unsigned int q_point) const
3648  {
3649  Assert (shape_function < fe_values->fe->dofs_per_cell,
3650  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3651  Assert (fe_values->update_flags & update_3rd_derivatives,
3652  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_3rd_derivatives")));
3653 
3654  // an adaptation of the FEValuesBase::shape_3rdderivative_component
3655  // function except that here we know the component as fixed and we have
3656  // pre-computed and cached a bunch of information. See the comments there.
3657  if (shape_function_data[shape_function].is_nonzero_shape_function_component)
3658  return fe_values->finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index][q_point];
3659  else
3660  return third_derivative_type();
3661  }
3662 
3663 
3664 
3665  template <int dim, int spacedim>
3666  inline
3668  Vector<dim,spacedim>::value (const unsigned int shape_function,
3669  const unsigned int q_point) const
3670  {
3671  Assert (shape_function < fe_values->fe->dofs_per_cell,
3672  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3673  Assert (fe_values->update_flags & update_values,
3674  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
3675 
3676  // same as for the scalar case except that we have one more index
3677  const int snc = shape_function_data[shape_function].single_nonzero_component;
3678  if (snc == -2)
3679  return value_type();
3680  else if (snc != -1)
3681  {
3682  value_type return_value;
3683  return_value[shape_function_data[shape_function].single_nonzero_component_index]
3684  = fe_values->finite_element_output.shape_values(snc,q_point);
3685  return return_value;
3686  }
3687  else
3688  {
3689  value_type return_value;
3690  for (unsigned int d=0; d<dim; ++d)
3691  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3692  return_value[d]
3693  = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
3694 
3695  return return_value;
3696  }
3697  }
3698 
3699 
3700 
3701  template <int dim, int spacedim>
3702  inline
3704  Vector<dim,spacedim>::gradient (const unsigned int shape_function,
3705  const unsigned int q_point) const
3706  {
3707  Assert (shape_function < fe_values->fe->dofs_per_cell,
3708  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3709  Assert (fe_values->update_flags & update_gradients,
3710  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
3711 
3712  // same as for the scalar case except that we have one more index
3713  const int snc = shape_function_data[shape_function].single_nonzero_component;
3714  if (snc == -2)
3715  return gradient_type();
3716  else if (snc != -1)
3717  {
3718  gradient_type return_value;
3719  return_value[shape_function_data[shape_function].single_nonzero_component_index]
3720  = fe_values->finite_element_output.shape_gradients[snc][q_point];
3721  return return_value;
3722  }
3723  else
3724  {
3725  gradient_type return_value;
3726  for (unsigned int d=0; d<dim; ++d)
3727  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3728  return_value[d]
3729  = fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
3730 
3731  return return_value;
3732  }
3733  }
3734 
3735 
3736 
3737  template <int dim, int spacedim>
3738  inline
3740  Vector<dim,spacedim>::divergence (const unsigned int shape_function,
3741  const unsigned int q_point) const
3742  {
3743  // this function works like in the case above
3744  Assert (shape_function < fe_values->fe->dofs_per_cell,
3745  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3746  Assert (fe_values->update_flags & update_gradients,
3747  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
3748 
3749  // same as for the scalar case except that we have one more index
3750  const int snc = shape_function_data[shape_function].single_nonzero_component;
3751  if (snc == -2)
3752  return divergence_type();
3753  else if (snc != -1)
3754  return
3755  fe_values->finite_element_output.shape_gradients[snc][q_point][shape_function_data[shape_function].single_nonzero_component_index];
3756  else
3757  {
3758  divergence_type return_value = 0;
3759  for (unsigned int d=0; d<dim; ++d)
3760  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3761  return_value
3762  += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point][d];
3763 
3764  return return_value;
3765  }
3766  }
3767 
3768 
3769 
3770  template <int dim, int spacedim>
3771  inline
3773  Vector<dim,spacedim>::curl (const unsigned int shape_function, const unsigned int q_point) const
3774  {
3775  // this function works like in the case above
3776 
3777  Assert (shape_function < fe_values->fe->dofs_per_cell,
3778  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3779  Assert (fe_values->update_flags & update_gradients,
3780  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
3781  // same as for the scalar case except that we have one more index
3782  const int snc = shape_function_data[shape_function].single_nonzero_component;
3783 
3784  if (snc == -2)
3785  return curl_type ();
3786 
3787  else
3788  switch (dim)
3789  {
3790  case 1:
3791  {
3792  Assert (false, ExcMessage("Computing the curl in 1d is not a useful operation"));
3793  return curl_type ();
3794  }
3795 
3796  case 2:
3797  {
3798  if (snc != -1)
3799  {
3800  curl_type return_value;
3801 
3802  // the single nonzero component can only be zero or one in 2d
3803  if (shape_function_data[shape_function].single_nonzero_component_index == 0)
3804  return_value[0] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][1];
3805  else
3806  return_value[0] = fe_values->finite_element_output.shape_gradients[snc][q_point][0];
3807 
3808  return return_value;
3809  }
3810 
3811  else
3812  {
3813  curl_type return_value;
3814 
3815  return_value[0] = 0.0;
3816 
3817  if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
3818  return_value[0]
3819  -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
3820 
3821  if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
3822  return_value[0]
3823  += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
3824 
3825  return return_value;
3826  }
3827  }
3828 
3829  case 3:
3830  {
3831  if (snc != -1)
3832  {
3833  curl_type return_value;
3834 
3835  switch (shape_function_data[shape_function].single_nonzero_component_index)
3836  {
3837  case 0:
3838  {
3839  return_value[0] = 0;
3840  return_value[1] = fe_values->finite_element_output.shape_gradients[snc][q_point][2];
3841  return_value[2] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][1];
3842  return return_value;
3843  }
3844 
3845  case 1:
3846  {
3847  return_value[0] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][2];
3848  return_value[1] = 0;
3849  return_value[2] = fe_values->finite_element_output.shape_gradients[snc][q_point][0];
3850  return return_value;
3851  }
3852 
3853  default:
3854  {
3855  return_value[0] = fe_values->finite_element_output.shape_gradients[snc][q_point][1];
3856  return_value[1] = -1.0 * fe_values->finite_element_output.shape_gradients[snc][q_point][0];
3857  return_value[2] = 0;
3858  return return_value;
3859  }
3860  }
3861  }
3862 
3863  else
3864  {
3865  curl_type return_value;
3866 
3867  for (unsigned int i = 0; i < dim; ++i)
3868  return_value[i] = 0.0;
3869 
3870  if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
3871  {
3872  return_value[1]
3873  += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][2];
3874  return_value[2]
3875  -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[0]][q_point][1];
3876  }
3877 
3878  if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
3879  {
3880  return_value[0]
3881  -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][2];
3882  return_value[2]
3883  += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[1]][q_point][0];
3884  }
3885 
3886  if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
3887  {
3888  return_value[0]
3889  += fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][1];
3890  return_value[1]
3891  -= fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[2]][q_point][0];
3892  }
3893 
3894  return return_value;
3895  }
3896  }
3897  }
3898  // should not end up here
3899  Assert (false, ExcInternalError());
3900  return curl_type();
3901  }
3902 
3903 
3904 
3905  template <int dim, int spacedim>
3906  inline
3908  Vector<dim,spacedim>::hessian (const unsigned int shape_function,
3909  const unsigned int q_point) const
3910  {
3911  // this function works like in the case above
3912  Assert (shape_function < fe_values->fe->dofs_per_cell,
3913  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3914  Assert (fe_values->update_flags & update_hessians,
3915  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
3916 
3917  // same as for the scalar case except that we have one more index
3918  const int snc = shape_function_data[shape_function].single_nonzero_component;
3919  if (snc == -2)
3920  return hessian_type();
3921  else if (snc != -1)
3922  {
3923  hessian_type return_value;
3924  return_value[shape_function_data[shape_function].single_nonzero_component_index]
3925  = fe_values->finite_element_output.shape_hessians[snc][q_point];
3926  return return_value;
3927  }
3928  else
3929  {
3930  hessian_type return_value;
3931  for (unsigned int d=0; d<dim; ++d)
3932  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3933  return_value[d]
3934  = fe_values->finite_element_output.shape_hessians[shape_function_data[shape_function].row_index[d]][q_point];
3935 
3936  return return_value;
3937  }
3938  }
3939 
3940 
3941 
3942  template <int dim, int spacedim>
3943  inline
3945  Vector<dim,spacedim>::third_derivative (const unsigned int shape_function,
3946  const unsigned int q_point) const
3947  {
3948  // this function works like in the case above
3949  Assert (shape_function < fe_values->fe->dofs_per_cell,
3950  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
3951  Assert (fe_values->update_flags & update_3rd_derivatives,
3952  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_3rd_derivatives")));
3953 
3954  // same as for the scalar case except that we have one more index
3955  const int snc = shape_function_data[shape_function].single_nonzero_component;
3956  if (snc == -2)
3957  return third_derivative_type();
3958  else if (snc != -1)
3959  {
3960  third_derivative_type return_value;
3961  return_value[shape_function_data[shape_function].single_nonzero_component_index]
3962  = fe_values->finite_element_output.shape_3rd_derivatives[snc][q_point];
3963  return return_value;
3964  }
3965  else
3966  {
3967  third_derivative_type return_value;
3968  for (unsigned int d=0; d<dim; ++d)
3969  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
3970  return_value[d]
3971  = fe_values->finite_element_output.shape_3rd_derivatives[shape_function_data[shape_function].row_index[d]][q_point];
3972 
3973  return return_value;
3974  }
3975  }
3976 
3977 
3978 
3979  namespace
3980  {
3985  inline
3986  ::SymmetricTensor<2,1>
3987  symmetrize_single_row (const unsigned int n,
3988  const ::Tensor<1,1> &t)
3989  {
3990  Assert (n < 1, ExcIndexRange (n, 0, 1));
3991  (void)n;
3992 
3993  const double array[1] = { t[0] };
3994  return ::SymmetricTensor<2,1>(array);
3995  }
3996 
3997 
3998 
3999  inline
4000  ::SymmetricTensor<2,2>
4001  symmetrize_single_row (const unsigned int n,
4002  const ::Tensor<1,2> &t)
4003  {
4004  switch (n)
4005  {
4006  case 0:
4007  {
4008  const double array[3] = { t[0], 0, t[1]/2 };
4009  return ::SymmetricTensor<2,2>(array);
4010  }
4011  case 1:
4012  {
4013  const double array[3] = { 0, t[1], t[0]/2 };
4014  return ::SymmetricTensor<2,2>(array);
4015  }
4016  default:
4017  {
4018  Assert (false, ExcIndexRange (n, 0, 2));
4019  return ::SymmetricTensor<2,2>();
4020  }
4021  }
4022  }
4023 
4024 
4025 
4026  inline
4027  ::SymmetricTensor<2,3>
4028  symmetrize_single_row (const unsigned int n,
4029  const ::Tensor<1,3> &t)
4030  {
4031  switch (n)
4032  {
4033  case 0:
4034  {
4035  const double array[6] = { t[0], 0, 0, t[1]/2, t[2]/2, 0 };
4036  return ::SymmetricTensor<2,3>(array);
4037  }
4038  case 1:
4039  {
4040  const double array[6] = { 0, t[1], 0, t[0]/2, 0, t[2]/2 };
4041  return ::SymmetricTensor<2,3>(array);
4042  }
4043  case 2:
4044  {
4045  const double array[6] = { 0, 0, t[2], 0, t[0]/2, t[1]/2 };
4046  return ::SymmetricTensor<2,3>(array);
4047  }
4048  default:
4049  {
4050  Assert (false, ExcIndexRange (n, 0, 3));
4051  return ::SymmetricTensor<2,3>();
4052  }
4053  }
4054  }
4055  }
4056 
4057 
4058 
4059  template <int dim, int spacedim>
4060  inline
4062  Vector<dim,spacedim>::symmetric_gradient (const unsigned int shape_function,
4063  const unsigned int q_point) const
4064  {
4065  Assert (shape_function < fe_values->fe->dofs_per_cell,
4066  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4067  Assert (fe_values->update_flags & update_gradients,
4068  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
4069 
4070  // same as for the scalar case except that we have one more index
4071  const int snc = shape_function_data[shape_function].single_nonzero_component;
4072  if (snc == -2)
4073  return symmetric_gradient_type();
4074  else if (snc != -1)
4075  return symmetrize_single_row (shape_function_data[shape_function].single_nonzero_component_index,
4076  fe_values->finite_element_output.shape_gradients[snc][q_point]);
4077  else
4078  {
4079  gradient_type return_value;
4080  for (unsigned int d=0; d<dim; ++d)
4081  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
4082  return_value[d]
4083  = fe_values->finite_element_output.shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
4084 
4085  return symmetrize(return_value);
4086  }
4087  }
4088 
4089 
4090 
4091  template <int dim, int spacedim>
4092  inline
4094  SymmetricTensor<2, dim, spacedim>::value (const unsigned int shape_function,
4095  const unsigned int q_point) const
4096  {
4097  Assert (shape_function < fe_values->fe->dofs_per_cell,
4098  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4099  Assert (fe_values->update_flags & update_values,
4100  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
4101 
4102  // similar to the vector case where we have more then one index and we need
4103  // to convert between unrolled and component indexing for tensors
4104  const int snc
4105  = shape_function_data[shape_function].single_nonzero_component;
4106 
4107  if (snc == -2)
4108  {
4109  // shape function is zero for the selected components
4110  return value_type();
4111 
4112  }
4113  else if (snc != -1)
4114  {
4115  value_type return_value;
4116  const unsigned int comp =
4117  shape_function_data[shape_function].single_nonzero_component_index;
4118  return_value[value_type::unrolled_to_component_indices(comp)]
4119  = fe_values->finite_element_output.shape_values(snc,q_point);
4120  return return_value;
4121  }
4122  else
4123  {
4124  value_type return_value;
4125  for (unsigned int d = 0; d < value_type::n_independent_components; ++d)
4126  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
4127  return_value[value_type::unrolled_to_component_indices(d)]
4128  = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
4129  return return_value;
4130  }
4131  }
4132 
4133 
4134 
4135  template <int dim, int spacedim>
4136  inline
4138  SymmetricTensor<2, dim, spacedim>::divergence(const unsigned int shape_function,
4139  const unsigned int q_point) const
4140  {
4141  Assert (shape_function < fe_values->fe->dofs_per_cell,
4142  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4143  Assert (fe_values->update_flags & update_gradients,
4144  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
4145 
4146  const int snc = shape_function_data[shape_function].single_nonzero_component;
4147 
4148  if (snc == -2)
4149  {
4150  // shape function is zero for the selected components
4151  return divergence_type();
4152  }
4153  else if (snc != -1)
4154  {
4155  // we have a single non-zero component when the symmetric tensor is
4156  // represented in unrolled form. this implies we potentially have
4157  // two non-zero components when represented in component form! we
4158  // will only have one non-zero entry if the non-zero component lies on
4159  // the diagonal of the tensor.
4160  //
4161  // the divergence of a second-order tensor is a first order tensor.
4162  //
4163  // assume the second-order tensor is A with components A_{ij}. then
4164  // A_{ij} = A_{ji} and there is only one (if diagonal) or two non-zero
4165  // entries in the tensorial representation. define the
4166  // divergence as:
4167  // b_i := \dfrac{\partial phi_{ij}}{\partial x_j}.
4168  // (which is incidentally also
4169  // b_j := \dfrac{\partial phi_{ij}}{\partial x_i}).
4170  // In both cases, a sum is implied.
4171  //
4172  // Now, we know the nonzero component in unrolled form: it is indicated
4173  // by 'snc'. we can figure out which tensor components belong to this:
4174  const unsigned int comp =
4175  shape_function_data[shape_function].single_nonzero_component_index;
4176  const unsigned int ii = value_type::unrolled_to_component_indices(comp)[0];
4177  const unsigned int jj = value_type::unrolled_to_component_indices(comp)[1];
4178 
4179  // given the form of the divergence above, if ii=jj there is only a
4180  // single nonzero component of the full tensor and the gradient
4181  // equals
4182  // b_ii := \dfrac{\partial phi_{ii,ii}}{\partial x_ii}.
4183  // all other entries of 'b' are zero
4184  //
4185  // on the other hand, if ii!=jj, then there are two nonzero entries in
4186  // the full tensor and
4187  // b_ii := \dfrac{\partial phi_{ii,jj}}{\partial x_ii}.
4188  // b_jj := \dfrac{\partial phi_{ii,jj}}{\partial x_jj}.
4189  // again, all other entries of 'b' are zero
4190  const ::Tensor<1, spacedim> &phi_grad = fe_values->finite_element_output.shape_gradients[snc][q_point];
4191 
4192  divergence_type return_value;
4193  return_value[ii] = phi_grad[jj];
4194 
4195  if (ii != jj)
4196  return_value[jj] = phi_grad[ii];
4197 
4198  return return_value;
4199 
4200  }
4201  else
4202  {
4203  Assert (false, ExcNotImplemented());
4204  divergence_type return_value;
4205  return return_value;
4206  }
4207  }
4208 
4209 
4210 
4211  template <int dim, int spacedim>
4212  inline
4214  Tensor<2, dim, spacedim>::value (const unsigned int shape_function,
4215  const unsigned int q_point) const
4216  {
4217  Assert (shape_function < fe_values->fe->dofs_per_cell,
4218  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4219  Assert (fe_values->update_flags & update_values,
4220  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_values")));
4221 
4222  // similar to the vector case where we have more then one index and we need
4223  // to convert between unrolled and component indexing for tensors
4224  const int snc
4225  = shape_function_data[shape_function].single_nonzero_component;
4226 
4227  if (snc == -2)
4228  {
4229  // shape function is zero for the selected components
4230  return value_type();
4231  }
4232  else if (snc != -1)
4233  {
4234  value_type return_value;
4235  const unsigned int comp =
4236  shape_function_data[shape_function].single_nonzero_component_index;
4238  return_value[indices] = fe_values->finite_element_output.shape_values(snc,q_point);
4239  return return_value;
4240  }
4241  else
4242  {
4243  value_type return_value;
4244  for (unsigned int d = 0; d < dim*dim; ++d)
4245  if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
4246  {
4248  return_value[indices]
4249  = fe_values->finite_element_output.shape_values(shape_function_data[shape_function].row_index[d],q_point);
4250  }
4251  return return_value;
4252  }
4253  }
4254 
4255 
4256 
4257  template <int dim, int spacedim>
4258  inline
4260  Tensor<2, dim, spacedim>::divergence(const unsigned int shape_function,
4261  const unsigned int q_point) const
4262  {
4263  Assert (shape_function < fe_values->fe->dofs_per_cell,
4264  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4265  Assert (fe_values->update_flags & update_gradients,
4266  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
4267 
4268  const int snc = shape_function_data[shape_function].single_nonzero_component;
4269 
4270  if (snc == -2)
4271  {
4272  // shape function is zero for the selected components
4273  return divergence_type();
4274  }
4275  else if (snc != -1)
4276  {
4277  // we have a single non-zero component when the tensor is
4278  // represented in unrolled form.
4279  //
4280  // the divergence of a second-order tensor is a first order tensor.
4281  //
4282  // assume the second-order tensor is A with components A_{ij},
4283  // then divergence is d_i := \frac{\partial A_{ij}}{\partial x_j}
4284  //
4285  // Now, we know the nonzero component in unrolled form: it is indicated
4286  // by 'snc'. we can figure out which tensor components belong to this:
4287  const unsigned int comp =
4288  shape_function_data[shape_function].single_nonzero_component_index;
4290  const unsigned int ii = indices[0];
4291  const unsigned int jj = indices[1];
4292 
4293  const ::Tensor<1, spacedim> &phi_grad = fe_values->finite_element_output.shape_gradients[snc][q_point];
4294 
4295  divergence_type return_value;
4296  // note that we contract \nabla from the right
4297  return_value[ii] = phi_grad[jj];
4298 
4299  return return_value;
4300  }
4301  else
4302  {
4303  Assert (false, ExcNotImplemented());
4304  divergence_type return_value;
4305  return return_value;
4306  }
4307  }
4308 
4309 
4310 
4311  template <int dim, int spacedim>
4312  inline
4314  Tensor<2, dim, spacedim>::gradient(const unsigned int shape_function,
4315  const unsigned int q_point) const
4316  {
4317  Assert (shape_function < fe_values->fe->dofs_per_cell,
4318  ExcIndexRange (shape_function, 0, fe_values->fe->dofs_per_cell));
4319  Assert (fe_values->update_flags & update_gradients,
4320  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
4321 
4322  const int snc = shape_function_data[shape_function].single_nonzero_component;
4323 
4324  if (snc == -2)
4325  {
4326  // shape function is zero for the selected components
4327  return gradient_type();
4328  }
4329  else if (snc != -1)
4330  {
4331  // we have a single non-zero component when the tensor is
4332  // represented in unrolled form.
4333  //
4334  // the gradient of a second-order tensor is a third order tensor.
4335  //
4336  // assume the second-order tensor is A with components A_{ij},
4337  // then gradient is B_{ijk} := \frac{\partial A_{ij}}{\partial x_k}
4338  //
4339  // Now, we know the nonzero component in unrolled form: it is indicated
4340  // by 'snc'. we can figure out which tensor components belong to this:
4341  const unsigned int comp =
4342  shape_function_data[shape_function].single_nonzero_component_index;
4344  const unsigned int ii = indices[0];
4345  const unsigned int jj = indices[1];
4346 
4347  const ::Tensor<1, spacedim> &phi_grad = fe_values->finite_element_output.shape_gradients[snc][q_point];
4348 
4349  gradient_type return_value;
4350  return_value[ii][jj] = phi_grad;
4351 
4352  return return_value;
4353  }
4354  else
4355  {
4356  Assert (false, ExcNotImplemented());
4357  gradient_type return_value;
4358  return return_value;
4359  }
4360  }
4361 
4362 }
4363 
4364 
4365 
4366 /*------------------------ Inline functions: FEValuesBase ------------------------*/
4367 
4368 
4369 
4370 template <int dim, int spacedim>
4371 inline
4374 operator[] (const FEValuesExtractors::Scalar &scalar) const
4375 {
4376  Assert (scalar.component < fe_values_views_cache.scalars.size(),
4377  ExcIndexRange (scalar.component,
4378  0, fe_values_views_cache.scalars.size()));
4379 
4380  return fe_values_views_cache.scalars[scalar.component];
4381 }
4382 
4383 
4384 
4385 template <int dim, int spacedim>
4386 inline
4389 operator[] (const FEValuesExtractors::Vector &vector) const
4390 {
4391  Assert (vector.first_vector_component <
4392  fe_values_views_cache.vectors.size(),
4394  0, fe_values_views_cache.vectors.size()));
4395 
4396  return fe_values_views_cache.vectors[vector.first_vector_component];
4397 }
4398 
4399 
4400 
4401 template <int dim, int spacedim>
4402 inline
4406 {
4407  Assert (tensor.first_tensor_component <
4408  fe_values_views_cache.symmetric_second_order_tensors.size(),
4410  0, fe_values_views_cache.symmetric_second_order_tensors.size()));
4411 
4412  return fe_values_views_cache.symmetric_second_order_tensors[tensor.first_tensor_component];
4413 }
4414 
4415 
4416 
4417 template <int dim, int spacedim>
4418 inline
4421 operator[] (const FEValuesExtractors::Tensor<2> &tensor) const
4422 {
4423  Assert (tensor.first_tensor_component <
4424  fe_values_views_cache.second_order_tensors.size(),
4426  0, fe_values_views_cache.second_order_tensors.size()));
4427 
4428  return fe_values_views_cache.second_order_tensors[tensor.first_tensor_component];
4429 }
4430 
4431 
4432 
4433 template <int dim, int spacedim>
4434 inline
4435 const double &
4436 FEValuesBase<dim,spacedim>::shape_value (const unsigned int i,
4437  const unsigned int j) const
4438 {
4439  Assert (i < fe->dofs_per_cell,
4440  ExcIndexRange (i, 0, fe->dofs_per_cell));
4441  Assert (this->update_flags & update_values,
4442  ExcAccessToUninitializedField("update_values"));
4443  Assert (fe->is_primitive (i),
4444  ExcShapeFunctionNotPrimitive(i));
4445  Assert (present_cell.get() != nullptr,
4446  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4447  // if the entire FE is primitive,
4448  // then we can take a short-cut:
4449  if (fe->is_primitive())
4450  return this->finite_element_output.shape_values(i,j);
4451  else
4452  {
4453  // otherwise, use the mapping
4454  // between shape function
4455  // numbers and rows. note that
4456  // by the assertions above, we
4457  // know that this particular
4458  // shape function is primitive,
4459  // so we can call
4460  // system_to_component_index
4461  const unsigned int
4462  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
4463  return this->finite_element_output.shape_values(row, j);
4464  }
4465 }
4466 
4467 
4468 
4469 template <int dim, int spacedim>
4470 inline
4471 double
4473  const unsigned int j,
4474  const unsigned int component) const
4475 {
4476  Assert (i < fe->dofs_per_cell,
4477  ExcIndexRange (i, 0, fe->dofs_per_cell));
4478  Assert (this->update_flags & update_values,
4479  ExcAccessToUninitializedField("update_values"));
4480  Assert (component < fe->n_components(),
4481  ExcIndexRange(component, 0, fe->n_components()));
4482  Assert (present_cell.get() != nullptr,
4483  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4484 
4485  // check whether the shape function
4486  // is non-zero at all within
4487  // this component:
4488  if (fe->get_nonzero_components(i)[component] == false)
4489  return 0;
4490 
4491  // look up the right row in the
4492  // table and take the data from
4493  // there
4494  const unsigned int
4495  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + component];
4496  return this->finite_element_output.shape_values(row, j);
4497 }
4498 
4499 
4500 
4501 template <int dim, int spacedim>
4502 inline
4503 const Tensor<1,spacedim> &
4504 FEValuesBase<dim,spacedim>::shape_grad (const unsigned int i,
4505  const unsigned int j) const
4506 {
4507  Assert (i < fe->dofs_per_cell,
4508  ExcIndexRange (i, 0, fe->dofs_per_cell));
4509  Assert (this->update_flags & update_gradients,
4510  ExcAccessToUninitializedField("update_gradients"));
4511  Assert (fe->is_primitive (i),
4512  ExcShapeFunctionNotPrimitive(i));
4513  Assert (present_cell.get() != nullptr,
4514  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4515  // if the entire FE is primitive,
4516  // then we can take a short-cut:
4517  if (fe->is_primitive())
4518  return this->finite_element_output.shape_gradients[i][j];
4519  else
4520  {
4521  // otherwise, use the mapping
4522  // between shape function
4523  // numbers and rows. note that
4524  // by the assertions above, we
4525  // know that this particular
4526  // shape function is primitive,
4527  // so we can call
4528  // system_to_component_index
4529  const unsigned int
4530  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
4531  return this->finite_element_output.shape_gradients[row][j];
4532  }
4533 }
4534 
4535 
4536 
4537 template <int dim, int spacedim>
4538 inline
4541  const unsigned int j,
4542  const unsigned int component) const
4543 {
4544  Assert (i < fe->dofs_per_cell,
4545  ExcIndexRange (i, 0, fe->dofs_per_cell));
4546  Assert (this->update_flags & update_gradients,
4547  ExcAccessToUninitializedField("update_gradients"));
4548  Assert (component < fe->n_components(),
4549  ExcIndexRange(component, 0, fe->n_components()));
4550  Assert (present_cell.get() != nullptr,
4551  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4552  // check whether the shape function
4553  // is non-zero at all within
4554  // this component:
4555  if (fe->get_nonzero_components(i)[component] == false)
4556  return Tensor<1,spacedim>();
4557 
4558  // look up the right row in the
4559  // table and take the data from
4560  // there
4561  const unsigned int
4562  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + component];
4563  return this->finite_element_output.shape_gradients[row][j];
4564 }
4565 
4566 
4567 
4568 template <int dim, int spacedim>
4569 inline
4570 const Tensor<2,spacedim> &
4571 FEValuesBase<dim,spacedim>::shape_hessian (const unsigned int i,
4572  const unsigned int j) const
4573 {
4574  Assert (i < fe->dofs_per_cell,
4575  ExcIndexRange (i, 0, fe->dofs_per_cell));
4576  Assert (this->update_flags & update_hessians,
4577  ExcAccessToUninitializedField("update_hessians"));
4578  Assert (fe->is_primitive (i),
4579  ExcShapeFunctionNotPrimitive(i));
4580  Assert (present_cell.get() != nullptr,
4581  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4582  // if the entire FE is primitive,
4583  // then we can take a short-cut:
4584  if (fe->is_primitive())
4585  return this->finite_element_output.shape_hessians[i][j];
4586  else
4587  {
4588  // otherwise, use the mapping
4589  // between shape function
4590  // numbers and rows. note that
4591  // by the assertions above, we
4592  // know that this particular
4593  // shape function is primitive,
4594  // so we can call
4595  // system_to_component_index
4596  const unsigned int
4597  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
4598  return this->finite_element_output.shape_hessians[row][j];
4599  }
4600 }
4601 
4602 
4603 
4604 template <int dim, int spacedim>
4605 inline
4608  const unsigned int j,
4609  const unsigned int component) const
4610 {
4611  Assert (i < fe->dofs_per_cell,
4612  ExcIndexRange (i, 0, fe->dofs_per_cell));
4613  Assert (this->update_flags & update_hessians,
4614  ExcAccessToUninitializedField("update_hessians"));
4615  Assert (component < fe->n_components(),
4616  ExcIndexRange(component, 0, fe->n_components()));
4617  Assert (present_cell.get() != nullptr,
4618  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4619  // check whether the shape function
4620  // is non-zero at all within
4621  // this component:
4622  if (fe->get_nonzero_components(i)[component] == false)
4623  return Tensor<2,spacedim>();
4624 
4625  // look up the right row in the
4626  // table and take the data from
4627  // there
4628  const unsigned int
4629  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + component];
4630  return this->finite_element_output.shape_hessians[row][j];
4631 }
4632 
4633 
4634 
4635 template <int dim, int spacedim>
4636 inline
4637 const Tensor<3,spacedim> &
4639  const unsigned int j) const
4640 {
4641  Assert (i < fe->dofs_per_cell,
4642  ExcIndexRange (i, 0, fe->dofs_per_cell));
4643  Assert (this->update_flags & update_hessians,
4644  ExcAccessToUninitializedField("update_3rd_derivatives"));
4645  Assert (fe->is_primitive (i),
4646  ExcShapeFunctionNotPrimitive(i));
4647  Assert (present_cell.get() != nullptr,
4648  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4649  // if the entire FE is primitive,
4650  // then we can take a short-cut:
4651  if (fe->is_primitive())
4652  return this->finite_element_output.shape_3rd_derivatives[i][j];
4653  else
4654  {
4655  // otherwise, use the mapping
4656  // between shape function
4657  // numbers and rows. note that
4658  // by the assertions above, we
4659  // know that this particular
4660  // shape function is primitive,
4661  // so we can call
4662  // system_to_component_index
4663  const unsigned int
4664  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first];
4665  return this->finite_element_output.shape_3rd_derivatives[row][j];
4666  }
4667 }
4668 
4669 
4670 
4671 template <int dim, int spacedim>
4672 inline
4675  const unsigned int j,
4676  const unsigned int component) const
4677 {
4678  Assert (i < fe->dofs_per_cell,
4679  ExcIndexRange (i, 0, fe->dofs_per_cell));
4680  Assert (this->update_flags & update_hessians,
4681  ExcAccessToUninitializedField("update_3rd_derivatives"));
4682  Assert (component < fe->n_components(),
4683  ExcIndexRange(component, 0, fe->n_components()));
4684  Assert (present_cell.get() != nullptr,
4685  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4686  // check whether the shape function
4687  // is non-zero at all within
4688  // this component:
4689  if (fe->get_nonzero_components(i)[component] == false)
4690  return Tensor<3,spacedim>();
4691 
4692  // look up the right row in the
4693  // table and take the data from
4694  // there
4695  const unsigned int
4696  row = this->finite_element_output.shape_function_to_row_table[i * fe->n_components() + component];
4697  return this->finite_element_output.shape_3rd_derivatives[row][j];
4698 }
4699 
4700 
4701 
4702 template <int dim, int spacedim>
4703 inline
4706 {
4707  return *fe;
4708 }
4709 
4710 
4711 
4712 template <int dim, int spacedim>
4713 inline
4714 const Mapping<dim,spacedim> &
4716 {
4717  return *mapping;
4718 }
4719 
4720 
4721 
4722 template <int dim, int spacedim>
4723 inline
4726 {
4727  return this->update_flags;
4728 }
4729 
4730 
4731 
4732 template <int dim, int spacedim>
4733 inline
4734 const std::vector<Point<spacedim> > &
4736 {
4737  Assert (this->update_flags & update_quadrature_points,
4738  ExcAccessToUninitializedField("update_quadrature_points"));
4739  Assert (present_cell.get() != nullptr,
4740  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4741  return this->mapping_output.quadrature_points;
4742 }
4743 
4744 
4745 
4746 template <int dim, int spacedim>
4747 inline
4748 const std::vector<double> &
4750 {
4751  Assert (this->update_flags & update_JxW_values,
4752  ExcAccessToUninitializedField("update_JxW_values"));
4753  Assert (present_cell.get() != nullptr,
4754  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4755  return this->mapping_output.JxW_values;
4756 }
4757 
4758 
4759 
4760 template <int dim, int spacedim>
4761 inline
4762 const std::vector<DerivativeForm<1,dim,spacedim> > &
4764 {
4765  Assert (this->update_flags & update_jacobians,
4766  ExcAccessToUninitializedField("update_jacobians"));
4767  Assert (present_cell.get() != nullptr,
4768  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4769  return this->mapping_output.jacobians;
4770 }
4771 
4772 
4773 
4774 template <int dim, int spacedim>
4775 inline
4776 const std::vector<DerivativeForm<2,dim,spacedim> > &
4778 {
4779  Assert (this->update_flags & update_jacobian_grads,
4780  ExcAccessToUninitializedField("update_jacobians_grads"));
4781  Assert (present_cell.get() != nullptr,
4782  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4783  return this->mapping_output.jacobian_grads;
4784 }
4785 
4786 
4787 
4788 template <int dim, int spacedim>
4789 inline
4790 const Tensor<3,spacedim> &
4792 {
4793  Assert (this->update_flags & update_jacobian_pushed_forward_grads,
4794  ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
4795  Assert (present_cell.get() != nullptr,
4796  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4797  return this->mapping_output.jacobian_pushed_forward_grads[i];
4798 }
4799 
4800 
4801 
4802 template <int dim, int spacedim>
4803 inline
4804 const std::vector<Tensor<3,spacedim> > &
4806 {
4807  Assert (this->update_flags & update_jacobian_pushed_forward_grads,
4808  ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
4809  Assert (present_cell.get() != nullptr,
4810  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4811  return this->mapping_output.jacobian_pushed_forward_grads;
4812 }
4813 
4814 
4815 
4816 template <int dim, int spacedim>
4817 inline
4819 FEValuesBase<dim,spacedim>::jacobian_2nd_derivative (const unsigned int i) const
4820 {
4821  Assert (this->update_flags & update_jacobian_2nd_derivatives,
4822  ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
4823  Assert (present_cell.get() != nullptr,
4824  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4825  return this->mapping_output.jacobian_2nd_derivatives[i];
4826 }
4827 
4828 
4829 
4830 template <int dim, int spacedim>
4831 inline
4832 const std::vector<DerivativeForm<3,dim,spacedim> > &
4834 {
4835  Assert (this->update_flags & update_jacobian_2nd_derivatives,
4836  ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
4837  Assert (present_cell.get() != nullptr,
4838  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4839  return this->mapping_output.jacobian_2nd_derivatives;
4840 }
4841 
4842 
4843 
4844 template <int dim, int spacedim>
4845 inline
4846 const Tensor<4,spacedim> &
4848 {
4850  ExcAccessToUninitializedField("update_jacobian_pushed_forward_2nd_derivatives"));
4851  Assert (present_cell.get() != nullptr,
4852  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4853  return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[i];
4854 }
4855 
4856 
4857 
4858 template <int dim, int spacedim>
4859 inline
4860 const std::vector<Tensor<4,spacedim> > &
4862 {
4864  ExcAccessToUninitializedField("update_jacobian_pushed_forward_2nd_derivatives"));
4865  Assert (present_cell.get() != nullptr,
4866  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4867  return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
4868 }
4869 
4870 
4871 
4872 template <int dim, int spacedim>
4873 inline
4875 FEValuesBase<dim,spacedim>::jacobian_3rd_derivative (const unsigned int i) const
4876 {
4877  Assert (this->update_flags & update_jacobian_3rd_derivatives,
4878  ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
4879  Assert (present_cell.get() != nullptr,
4880  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4881  return this->mapping_output.jacobian_3rd_derivatives[i];
4882 }
4883 
4884 
4885 
4886 template <int dim, int spacedim>
4887 inline
4888 const std::vector<DerivativeForm<4,dim,spacedim> > &
4890 {
4891  Assert (this->update_flags & update_jacobian_3rd_derivatives,
4892  ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
4893  Assert (present_cell.get() != nullptr,
4894  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4895  return this->mapping_output.jacobian_3rd_derivatives;
4896 }
4897 
4898 
4899 
4900 template <int dim, int spacedim>
4901 inline
4902 const Tensor<5,spacedim> &
4904 {
4906  ExcAccessToUninitializedField("update_jacobian_pushed_forward_3rd_derivatives"));
4907  Assert (present_cell.get() != nullptr,
4908  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4909  return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[i];
4910 }
4911 
4912 
4913 
4914 template <int dim, int spacedim>
4915 inline
4916 const std::vector<Tensor<5,spacedim> > &
4918 {
4920  ExcAccessToUninitializedField("update_jacobian_pushed_forward_3rd_derivatives"));
4921  Assert (present_cell.get() != nullptr,
4922  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4923  return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
4924 }
4925 
4926 
4927 
4928 template <int dim, int spacedim>
4929 inline
4930 const std::vector<DerivativeForm<1,spacedim,dim> > &
4932 {
4933  Assert (this->update_flags & update_inverse_jacobians,
4934  ExcAccessToUninitializedField("update_inverse_jacobians"));
4935  Assert (present_cell.get() != nullptr,
4936  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4937  return this->mapping_output.inverse_jacobians;
4938 }
4939 
4940 
4941 
4942 template <int dim, int spacedim>
4943 inline
4944 const Point<spacedim> &
4945 FEValuesBase<dim,spacedim>::quadrature_point (const unsigned int i) const
4946 {
4947  Assert (this->update_flags & update_quadrature_points,
4948  ExcAccessToUninitializedField("update_quadrature_points"));
4949  Assert (i<this->mapping_output.quadrature_points.size(),
4950  ExcIndexRange(i, 0, this->mapping_output.quadrature_points.size()));
4951  Assert (present_cell.get() != nullptr,
4952  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4953 
4954  return this->mapping_output.quadrature_points[i];
4955 }
4956 
4957 
4958 
4959 template <int dim, int spacedim>
4960 inline
4961 double
4962 FEValuesBase<dim,spacedim>::JxW (const unsigned int i) const
4963 {
4964  Assert (this->update_flags & update_JxW_values,
4965  ExcAccessToUninitializedField("update_JxW_values"));
4966  Assert (i<this->mapping_output.JxW_values.size(),
4967  ExcIndexRange(i, 0, this->mapping_output.JxW_values.size()));
4968  Assert (present_cell.get() != nullptr,
4969  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4970 
4971  return this->mapping_output.JxW_values[i];
4972 }
4973 
4974 
4975 
4976 template <int dim, int spacedim>
4977 inline
4979 FEValuesBase<dim,spacedim>::jacobian (const unsigned int i) const
4980 {
4981  Assert (this->update_flags & update_jacobians,
4982  ExcAccessToUninitializedField("update_jacobians"));
4983  Assert (i<this->mapping_output.jacobians.size(),
4984  ExcIndexRange(i, 0, this->mapping_output.jacobians.size()));
4985  Assert (present_cell.get() != nullptr,
4986  ExcMessage ("FEValues object is not reinit'ed to any cell"));
4987 
4988  return this->mapping_output.jacobians[i];
4989 }
4990 
4991 
4992 
4993 template <int dim, int spacedim>
4994 inline
4996 FEValuesBase<dim,spacedim>::jacobian_grad (const unsigned int i) const
4997 {
4998  Assert (this->update_flags & update_jacobian_grads,
4999  ExcAccessToUninitializedField("update_jacobians_grads"));
5000  Assert (i<this->mapping_output.jacobian_grads.size(),
5001  ExcIndexRange(i, 0, this->mapping_output.jacobian_grads.size()));
5002  Assert (present_cell.get() != nullptr,
5003  ExcMessage ("FEValues object is not reinit'ed to any cell"));
5004 
5005  return this->mapping_output.jacobian_grads[i];
5006 }
5007 
5008 
5009 
5010 template <int dim, int spacedim>
5011 inline
5013 FEValuesBase<dim,spacedim>::inverse_jacobian (const unsigned int i) const
5014 {
5015  Assert (this->update_flags & update_inverse_jacobians,
5016  ExcAccessToUninitializedField("update_inverse_jacobians"));
5017  Assert (i<this->mapping_output.inverse_jacobians.size(),
5018  ExcIndexRange(i, 0, this->mapping_output.inverse_jacobians.size()));
5019  Assert (present_cell.get() != nullptr,
5020  ExcMessage ("FEValues object is not reinit'ed to any cell"));
5021 
5022  return this->mapping_output.inverse_jacobians[i];
5023 }
5024 
5025 
5026 
5027 template <int dim, int spacedim>
5028 inline
5029 const Tensor<1,spacedim> &
5030 FEValuesBase<dim,spacedim>::normal_vector (const unsigned int i) const
5031 {
5032  Assert (this->update_flags & update_normal_vectors,
5033  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_normal_vectors")));
5034  Assert (i<this->mapping_output.normal_vectors.size(),
5035  ExcIndexRange(i, 0, this->mapping_output.normal_vectors.size()));
5036  Assert (present_cell.get() != nullptr,
5037  ExcMessage ("FEValues object is not reinit'ed to any cell"));
5038 
5039  return this->mapping_output.normal_vectors[i];
5040 }
5041 
5042 
5043 
5044 /*------------------------ Inline functions: FEValues ----------------------------*/
5045 
5046 
5047 template <int dim, int spacedim>
5048 inline
5049 const Quadrature<dim> &
5051 {
5052  return quadrature;
5053 }
5054 
5055 
5056 
5057 template <int dim, int spacedim>
5058 inline
5059 const FEValues<dim,spacedim> &
5061 {
5062  return *this;
5063 }
5064 
5065 
5066 /*------------------------ Inline functions: FEFaceValuesBase --------------------*/
5067 
5068 
5069 template <int dim, int spacedim>
5070 inline
5071 unsigned int
5073 {
5074  return present_face_index;
5075 }
5076 
5077 
5078 /*------------------------ Inline functions: FE*FaceValues --------------------*/
5079 
5080 template <int dim, int spacedim>
5081 inline
5082 const Quadrature<dim-1> &
5084 {
5085  return quadrature;
5086 }
5087 
5088 
5089 
5090 template <int dim, int spacedim>
5091 inline
5094 {
5095  return *this;
5096 }
5097 
5098 
5099 
5100 template <int dim, int spacedim>
5101 inline
5104 {
5105  return *this;
5106 }
5107 
5108 
5109 
5110 template <int dim, int spacedim>
5111 inline
5112 const Tensor<1,spacedim> &
5113 FEFaceValuesBase<dim,spacedim>::boundary_form (const unsigned int i) const
5114 {
5115  Assert (i<this->mapping_output.boundary_forms.size(),
5116  ExcIndexRange(i, 0, this->mapping_output.boundary_forms.size()));
5117  Assert (this->update_flags & update_boundary_forms,
5118  (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_boundary_forms")));
5119 
5120  return this->mapping_output.boundary_forms[i];
5121 }
5122 
5123 #endif // DOXYGEN
5124 
5125 DEAL_II_NAMESPACE_CLOSE
5126 
5127 #endif
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
Definition: fe_values.cc:1594
Transformed quadrature weights.
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
Definition: fe_values.cc:3329
Shape function values.
value_type value(const unsigned int shape_function, const unsigned int q_point) const
ProductType< Number, typename Scalar< dim, spacedim >::third_derivative_type >::type third_derivative_type
Definition: fe_values.h:205
const DerivativeForm< 1, dim, spacedim > & jacobian(const unsigned int quadrature_point) const
Number value_type
Definition: vector.h:110
const Tensor< 3, spacedim > & jacobian_pushed_forward_grad(const unsigned int quadrature_point) const
ProductType< Number, typename Vector< dim, spacedim >::third_derivative_type >::type third_derivative_type
Definition: fe_values.h:640
CellSimilarity::Similarity cell_similarity
Definition: fe_values.h:3090
::Tensor< 1, spacedim > divergence_type
Definition: fe_values.h:1406
static const unsigned int dimension
Definition: fe_values.h:3460
Cache(const FEValuesBase< dim, spacedim > &fe_values)
Definition: fe_values.cc:2223
const Tensor< 5, spacedim > & jacobian_pushed_forward_3rd_derivative(const unsigned int quadrature_point) const
unsigned int present_face_index
Definition: fe_values.h:3320
const FEValues< dim, spacedim > & get_present_fe_values() const
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:1365
static ::ExceptionBase & ExcAccessToUninitializedField()
value_type value(const unsigned int shape_function, const unsigned int q_point) const
ProductType< Number, typename Tensor< 2, dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:1436
static ::ExceptionBase & ExcFaceHasNoSubfaces()
std::vector<::FEValuesViews::Scalar< dim, spacedim > > scalars
Definition: fe_values.h:1703
const unsigned int dofs_per_cell
Definition: fe_values.h:1847
const unsigned int component
Definition: fe_values.h:486
void get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::symmetric_gradient_type > &symmetric_gradients) const
Definition: fe_values.cc:1751
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
Definition: fe_values.cc:1418
gradient_type gradient(const unsigned int shape_function, const unsigned int q_point) const
const Tensor< 3, spacedim > & shape_3rd_derivative(const unsigned int function_no, const unsigned int point_no) const
FEValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe)
Definition: fe_values.cc:2733
::Tensor< 3, spacedim > hessian_type
Definition: fe_values.h:578
const Quadrature< dim-1 > quadrature
Definition: fe_values.h:3325
Volume element.
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
Definition: fe_values.cc:1954
static const unsigned int dimension
Definition: fe_values.h:3352
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
Definition: fe_values.cc:3197
::internal::CurlType< spacedim >::type curl_type
Definition: fe_values.h:571
static ::ExceptionBase & ExcReinitCalledWithBoundaryFace()
Outer normal vector, not normalized.
const std::vector< DerivativeForm< 4, dim, spacedim > > & get_jacobian_3rd_derivatives() const
const FiniteElement< dim, spacedim > & get_fe() const
std::unique_ptr< const CellIteratorBase > present_cell
Definition: fe_values.h:2985
static ::ExceptionBase & ExcFEDontMatch()
Scalar & operator=(const Scalar< dim, spacedim > &)
Definition: fe_values.cc:188
void get_function_divergences(const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const
Definition: fe_values.cc:1772
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
Definition: fe_values.cc:1905
UpdateFlags get_update_flags() const
third_derivative_type third_derivative(const unsigned int shape_function, const unsigned int q_point) const
Transformed quadrature points.
void do_reinit(const unsigned int face_no)
Definition: fe_values.cc:4350
ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:1166
std::size_t memory_consumption() const
Definition: fe_values.cc:4207
::Tensor< 1, spacedim > gradient_type
Definition: fe_values.h:154
::SymmetricTensor< 2, spacedim > value_type
Definition: fe_values.h:1136
unsigned int row_index[spacedim]
Definition: fe_values.h:668
const DerivativeForm< 3, dim, spacedim > & jacobian_2nd_derivative(const unsigned int quadrature_point) const
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
Definition: fe_values.cc:3889
static const unsigned int space_dimension
Definition: fe_values.h:1835
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
Definition: fe_values.h:3116
const FEValuesViews::Scalar< dim, spacedim > & operator[](const FEValuesExtractors::Scalar &scalar) const
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
Definition: fe_values.h:3061
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
const DerivativeForm< 2, dim, spacedim > & jacobian_grad(const unsigned int quadrature_point) const
const std::vector< DerivativeForm< 1, dim, spacedim > > & get_jacobians() const
ProductType< Number, typename Vector< dim, spacedim >::hessian_type >::type hessian_type
Definition: fe_values.h:634
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
Definition: fe_values.cc:3432
const Mapping< dim, spacedim > & get_mapping() const
static ::ExceptionBase & ExcShapeFunctionNotPrimitive(int arg1)
const DerivativeForm< 4, dim, spacedim > & jacobian_3rd_derivative(const unsigned int quadrature_point) const
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
Definition: fe_values.cc:4530
static const unsigned int integral_dimension
Definition: fe_values.h:3471
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
Definition: fe_values.cc:4466
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
ProductType< Number, typename Vector< dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:604
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > &divergences) const
Definition: fe_values.cc:1797
const std::vector< Tensor< 5, spacedim > > & get_jacobian_pushed_forward_3rd_derivatives() const
void get_function_curls_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::curl_type > &curls) const
Definition: fe_values.cc:1841
static const unsigned int integral_dimension
Definition: fe_values.h:3360
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
Definition: fe_values.cc:1550
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
Definition: fe_values.cc:1885
ProductType< Number, typename Vector< dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:598
const std::vector< Point< spacedim > > & get_quadrature_points() const
ProductType< Number, typename Scalar< dim, spacedim >::gradient_type >::type gradient_type
Definition: fe_values.h:187
const Point< spacedim > & quadrature_point(const unsigned int q) const
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
Definition: fe_values.cc:1462
const std::vector< DerivativeForm< 2, dim, spacedim > > & get_jacobian_grads() const
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
Definition: fe_values.cc:1861
void get_function_laplacians(const InputVector &fe_function, std::vector< typename InputVector::value_type > &laplacians) const
Definition: fe_values.cc:3532
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
Definition: fe_values.h:3054
static ::ExceptionBase & ExcMessage(std::string arg1)
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
Definition: fe_values.cc:1706
::Tensor< 1, spacedim > value_type
Definition: fe_values.h:534
ProductType< Number, typename Scalar< dim, spacedim >::hessian_type >::type hessian_type
Definition: fe_values.h:199
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:346
const double & shape_value(const unsigned int function_no, const unsigned int point_no) const
CellSimilarity::Similarity get_cell_similarity() const
Definition: fe_values.cc:3943
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > mapping_data
Definition: fe_values.h:3041
Third derivatives of shape functions.
void get_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type > > &third_derivatives) const
Definition: fe_values.cc:3653
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
Definition: fe_values.cc:3805
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:1679
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
Definition: fe_values.cc:1574
unsigned int get_face_index() const
#define Assert(cond, exc)
Definition: exceptions.h:1142
::Tensor< 2, spacedim > value_type
Definition: fe_values.h:1401
const std::vector< Tensor< 3, spacedim > > & get_jacobian_pushed_forward_grads() const
UpdateFlags
const DerivativeForm< 1, spacedim, dim > & inverse_jacobian(const unsigned int quadrature_point) const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no)
Definition: fe_values.cc:4303
Abstract base class for mapping classes.
Definition: dof_tools.h:46
const Quadrature< dim-1 > & get_quadrature() const
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:1095
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:335
const Quadrature< dim > quadrature
Definition: fe_values.h:3224
const unsigned int first_vector_component
Definition: fe_values.h:1090
#define DeclException0(Exception0)
Definition: exceptions.h:323
const std::vector< DerivativeForm< 1, spacedim, dim > > & get_inverse_jacobians() const
void invalidate_present_cell()
Definition: fe_values.cc:3824
ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:181
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
Definition: fe_values.h:3034
static const unsigned int integral_dimension
Definition: fe_values.h:3148
Vector & operator=(const Vector< dim, spacedim > &)
Definition: fe_values.cc:284
SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
Tensor()
Definition: tensor.h:974
const FEFaceValues< dim, spacedim > & get_present_fe_values() const
symmetric_gradient_type symmetric_gradient(const unsigned int shape_function, const unsigned int q_point) const
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
Definition: fe_values.cc:1530
bool is_nonzero_shape_function_component[spacedim]
Definition: fe_values.h:657
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< typename ProductType< symmetric_gradient_type, typename InputVector::value_type >::type > &symmetric_gradients) const
Definition: fe_values.cc:1726
static const unsigned int integral_dimension
Definition: fe_values.h:3259
ProductType< Number, typename Vector< dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:616
Second derivatives of shape functions.
static ::ExceptionBase & ExcFENotPrimitive()
static ::ExceptionBase & ExcAccessToUninitializedField(char *arg1)
Gradient of volume element.
const std::vector< Tensor< 1, spacedim > > & get_all_normal_vectors() const
Definition: fe_values.cc:3762
FEValuesBase & operator=(const FEValuesBase &)
const Tensor< 2, spacedim > & shape_hessian(const unsigned int function_no, const unsigned int point_no) const
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
const Tensor< 1, spacedim > & boundary_form(const unsigned int i) const
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
Definition: tensor.h:1335
divergence_type divergence(const unsigned int shape_function, const unsigned int q_point) const
std::size_t memory_consumption() const
Definition: fe_values.cc:4165
ProductType< Number, typename Vector< dim, spacedim >::symmetric_gradient_type >::type symmetric_gradient_type
Definition: fe_values.h:610
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
Definition: fe_values.cc:1506
const Quadrature< dim > & get_quadrature() const
const unsigned int n_quadrature_points
Definition: fe_values.h:1840
ProductType< Number, typename Vector< dim, spacedim >::value_type >::type laplacian_type
Definition: fe_values.h:622
const std::vector< DerivativeForm< 3, dim, spacedim > > & get_jacobian_2nd_derivatives() const
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:1084
void get_function_curls(const InputVector &fe_function, std::vector< typename ProductType< curl_type, typename InputVector::value_type >::type > &curls) const
Definition: fe_values.cc:1817
static const unsigned int dimension
Definition: fe_values.h:1830
const std::vector< Tensor< 4, spacedim > > & get_jacobian_pushed_forward_2nd_derivatives() const
::Tensor< 2, spacedim > hessian_type
Definition: fe_values.h:161
boost::signals2::connection tria_listener_mesh_transform
Definition: fe_values.h:3010
static const unsigned int space_dimension
Definition: fe_values.h:3465
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
Definition: fe_values.cc:1932
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:480
Definition: mpi.h:53
const std::vector< double > & get_JxW_values() const
::SymmetricTensor< 2, spacedim > symmetric_gradient_type
Definition: fe_values.h:556
double JxW(const unsigned int quadrature_point) const
FEFaceValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &quadrature)
Definition: fe_values.cc:4176
ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:1160
void initialize(const UpdateFlags update_flags)
Definition: fe_values.cc:4002
Shape function gradients.
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
Definition: fe_values.cc:1978
Normal vectors.
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
Definition: fe_values.cc:3843
::Tensor< 2, spacedim > gradient_type
Definition: fe_values.h:544
Tensor< 3, spacedim > shape_3rd_derivative_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
const FESubfaceValues< dim, spacedim > & get_present_fe_values() const
hessian_type hessian(const unsigned int shape_function, const unsigned int q_point) const
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:1668
Definition: fe.h:33
void initialize(const UpdateFlags update_flags)
Definition: fe_values.cc:4424
const SmartPointer< const FEValuesBase< dim, spacedim > > fe_values
Definition: fe_values.h:1354
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
Definition: fe_values.cc:1486
curl_type curl(const unsigned int shape_function, const unsigned int q_point) const
static ::ExceptionBase & ExcNotImplemented()
ProductType< Number, typename Vector< dim, spacedim >::curl_type >::type curl_type
Definition: fe_values.h:628
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
Definition: fe_values.cc:3753
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
Definition: fe_values.cc:1638
boost::signals2::connection tria_listener_refinement
Definition: fe_values.h:3001
const Tensor< 4, spacedim > & jacobian_pushed_forward_2nd_derivative(const unsigned int quadrature_point) const
::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > finite_element_output
Definition: fe_values.h:3067
::Tensor< 3, spacedim > gradient_type
Definition: fe_values.h:1411
gradient_type gradient(const unsigned int shape_function, const unsigned int q_point) const
const std::vector< Tensor< 1, spacedim > > & get_boundary_forms() const
Definition: fe_values.cc:4196
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
void initialize(const UpdateFlags update_flags)
Definition: fe_values.cc:4261
third_derivative_type third_derivative(const unsigned int shape_function, const unsigned int q_point) const
::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > mapping_output
Definition: fe_values.h:3047
FEValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags update_flags)
Definition: fe_values.cc:3966
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
Definition: fe_values.cc:1682
hessian_type hessian(const unsigned int shape_function, const unsigned int q_point) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
Definition: fe_values.cc:1618
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
Definition: fe_values.cc:3773
void do_reinit()
Definition: fe_values.cc:4131
Tensor< 2, spacedim > shape_hessian_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell)
Definition: fe_values.cc:4106
ProductType< Number, typename Tensor< 2, dim, spacedim >::divergence_type >::type divergence_type
Definition: fe_values.h:1430
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
Definition: fe_values.cc:1442
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &face_quadrature, const UpdateFlags update_flags)
Definition: fe_values.cc:4390
::Tensor< 3, spacedim > third_derivative_type
Definition: fe_values.h:168
ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type laplacian_type
Definition: fe_values.h:193
FEFaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &quadrature, const UpdateFlags update_flags)
Definition: fe_values.cc:4227
std::size_t memory_consumption() const
Definition: fe_values.cc:3785
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
Definition: fe_values.cc:1662
const Tensor< 1, spacedim > & shape_grad(const unsigned int function_no, const unsigned int quadrature_point) const
std::vector< ShapeFunctionData > shape_function_data
Definition: fe_values.h:491
UpdateFlags update_flags
Definition: fe_values.h:3073
static ::ExceptionBase & ExcInternalError()
ProductType< Number, typename Tensor< 2, dim, spacedim >::value_type >::type value_type
Definition: fe_values.h:1424
::Tensor< 4, spacedim > third_derivative_type
Definition: fe_values.h:585
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
Tensor< 1, spacedim > shape_grad_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const