deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
fe_values_base.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2023 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_fe_values_base_h
14#define dealii_fe_values_base_h
15
16
17#include <deal.II/base/config.h>
18
22#include <deal.II/base/point.h>
26
29
30#include <deal.II/fe/fe.h>
34#include <deal.II/fe/mapping.h>
36
37#include <deal.II/grid/tria.h>
39
41
43
44#include <boost/signals2/connection.hpp>
45
46#include <algorithm>
47#include <memory>
48#include <optional>
49#include <type_traits>
50#include <variant>
51
53
153template <int dim, int spacedim>
155{
156public:
160 static constexpr unsigned int dimension = dim;
161
165 static constexpr unsigned int space_dimension = spacedim;
166
174 const unsigned int n_quadrature_points;
175
185 const unsigned int max_n_quadrature_points;
186
192 const unsigned int dofs_per_cell;
193
194
202 FEValuesBase(const unsigned int n_q_points,
203 const unsigned int dofs_per_cell,
207
213 operator=(const FEValuesBase &) = delete;
214
219 FEValuesBase(const FEValuesBase &) = delete;
220
224 virtual ~FEValuesBase() override;
225
246 void
248
252
274 const double &
275 shape_value(const unsigned int i, const unsigned int q_point) const;
276
297 double
298 shape_value_component(const unsigned int i,
299 const unsigned int q_point,
300 const unsigned int component) const;
301
327 const Tensor<1, spacedim> &
328 shape_grad(const unsigned int i, const unsigned int q_point) const;
329
347 shape_grad_component(const unsigned int i,
348 const unsigned int q_point,
349 const unsigned int component) const;
350
370 const Tensor<2, spacedim> &
371 shape_hessian(const unsigned int i, const unsigned int q_point) const;
372
390 shape_hessian_component(const unsigned int i,
391 const unsigned int q_point,
392 const unsigned int component) const;
393
413 const Tensor<3, spacedim> &
414 shape_3rd_derivative(const unsigned int i, const unsigned int q_point) const;
415
433 shape_3rd_derivative_component(const unsigned int i,
434 const unsigned int q_point,
435 const unsigned int component) const;
436
439
485 template <typename Number>
486 void
487 get_function_values(const ReadVector<Number> &fe_function,
488 std::vector<Number> &values) const;
489
503 template <typename Number>
504 void
505 get_function_values(const ReadVector<Number> &fe_function,
506 std::vector<Vector<Number>> &values) const;
507
564 template <typename Number>
565 void
566 get_function_values(const ReadVector<Number> &fe_function,
568 std::vector<Number> &values) const;
569
578 template <typename Number>
579 void
580 get_function_values(const ReadVector<Number> &fe_function,
582 std::vector<Vector<Number>> &values) const;
583
584
606 template <typename Number>
607 void
608 get_function_values(const ReadVector<Number> &fe_function,
610 ArrayView<std::vector<Number>> values,
611 const bool quadrature_points_fastest) const;
612
615
659 template <typename Number>
660 void
662 const ReadVector<Number> &fe_function,
663 std::vector<Tensor<1, spacedim, Number>> &gradients) const;
664
681 template <typename Number>
682 void
684 const ReadVector<Number> &fe_function,
685 std::vector<std::vector<Tensor<1, spacedim, Number>>> &gradients) const;
686
695 template <typename Number>
696 void
698 const ReadVector<Number> &fe_function,
700 std::vector<Tensor<1, spacedim, Number>> &gradients) const;
701
710 template <typename Number>
711 void
713 const ReadVector<Number> &fe_function,
715 ArrayView<std::vector<Tensor<1, spacedim, Number>>> gradients,
716 const bool quadrature_points_fastest = false) const;
717
722
761 template <typename Number>
762 void
764 const ReadVector<Number> &fe_function,
765 std::vector<Tensor<2, spacedim, Number>> &hessians) const;
766
784 template <typename Number>
785 void
787 const ReadVector<Number> &fe_function,
788 std::vector<std::vector<Tensor<2, spacedim, Number>>> &hessians,
789 const bool quadrature_points_fastest = false) const;
790
799 template <typename Number>
800 void
802 const ReadVector<Number> &fe_function,
804 std::vector<Tensor<2, spacedim, Number>> &hessians) const;
805
814 template <typename Number>
815 void
817 const ReadVector<Number> &fe_function,
819 ArrayView<std::vector<Tensor<2, spacedim, Number>>> hessians,
820 const bool quadrature_points_fastest = false) const;
821
862 template <typename Number>
863 void
865 std::vector<Number> &laplacians) const;
866
886 template <typename Number>
887 void
889 std::vector<Vector<Number>> &laplacians) const;
890
899 template <typename Number>
900 void
902 const ReadVector<Number> &fe_function,
904 std::vector<Number> &laplacians) const;
905
914 template <typename Number>
915 void
917 const ReadVector<Number> &fe_function,
919 std::vector<Vector<Number>> &laplacians) const;
920
929 template <typename Number>
930 void
932 const ReadVector<Number> &fe_function,
934 std::vector<std::vector<Number>> &laplacians,
935 const bool quadrature_points_fastest = false) const;
936
939
979 template <typename Number>
980 void
982 const ReadVector<Number> &fe_function,
983 std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const;
984
1004 template <typename Number>
1005 void
1007 const ReadVector<Number> &fe_function,
1008 std::vector<std::vector<Tensor<3, spacedim, Number>>> &third_derivatives,
1009 const bool quadrature_points_fastest = false) const;
1010
1019 template <typename Number>
1020 void
1022 const ReadVector<Number> &fe_function,
1024 std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const;
1025
1034 template <typename Number>
1035 void
1037 const ReadVector<Number> &fe_function,
1039 ArrayView<std::vector<Tensor<3, spacedim, Number>>> third_derivatives,
1040 const bool quadrature_points_fastest = false) const;
1044
1071
1105 dof_indices_starting_at(const unsigned int start_dof_index) const;
1106
1138 dof_indices_ending_at(const unsigned int end_dof_index) const;
1139
1143
1167
1174 const Point<spacedim> &
1175 quadrature_point(const unsigned int q_point) const;
1176
1182 const std::vector<Point<spacedim>> &
1184
1201 double
1202 JxW(const unsigned int q_point) const;
1203
1207 const std::vector<double> &
1209
1217 jacobian(const unsigned int q_point) const;
1218
1225 const std::vector<DerivativeForm<1, dim, spacedim>> &
1227
1236 jacobian_grad(const unsigned int q_point) const;
1237
1244 const std::vector<DerivativeForm<2, dim, spacedim>> &
1246
1255 const Tensor<3, spacedim> &
1256 jacobian_pushed_forward_grad(const unsigned int q_point) const;
1257
1264 const std::vector<Tensor<3, spacedim>> &
1266
1275 jacobian_2nd_derivative(const unsigned int q_point) const;
1276
1283 const std::vector<DerivativeForm<3, dim, spacedim>> &
1285
1295 const Tensor<4, spacedim> &
1296 jacobian_pushed_forward_2nd_derivative(const unsigned int q_point) const;
1297
1304 const std::vector<Tensor<4, spacedim>> &
1306
1316 jacobian_3rd_derivative(const unsigned int q_point) const;
1317
1324 const std::vector<DerivativeForm<4, dim, spacedim>> &
1326
1336 const Tensor<5, spacedim> &
1337 jacobian_pushed_forward_3rd_derivative(const unsigned int q_point) const;
1338
1345 const std::vector<Tensor<5, spacedim>> &
1347
1355 inverse_jacobian(const unsigned int q_point) const;
1356
1363 const std::vector<DerivativeForm<1, spacedim, dim>> &
1365
1385 const Tensor<1, spacedim> &
1386 normal_vector(const unsigned int q_point) const;
1387
1395 const std::vector<Tensor<1, spacedim>> &
1396 get_normal_vectors() const;
1397
1401
1413
1424
1436
1437
1448
1452
1459
1464 get_fe() const;
1465
1471
1476 get_cell() const;
1477
1484 get_cell_similarity() const;
1485
1490 std::size_t
1491 memory_consumption() const;
1503 std::string,
1504 << "You are requesting information from an FEValues/FEFaceValues/FESubfaceValues "
1505 << "object for which this kind of information has not been computed. What "
1506 << "information these objects compute is determined by the update_* flags you "
1507 << "pass to the constructor. Here, the operation you are attempting requires "
1508 << "the <" << arg1
1509 << "> flag to be set, but it was apparently not specified "
1510 << "upon construction.");
1511
1518 "FEValues object is not reinit'ed to any cell");
1519
1528 "The FiniteElement you provided to FEValues and the FiniteElement that belongs "
1529 "to the DoFHandler that provided the cell iterator do not match. "
1530 "In most cases, this is a bug: You're calling FEValues::reinit() with a cell "
1531 "from the wrong DoFHandler.\n"
1532 "\n"
1533 "On the other hand, there are cases where you want to only use an FEValues "
1534 "object with the geometric information of a cell, without the information "
1535 "about degrees of freedom associated with this cell. In those cases, you "
1536 "may want to cast the cell iterator to one that only has the "
1537 "geometric information of the triangulation, and initialize with that instead:\n"
1538 "\tfe_values.reinit(\n"
1539 "\t\tstatic_cast<Triangulation<dim, spacedim>::cell_iterator>(cell));");
1546 int,
1547 << "The shape function with index " << arg1
1548 << " is not primitive, i.e. it is vector-valued and "
1549 << "has more than one non-zero vector component. This "
1550 << "function cannot be called for these shape functions. "
1551 << "Maybe you want to use the same function with the "
1552 << "_component suffix?");
1553
1562 "The given FiniteElement is not a primitive element but the requested operation "
1563 "only works for those. See FiniteElement::is_primitive() for more information.");
1564
1565protected:
1583 {
1584 public:
1587 "You have previously called the FEValues::reinit() function with a "
1588 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However, "
1589 "when you do this, you cannot call some functions in the FEValues "
1590 "class, such as the get_function_values/gradients/hessians/third_derivatives "
1591 "functions. If you need these functions, then you need to call "
1592 "FEValues::reinit() with an iterator type that allows to extract "
1593 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
1594
1600
1606
1612
1618
1622 bool
1623 is_initialized() const;
1624
1631 operator typename Triangulation<dim, spacedim>::cell_iterator() const;
1632
1638 n_dofs_for_dof_handler() const;
1639
1644 template <typename Number>
1645 void
1647 ArrayView<Number> out) const;
1648
1649 private:
1655 std::optional<
1656 std::variant<typename Triangulation<dim, spacedim>::cell_iterator,
1660 };
1661
1668
1673 boost::signals2::connection tria_listener_any_change;
1674
1680 void
1682
1692 void
1694 const typename Triangulation<dim, spacedim>::cell_iterator &cell);
1695
1702
1708 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
1710
1717
1725
1731 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1733
1739 spacedim>
1741
1742
1747
1758
1765
1771 void
1773 const typename Triangulation<dim, spacedim>::cell_iterator &cell);
1774
1775private:
1780
1785
1786 // Make the view classes friends of this class, since they access internal
1787 // data.
1788 template <int, int>
1790 template <int, int>
1792 template <int, int, int>
1794 template <int, int, int>
1796};
1797
1798namespace internal
1799{
1808 template <int dim, int spacedim>
1809 std::vector<unsigned int>
1811} // namespace internal
1812
1813#ifndef DOXYGEN
1814
1815/*---------------------- Inline functions: FEValuesBase ---------------------*/
1816
1817template <int dim, int spacedim>
1820 const FEValuesExtractors::Scalar &scalar) const
1821{
1822 AssertIndexRange(scalar.component, fe_values_views_cache.scalars.size());
1823
1824 return fe_values_views_cache.scalars[scalar.component].value_or_initialize(
1825 [scalar, this]() {
1826 return FEValuesViews::Scalar<dim, spacedim>(*this, scalar.component);
1827 });
1828}
1829
1830
1831
1832template <int dim, int spacedim>
1835 const FEValuesExtractors::Vector &vector) const
1836{
1838 fe_values_views_cache.vectors.size());
1839
1840 return fe_values_views_cache.vectors[vector.first_vector_component]
1841 .value_or_initialize([vector, this]() {
1843 *this, vector.first_vector_component);
1844 });
1845}
1846
1847
1848
1849template <int dim, int spacedim>
1852 const FEValuesExtractors::SymmetricTensor<2> &tensor) const
1853{
1854 Assert(
1855 tensor.first_tensor_component <
1856 fe_values_views_cache.symmetric_second_order_tensors.size(),
1858 0,
1859 fe_values_views_cache.symmetric_second_order_tensors.size()));
1860
1861 return fe_values_views_cache
1863 .value_or_initialize([tensor, this]() {
1865 *this, tensor.first_tensor_component);
1866 });
1867}
1868
1869
1870
1871template <int dim, int spacedim>
1874 const FEValuesExtractors::Tensor<2> &tensor) const
1875{
1877 fe_values_views_cache.second_order_tensors.size());
1878
1879 return fe_values_views_cache
1881 .value_or_initialize([tensor, this]() {
1883 *this, tensor.first_tensor_component);
1884 });
1885}
1886
1887
1888
1889template <int dim, int spacedim>
1890inline const double &
1891FEValuesBase<dim, spacedim>::shape_value(const unsigned int i,
1892 const unsigned int q_point) const
1893{
1894 AssertIndexRange(i, fe->n_dofs_per_cell());
1895 Assert(this->update_flags & update_values,
1896 ExcAccessToUninitializedField("update_values"));
1897 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1898 Assert(present_cell.is_initialized(), ExcNotReinited());
1899 // if the entire FE is primitive,
1900 // then we can take a short-cut:
1901 if (fe->is_primitive())
1902 return this->finite_element_output.shape_values(i, q_point);
1903 else
1904 {
1905 // otherwise, use the mapping
1906 // between shape function
1907 // numbers and rows. note that
1908 // by the assertions above, we
1909 // know that this particular
1910 // shape function is primitive,
1911 // so we can call
1912 // system_to_component_index
1913 const unsigned int row =
1914 this->finite_element_output
1915 .shape_function_to_row_table[i * fe->n_components() +
1916 fe->system_to_component_index(i).first];
1917 return this->finite_element_output.shape_values(row, q_point);
1918 }
1919}
1920
1921
1922
1923template <int dim, int spacedim>
1924inline double
1926 const unsigned int i,
1927 const unsigned int q_point,
1928 const unsigned int component) const
1929{
1930 AssertIndexRange(i, fe->n_dofs_per_cell());
1931 Assert(this->update_flags & update_values,
1932 ExcAccessToUninitializedField("update_values"));
1933 AssertIndexRange(component, fe->n_components());
1934 Assert(present_cell.is_initialized(), ExcNotReinited());
1935
1936 // check whether the shape function
1937 // is non-zero at all within
1938 // this component:
1939 if (fe->get_nonzero_components(i)[component] == false)
1940 return 0;
1941
1942 // look up the right row in the
1943 // table and take the data from
1944 // there
1945 const unsigned int row =
1946 this->finite_element_output
1947 .shape_function_to_row_table[i * fe->n_components() + component];
1948 return this->finite_element_output.shape_values(row, q_point);
1949}
1950
1951
1952
1953template <int dim, int spacedim>
1954inline const Tensor<1, spacedim> &
1955FEValuesBase<dim, spacedim>::shape_grad(const unsigned int i,
1956 const unsigned int q_point) const
1957{
1958 AssertIndexRange(i, fe->n_dofs_per_cell());
1959 Assert(this->update_flags & update_gradients,
1960 ExcAccessToUninitializedField("update_gradients"));
1961 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1962 Assert(present_cell.is_initialized(), ExcNotReinited());
1963 // if the entire FE is primitive,
1964 // then we can take a short-cut:
1965 if (fe->is_primitive())
1966 return this->finite_element_output.shape_gradients[i][q_point];
1967 else
1968 {
1969 // otherwise, use the mapping
1970 // between shape function
1971 // numbers and rows. note that
1972 // by the assertions above, we
1973 // know that this particular
1974 // shape function is primitive,
1975 // so we can call
1976 // system_to_component_index
1977 const unsigned int row =
1978 this->finite_element_output
1979 .shape_function_to_row_table[i * fe->n_components() +
1980 fe->system_to_component_index(i).first];
1981 return this->finite_element_output.shape_gradients[row][q_point];
1982 }
1983}
1984
1985
1986
1987template <int dim, int spacedim>
1990 const unsigned int i,
1991 const unsigned int q_point,
1992 const unsigned int component) const
1993{
1994 AssertIndexRange(i, fe->n_dofs_per_cell());
1995 Assert(this->update_flags & update_gradients,
1996 ExcAccessToUninitializedField("update_gradients"));
1997 AssertIndexRange(component, fe->n_components());
1998 Assert(present_cell.is_initialized(), ExcNotReinited());
1999 // check whether the shape function
2000 // is non-zero at all within
2001 // this component:
2002 if (fe->get_nonzero_components(i)[component] == false)
2003 return Tensor<1, spacedim>();
2004
2005 // look up the right row in the
2006 // table and take the data from
2007 // there
2008 const unsigned int row =
2009 this->finite_element_output
2010 .shape_function_to_row_table[i * fe->n_components() + component];
2011 return this->finite_element_output.shape_gradients[row][q_point];
2012}
2013
2014
2015
2016template <int dim, int spacedim>
2017inline const Tensor<2, spacedim> &
2019 const unsigned int q_point) const
2020{
2021 AssertIndexRange(i, fe->n_dofs_per_cell());
2022 Assert(this->update_flags & update_hessians,
2023 ExcAccessToUninitializedField("update_hessians"));
2024 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2025 Assert(present_cell.is_initialized(), ExcNotReinited());
2026 // if the entire FE is primitive,
2027 // then we can take a short-cut:
2028 if (fe->is_primitive())
2029 return this->finite_element_output.shape_hessians[i][q_point];
2030 else
2031 {
2032 // otherwise, use the mapping
2033 // between shape function
2034 // numbers and rows. note that
2035 // by the assertions above, we
2036 // know that this particular
2037 // shape function is primitive,
2038 // so we can call
2039 // system_to_component_index
2040 const unsigned int row =
2041 this->finite_element_output
2042 .shape_function_to_row_table[i * fe->n_components() +
2043 fe->system_to_component_index(i).first];
2044 return this->finite_element_output.shape_hessians[row][q_point];
2045 }
2046}
2047
2048
2049
2050template <int dim, int spacedim>
2053 const unsigned int i,
2054 const unsigned int q_point,
2055 const unsigned int component) const
2056{
2057 AssertIndexRange(i, fe->n_dofs_per_cell());
2058 Assert(this->update_flags & update_hessians,
2059 ExcAccessToUninitializedField("update_hessians"));
2060 AssertIndexRange(component, fe->n_components());
2061 Assert(present_cell.is_initialized(), ExcNotReinited());
2062 // check whether the shape function
2063 // is non-zero at all within
2064 // this component:
2065 if (fe->get_nonzero_components(i)[component] == false)
2066 return Tensor<2, spacedim>();
2067
2068 // look up the right row in the
2069 // table and take the data from
2070 // there
2071 const unsigned int row =
2072 this->finite_element_output
2073 .shape_function_to_row_table[i * fe->n_components() + component];
2074 return this->finite_element_output.shape_hessians[row][q_point];
2075}
2076
2077
2078
2079template <int dim, int spacedim>
2080inline const Tensor<3, spacedim> &
2082 const unsigned int i,
2083 const unsigned int q_point) const
2084{
2085 AssertIndexRange(i, fe->n_dofs_per_cell());
2086 Assert(this->update_flags & update_3rd_derivatives,
2087 ExcAccessToUninitializedField("update_3rd_derivatives"));
2088 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2089 Assert(present_cell.is_initialized(), ExcNotReinited());
2090 // if the entire FE is primitive,
2091 // then we can take a short-cut:
2092 if (fe->is_primitive())
2093 return this->finite_element_output.shape_3rd_derivatives[i][q_point];
2094 else
2095 {
2096 // otherwise, use the mapping
2097 // between shape function
2098 // numbers and rows. note that
2099 // by the assertions above, we
2100 // know that this particular
2101 // shape function is primitive,
2102 // so we can call
2103 // system_to_component_index
2104 const unsigned int row =
2105 this->finite_element_output
2106 .shape_function_to_row_table[i * fe->n_components() +
2107 fe->system_to_component_index(i).first];
2108 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2109 }
2110}
2111
2112
2113
2114template <int dim, int spacedim>
2117 const unsigned int i,
2118 const unsigned int q_point,
2119 const unsigned int component) const
2120{
2121 AssertIndexRange(i, fe->n_dofs_per_cell());
2122 Assert(this->update_flags & update_3rd_derivatives,
2123 ExcAccessToUninitializedField("update_3rd_derivatives"));
2124 AssertIndexRange(component, fe->n_components());
2125 Assert(present_cell.is_initialized(), ExcNotReinited());
2126 // check whether the shape function
2127 // is non-zero at all within
2128 // this component:
2129 if (fe->get_nonzero_components(i)[component] == false)
2130 return Tensor<3, spacedim>();
2131
2132 // look up the right row in the
2133 // table and take the data from
2134 // there
2135 const unsigned int row =
2136 this->finite_element_output
2137 .shape_function_to_row_table[i * fe->n_components() + component];
2138 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2139}
2140
2141
2142
2143template <int dim, int spacedim>
2144inline const FiniteElement<dim, spacedim> &
2146{
2147 return *fe;
2148}
2149
2150
2151
2152template <int dim, int spacedim>
2153inline const Mapping<dim, spacedim> &
2155{
2156 return *mapping;
2157}
2158
2159
2160
2161template <int dim, int spacedim>
2162inline UpdateFlags
2164{
2165 return this->update_flags;
2166}
2167
2168
2169
2170template <int dim, int spacedim>
2171inline const std::vector<Point<spacedim>> &
2173{
2174 Assert(this->update_flags & update_quadrature_points,
2175 ExcAccessToUninitializedField("update_quadrature_points"));
2176 Assert(present_cell.is_initialized(), ExcNotReinited());
2177 return this->mapping_output.quadrature_points;
2178}
2179
2180
2181
2182template <int dim, int spacedim>
2183inline const std::vector<double> &
2185{
2186 Assert(this->update_flags & update_JxW_values,
2187 ExcAccessToUninitializedField("update_JxW_values"));
2188 Assert(present_cell.is_initialized(), ExcNotReinited());
2189 return this->mapping_output.JxW_values;
2190}
2191
2192
2193
2194template <int dim, int spacedim>
2195inline const std::vector<DerivativeForm<1, dim, spacedim>> &
2197{
2198 Assert(this->update_flags & update_jacobians,
2199 ExcAccessToUninitializedField("update_jacobians"));
2200 Assert(present_cell.is_initialized(), ExcNotReinited());
2201 return this->mapping_output.jacobians;
2202}
2203
2204
2205
2206template <int dim, int spacedim>
2207inline const std::vector<DerivativeForm<2, dim, spacedim>> &
2209{
2210 Assert(this->update_flags & update_jacobian_grads,
2211 ExcAccessToUninitializedField("update_jacobians_grads"));
2212 Assert(present_cell.is_initialized(), ExcNotReinited());
2213 return this->mapping_output.jacobian_grads;
2214}
2215
2216
2217
2218template <int dim, int spacedim>
2219inline const Tensor<3, spacedim> &
2221 const unsigned int q_point) const
2222{
2223 Assert(this->update_flags & update_jacobian_pushed_forward_grads,
2224 ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
2225 Assert(present_cell.is_initialized(), ExcNotReinited());
2226 return this->mapping_output.jacobian_pushed_forward_grads[q_point];
2227}
2228
2229
2230
2231template <int dim, int spacedim>
2232inline const std::vector<Tensor<3, spacedim>> &
2234{
2235 Assert(this->update_flags & update_jacobian_pushed_forward_grads,
2236 ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads"));
2237 Assert(present_cell.is_initialized(), ExcNotReinited());
2238 return this->mapping_output.jacobian_pushed_forward_grads;
2239}
2240
2241
2242
2243template <int dim, int spacedim>
2246 const unsigned int q_point) const
2247{
2248 Assert(this->update_flags & update_jacobian_2nd_derivatives,
2249 ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
2250 Assert(present_cell.is_initialized(), ExcNotReinited());
2251 return this->mapping_output.jacobian_2nd_derivatives[q_point];
2252}
2253
2254
2255
2256template <int dim, int spacedim>
2257inline const std::vector<DerivativeForm<3, dim, spacedim>> &
2259{
2260 Assert(this->update_flags & update_jacobian_2nd_derivatives,
2261 ExcAccessToUninitializedField("update_jacobian_2nd_derivatives"));
2262 Assert(present_cell.is_initialized(), ExcNotReinited());
2263 return this->mapping_output.jacobian_2nd_derivatives;
2264}
2265
2266
2267
2268template <int dim, int spacedim>
2269inline const Tensor<4, spacedim> &
2271 const unsigned int q_point) const
2272{
2274 ExcAccessToUninitializedField(
2275 "update_jacobian_pushed_forward_2nd_derivatives"));
2276 Assert(present_cell.is_initialized(), ExcNotReinited());
2277 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[q_point];
2278}
2279
2280
2281
2282template <int dim, int spacedim>
2283inline const std::vector<Tensor<4, spacedim>> &
2285{
2287 ExcAccessToUninitializedField(
2288 "update_jacobian_pushed_forward_2nd_derivatives"));
2289 Assert(present_cell.is_initialized(), ExcNotReinited());
2290 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
2291}
2292
2293
2294
2295template <int dim, int spacedim>
2298 const unsigned int q_point) const
2299{
2300 Assert(this->update_flags & update_jacobian_3rd_derivatives,
2301 ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
2302 Assert(present_cell.is_initialized(), ExcNotReinited());
2303 return this->mapping_output.jacobian_3rd_derivatives[q_point];
2304}
2305
2306
2307
2308template <int dim, int spacedim>
2309inline const std::vector<DerivativeForm<4, dim, spacedim>> &
2311{
2312 Assert(this->update_flags & update_jacobian_3rd_derivatives,
2313 ExcAccessToUninitializedField("update_jacobian_3rd_derivatives"));
2314 Assert(present_cell.is_initialized(), ExcNotReinited());
2315 return this->mapping_output.jacobian_3rd_derivatives;
2316}
2317
2318
2319
2320template <int dim, int spacedim>
2321inline const Tensor<5, spacedim> &
2323 const unsigned int q_point) const
2324{
2326 ExcAccessToUninitializedField(
2327 "update_jacobian_pushed_forward_3rd_derivatives"));
2328 Assert(present_cell.is_initialized(), ExcNotReinited());
2329 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[q_point];
2330}
2331
2332
2333
2334template <int dim, int spacedim>
2335inline const std::vector<Tensor<5, spacedim>> &
2337{
2339 ExcAccessToUninitializedField(
2340 "update_jacobian_pushed_forward_3rd_derivatives"));
2341 Assert(present_cell.is_initialized(), ExcNotReinited());
2342 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
2343}
2344
2345
2346
2347template <int dim, int spacedim>
2348inline const std::vector<DerivativeForm<1, spacedim, dim>> &
2350{
2351 Assert(this->update_flags & update_inverse_jacobians,
2352 ExcAccessToUninitializedField("update_inverse_jacobians"));
2353 Assert(present_cell.is_initialized(), ExcNotReinited());
2354 return this->mapping_output.inverse_jacobians;
2355}
2356
2357
2358
2359template <int dim, int spacedim>
2362{
2364 0U, dofs_per_cell);
2365}
2366
2367
2368
2369template <int dim, int spacedim>
2372 const unsigned int start_dof_index) const
2373{
2374 Assert(start_dof_index <= dofs_per_cell,
2375 ExcIndexRange(start_dof_index, 0, dofs_per_cell + 1));
2377 start_dof_index, dofs_per_cell);
2378}
2379
2380
2381
2382template <int dim, int spacedim>
2385 const unsigned int end_dof_index) const
2386{
2387 Assert(end_dof_index < dofs_per_cell,
2388 ExcIndexRange(end_dof_index, 0, dofs_per_cell));
2390 0U, end_dof_index + 1);
2391}
2392
2393
2394
2395template <int dim, int spacedim>
2398{
2400 0U, n_quadrature_points);
2401}
2402
2403
2404
2405template <int dim, int spacedim>
2406inline const Point<spacedim> &
2407FEValuesBase<dim, spacedim>::quadrature_point(const unsigned int q_point) const
2408{
2409 Assert(this->update_flags & update_quadrature_points,
2410 ExcAccessToUninitializedField("update_quadrature_points"));
2411 AssertIndexRange(q_point, this->mapping_output.quadrature_points.size());
2412 Assert(present_cell.is_initialized(), ExcNotReinited());
2413
2414 return this->mapping_output.quadrature_points[q_point];
2415}
2416
2417
2418
2419template <int dim, int spacedim>
2420inline double
2421FEValuesBase<dim, spacedim>::JxW(const unsigned int q_point) const
2422{
2423 Assert(this->update_flags & update_JxW_values,
2424 ExcAccessToUninitializedField("update_JxW_values"));
2425 AssertIndexRange(q_point, this->mapping_output.JxW_values.size());
2426 Assert(present_cell.is_initialized(), ExcNotReinited());
2427
2428 return this->mapping_output.JxW_values[q_point];
2429}
2430
2431
2432
2433template <int dim, int spacedim>
2435FEValuesBase<dim, spacedim>::jacobian(const unsigned int q_point) const
2436{
2437 Assert(this->update_flags & update_jacobians,
2438 ExcAccessToUninitializedField("update_jacobians"));
2439 AssertIndexRange(q_point, this->mapping_output.jacobians.size());
2440 Assert(present_cell.is_initialized(), ExcNotReinited());
2441
2442 return this->mapping_output.jacobians[q_point];
2443}
2444
2445
2446
2447template <int dim, int spacedim>
2449FEValuesBase<dim, spacedim>::jacobian_grad(const unsigned int q_point) const
2450{
2451 Assert(this->update_flags & update_jacobian_grads,
2452 ExcAccessToUninitializedField("update_jacobians_grads"));
2453 AssertIndexRange(q_point, this->mapping_output.jacobian_grads.size());
2454 Assert(present_cell.is_initialized(), ExcNotReinited());
2455
2456 return this->mapping_output.jacobian_grads[q_point];
2457}
2458
2459
2460
2461template <int dim, int spacedim>
2463FEValuesBase<dim, spacedim>::inverse_jacobian(const unsigned int q_point) const
2464{
2465 Assert(this->update_flags & update_inverse_jacobians,
2466 ExcAccessToUninitializedField("update_inverse_jacobians"));
2467 AssertIndexRange(q_point, this->mapping_output.inverse_jacobians.size());
2468 Assert(present_cell.is_initialized(), ExcNotReinited());
2469
2470 return this->mapping_output.inverse_jacobians[q_point];
2471}
2472
2473
2474
2475template <int dim, int spacedim>
2476inline const Tensor<1, spacedim> &
2477FEValuesBase<dim, spacedim>::normal_vector(const unsigned int q_point) const
2478{
2479 Assert(this->update_flags & update_normal_vectors,
2481 "update_normal_vectors")));
2482 AssertIndexRange(q_point, this->mapping_output.normal_vectors.size());
2483 Assert(present_cell.is_initialized(), ExcNotReinited());
2484
2485 return this->mapping_output.normal_vectors[q_point];
2486}
2487
2488#endif
2489
2491
2492#endif
typename LevelSelector::cell_iterator level_cell_iterator
types::global_dof_index n_dofs_for_dof_handler() const
void get_interpolated_dof_values(const ReadVector< Number > &in, ArrayView< Number > out) const
std::optional< std::variant< typename Triangulation< dim, spacedim >::cell_iterator, typename DoFHandler< dim, spacedim >::cell_iterator, typename DoFHandler< dim, spacedim >::level_cell_iterator > > cell
CellSimilarity::Similarity cell_similarity
const Tensor< 5, spacedim > & jacobian_pushed_forward_3rd_derivative(const unsigned int q_point) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices_ending_at(const unsigned int end_dof_index) const
const FEValuesViews::Vector< dim, spacedim > & operator[](const FEValuesExtractors::Vector &vector) const
const std::vector< double > & get_JxW_values() const
const DerivativeForm< 1, dim, spacedim > & jacobian(const unsigned int q_point) const
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
FEValuesBase(const FEValuesBase &)=delete
const FEValuesViews::Scalar< dim, spacedim > & operator[](const FEValuesExtractors::Scalar &scalar) const
Triangulation< dim, spacedim >::cell_iterator get_cell() const
void get_function_values(const ReadVector< Number > &fe_function, std::vector< Number > &values) const
const std::vector< Point< spacedim > > & get_quadrature_points() const
boost::signals2::connection tria_listener_any_change
const std::vector< DerivativeForm< 1, dim, spacedim > > & get_jacobians() const
const DerivativeForm< 2, dim, spacedim > & jacobian_grad(const unsigned int q_point) const
internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > mapping_output
virtual ~FEValuesBase() override
const std::vector< DerivativeForm< 3, dim, spacedim > > & get_jacobian_2nd_derivatives() const
UpdateFlags get_update_flags() const
const FEValuesViews::Tensor< 2, dim, spacedim > & operator[](const FEValuesExtractors::Tensor< 2 > &tensor) const
const unsigned int dofs_per_cell
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
Tensor< 3, spacedim > shape_3rd_derivative_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
CellIteratorWrapper present_cell
const Tensor< 1, spacedim > & normal_vector(const unsigned int q_point) const
UpdateFlags update_flags
static constexpr unsigned int space_dimension
Tensor< 2, spacedim > shape_hessian_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
void get_function_hessians(const ReadVector< Number > &fe_function, std::vector< Tensor< 2, spacedim, Number > > &hessians) const
void always_allow_check_for_cell_similarity(const bool allow)
void get_function_laplacians(const ReadVector< Number > &fe_function, std::vector< Number > &laplacians) const
const Point< spacedim > & quadrature_point(const unsigned int q_point) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices_starting_at(const unsigned int start_dof_index) const
double shape_value_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
const Mapping< dim, spacedim > & get_mapping() const
const unsigned int n_quadrature_points
CellSimilarity::Similarity get_cell_similarity() const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
std::size_t memory_consumption() const
const Tensor< 3, spacedim > & jacobian_pushed_forward_grad(const unsigned int q_point) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > quadrature_point_indices() const
void get_function_third_derivatives(const ReadVector< Number > &fe_function, std::vector< Tensor< 3, spacedim, Number > > &third_derivatives) const
const Tensor< 2, spacedim > & shape_hessian(const unsigned int i, const unsigned int q_point) const
const std::vector< Tensor< 5, spacedim > > & get_jacobian_pushed_forward_3rd_derivatives() const
const Tensor< 4, spacedim > & jacobian_pushed_forward_2nd_derivative(const unsigned int q_point) const
const Tensor< 3, spacedim > & shape_3rd_derivative(const unsigned int i, const unsigned int q_point) const
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > mapping_data
void get_function_gradients(const ReadVector< Number > &fe_function, std::vector< Tensor< 1, spacedim, Number > > &gradients) const
const std::vector< DerivativeForm< 2, dim, spacedim > > & get_jacobian_grads() const
const std::vector< Tensor< 3, spacedim > > & get_jacobian_pushed_forward_grads() const
const DerivativeForm< 4, dim, spacedim > & jacobian_3rd_derivative(const unsigned int q_point) const
const DerivativeForm< 1, spacedim, dim > & inverse_jacobian(const unsigned int q_point) const
void invalidate_present_cell()
const std::vector< Tensor< 4, spacedim > > & get_jacobian_pushed_forward_2nd_derivatives() const
const DerivativeForm< 3, dim, spacedim > & jacobian_2nd_derivative(const unsigned int q_point) const
const ObserverPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
Tensor< 1, spacedim > shape_grad_component(const unsigned int i, const unsigned int q_point, const unsigned int component) const
bool check_for_cell_similarity_allowed
::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > finite_element_output
const FEValuesViews::SymmetricTensor< 2, dim, spacedim > & operator[](const FEValuesExtractors::SymmetricTensor< 2 > &tensor) const
const ObserverPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
const Tensor< 1, spacedim > & shape_grad(const unsigned int i, const unsigned int q_point) const
const std::vector< DerivativeForm< 4, dim, spacedim > > & get_jacobian_3rd_derivatives() const
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
const FiniteElement< dim, spacedim > & get_fe() const
double JxW(const unsigned int q_point) const
const double & shape_value(const unsigned int i, const unsigned int q_point) const
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
FEValuesBase & operator=(const FEValuesBase &)=delete
const std::vector< DerivativeForm< 1, spacedim, dim > > & get_inverse_jacobians() const
const unsigned int max_n_quadrature_points
static constexpr unsigned int dimension
Abstract base class for mapping classes.
Definition mapping.h:318
Definition point.h:111
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
static ::ExceptionBase & ExcAccessToUninitializedField(std::string arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotReinited()
static ::ExceptionBase & ExcNeedsDoFHandler()
static ::ExceptionBase & ExcShapeFunctionNotPrimitive(int arg1)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcFEDontMatch()
static ::ExceptionBase & ExcFENotPrimitive()
typename ActiveSelector::cell_iterator cell_iterator
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
Definition tria.h:1621
UpdateFlags
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_jacobian_pushed_forward_grads
@ update_hessians
Second derivatives of shape functions.
@ update_jacobian_3rd_derivatives
@ update_values
Shape function values.
@ update_jacobian_grads
Gradient of volume element.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_JxW_values
Transformed quadrature weights.
@ update_jacobians
Volume element.
@ update_inverse_jacobians
Volume element.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
@ update_jacobian_pushed_forward_3rd_derivatives
@ update_jacobian_2nd_derivatives
*  *  *  ScaleZFunction< dim, Number, components >::ScaleZFunction *  component(component)
std::vector< unsigned int > make_shape_function_to_row_table(const FiniteElement< dim, spacedim > &fe)
boost::integer_range< IncrementableType > iota_view
Definition iota_view.h:43
std::vector< Lazy<::FEValuesViews::Vector< dim, spacedim > > > vectors
std::vector< Lazy<::FEValuesViews::SymmetricTensor< 2, dim, spacedim > > > symmetric_second_order_tensors
std::vector< Lazy<::FEValuesViews::Tensor< 2, dim, spacedim > > > second_order_tensors
std::vector< Lazy<::FEValuesViews::Scalar< dim, spacedim > > > scalars