48#include <boost/container/small_vector.hpp>
59 template <
class VectorType>
61 const VectorType & vector,
78 template <
int dim,
int spacedim>
79 inline std::vector<unsigned int>
82 std::vector<unsigned int> shape_function_to_row_table(
85 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
92 for (
unsigned int c = 0; c < fe.n_components(); ++c)
93 if (fe.get_nonzero_components(i)[c] ==
true)
95 shape_function_to_row_table[i * fe.n_components() + c] =
99 row += fe.n_nonzero_components(i);
102 return shape_function_to_row_table;
109 template <
typename Number,
typename T =
void>
124 template <
typename Number>
127 std::
enable_if_t<Differentiation::AD::is_ad_number<Number>::value>>
130 value(
const Number & )
142 template <
int dim,
int spacedim>
144 const unsigned int component)
145 : fe_values(&fe_values)
146 , component(component)
147 , shape_function_data(
this->fe_values->fe->n_dofs_per_cell())
155 const std::vector<unsigned int> shape_function_to_row_table =
158 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
160 const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
162 if (is_primitive ==
true)
164 (
component == fe.system_to_component_index(i).first);
167 (fe.get_nonzero_components(i)[
component] ==
true);
171 shape_function_to_row_table[i * fe.n_components() +
component];
179 template <
int dim,
int spacedim>
182 , component(
numbers::invalid_unsigned_int)
187 template <
int dim,
int spacedim>
189 const unsigned int first_vector_component)
190 : fe_values(&fe_values)
191 , first_vector_component(first_vector_component)
192 , shape_function_data(
this->fe_values->fe->n_dofs_per_cell())
200 const std::vector<unsigned int> shape_function_to_row_table =
203 for (
unsigned int d = 0; d < spacedim; ++d)
207 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
209 const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
211 if (is_primitive ==
true)
213 (component == fe.system_to_component_index(i).first);
216 (fe.get_nonzero_components(i)[component] ==
true);
221 shape_function_to_row_table[i * fe.n_components() + component];
228 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
230 unsigned int n_nonzero_components = 0;
231 for (
unsigned int d = 0; d < spacedim; ++d)
234 ++n_nonzero_components;
236 if (n_nonzero_components == 0)
238 else if (n_nonzero_components > 1)
242 for (
unsigned int d = 0; d < spacedim; ++d)
244 .is_nonzero_shape_function_component[d] ==
true)
257 template <
int dim,
int spacedim>
260 , first_vector_component(
numbers::invalid_unsigned_int)
265 template <
int dim,
int spacedim>
268 const unsigned int first_tensor_component)
269 : fe_values(&fe_values)
270 , first_tensor_component(first_tensor_component)
271 , shape_function_data(
this->fe_values->fe->n_dofs_per_cell())
274 Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 <
277 first_tensor_component +
284 const std::vector<unsigned int> shape_function_to_row_table =
287 for (
unsigned int d = 0;
291 const unsigned int component = first_tensor_component + d;
293 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
295 const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
297 if (is_primitive ==
true)
298 shape_function_data[i].is_nonzero_shape_function_component[d] =
299 (component == fe.system_to_component_index(i).first);
301 shape_function_data[i].is_nonzero_shape_function_component[d] =
302 (fe.get_nonzero_components(i)[component] ==
true);
304 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
306 shape_function_data[i].row_index[d] =
307 shape_function_to_row_table[i * fe.n_components() + component];
309 shape_function_data[i].row_index[d] =
314 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
316 unsigned int n_nonzero_components = 0;
317 for (
unsigned int d = 0;
320 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
322 ++n_nonzero_components;
324 if (n_nonzero_components == 0)
325 shape_function_data[i].single_nonzero_component = -2;
326 else if (n_nonzero_components > 1)
327 shape_function_data[i].single_nonzero_component = -1;
330 for (
unsigned int d = 0;
333 if (shape_function_data[i]
334 .is_nonzero_shape_function_component[d] ==
true)
336 shape_function_data[i].single_nonzero_component =
337 shape_function_data[i].row_index[d];
338 shape_function_data[i].single_nonzero_component_index = d;
347 template <
int dim,
int spacedim>
350 , first_tensor_component(
numbers::invalid_unsigned_int)
355 template <
int dim,
int spacedim>
357 const unsigned int first_tensor_component)
358 : fe_values(&fe_values)
359 , first_tensor_component(first_tensor_component)
360 , shape_function_data(
this->fe_values->fe->n_dofs_per_cell())
363 AssertIndexRange(first_tensor_component + dim * dim - 1, fe.n_components());
367 const std::vector<unsigned int> shape_function_to_row_table =
370 for (
unsigned int d = 0; d < dim * dim; ++d)
372 const unsigned int component = first_tensor_component + d;
374 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
376 const bool is_primitive = fe.is_primitive() || fe.is_primitive(i);
378 if (is_primitive ==
true)
379 shape_function_data[i].is_nonzero_shape_function_component[d] =
380 (component == fe.system_to_component_index(i).first);
382 shape_function_data[i].is_nonzero_shape_function_component[d] =
383 (fe.get_nonzero_components(i)[component] ==
true);
385 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
387 shape_function_data[i].row_index[d] =
388 shape_function_to_row_table[i * fe.n_components() + component];
390 shape_function_data[i].row_index[d] =
395 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
397 unsigned int n_nonzero_components = 0;
398 for (
unsigned int d = 0; d < dim * dim; ++d)
399 if (shape_function_data[i].is_nonzero_shape_function_component[d] ==
401 ++n_nonzero_components;
403 if (n_nonzero_components == 0)
404 shape_function_data[i].single_nonzero_component = -2;
405 else if (n_nonzero_components > 1)
406 shape_function_data[i].single_nonzero_component = -1;
409 for (
unsigned int d = 0; d < dim * dim; ++d)
410 if (shape_function_data[i]
411 .is_nonzero_shape_function_component[d] ==
true)
413 shape_function_data[i].single_nonzero_component =
414 shape_function_data[i].row_index[d];
415 shape_function_data[i].single_nonzero_component_index = d;
424 template <
int dim,
int spacedim>
427 , first_tensor_component(
numbers::invalid_unsigned_int)
438 template <
int dim,
int spacedim,
typename Number>
444 &shape_function_data,
448 const unsigned int n_quadrature_points = values.size();
450 std::fill(values.begin(),
457 .is_nonzero_shape_function_component)
463 if (::internal::CheckForZero<Number>::value(value) ==
true)
478 template <
int order,
int dim,
int spacedim,
typename Number>
484 &shape_function_data,
500 .is_nonzero_shape_function_component)
506 if (::internal::CheckForZero<Number>::value(value) ==
true)
520 template <
int dim,
int spacedim,
typename Number>
526 &shape_function_data,
542 .is_nonzero_shape_function_component)
548 if (::internal::CheckForZero<Number>::value(value) ==
true)
552 &shape_hessians[shape_function_data[
shape_function].row_index][0];
563 template <
int dim,
int spacedim,
typename Number>
569 &shape_function_data,
575 const unsigned int n_quadrature_points = values.size();
596 if (::internal::CheckForZero<Number>::value(value) ==
true)
602 .single_nonzero_component_index;
609 for (
unsigned int d = 0; d < spacedim; ++d)
611 .is_nonzero_shape_function_component[d])
624 template <
int order,
int dim,
int spacedim,
typename Number>
630 &shape_function_data,
658 if (::internal::CheckForZero<Number>::value(value) ==
true)
664 .single_nonzero_component_index;
666 &shape_derivatives[
snc][0];
672 for (
unsigned int d = 0; d < spacedim; ++d)
674 .is_nonzero_shape_function_component[d])
689 template <
int dim,
int spacedim,
typename Number>
695 &shape_function_data,
724 if (::internal::CheckForZero<Number>::value(value) ==
true)
730 .single_nonzero_component_index;
732 &shape_gradients[
snc][0];
745 for (
unsigned int d = 0; d < spacedim; ++d)
747 .is_nonzero_shape_function_component[d])
759 template <
int dim,
int spacedim,
typename Number>
765 &shape_function_data,
792 if (::internal::CheckForZero<Number>::value(value) ==
true)
798 .single_nonzero_component_index;
800 &shape_gradients[
snc][0];
806 for (
unsigned int d = 0; d < spacedim; ++d)
808 .is_nonzero_shape_function_component[d])
822 template <
int dim,
int spacedim,
typename Number>
828 &shape_function_data,
831 typename ::internal::CurlType<spacedim>::type>::type> &
curls)
834 const unsigned int n_quadrature_points =
curls.
size();
840 typename ::internal::CurlType<spacedim>::type>::type());
848 "Computing the curl in 1d is not a useful operation"));
859 .single_nonzero_component;
869 if (::internal::CheckForZero<Number>::value(value) ==
876 &shape_gradients[
snc][0];
879 .single_nonzero_component >= 0,
883 .single_nonzero_component_index == 0)
903 .is_nonzero_shape_function_component[0])
918 .is_nonzero_shape_function_component[1])
943 .single_nonzero_component;
953 if (::internal::CheckForZero<Number>::value(value) ==
960 &shape_gradients[
snc][0];
963 .single_nonzero_component_index)
972 value * (*shape_gradient_ptr)[2];
987 value * (*shape_gradient_ptr)[2];
1002 value * (*shape_gradient_ptr)[1];
1021 .is_nonzero_shape_function_component[0])
1028 for (
unsigned int q_point = 0;
1029 q_point < n_quadrature_points;
1033 value * (*shape_gradient_ptr)[2];
1040 .is_nonzero_shape_function_component[1])
1047 for (
unsigned int q_point = 0;
1048 q_point < n_quadrature_points;
1052 value * (*shape_gradient_ptr)[2];
1059 .is_nonzero_shape_function_component[2])
1066 for (
unsigned int q_point = 0;
1067 q_point < n_quadrature_points;
1071 value * (*shape_gradient_ptr)[1];
1084 template <
int dim,
int spacedim,
typename Number>
1090 &shape_function_data,
1117 if (::internal::CheckForZero<Number>::value(value) ==
true)
1123 .single_nonzero_component_index;
1125 &shape_hessians[
snc][0];
1132 for (
unsigned int d = 0; d < spacedim; ++d)
1134 .is_nonzero_shape_function_component[d])
1151 template <
int dim,
int spacedim,
typename Number>
1155 const ::Table<2, double> &shape_values,
1158 &shape_function_data,
1165 const unsigned int n_quadrature_points = values.size();
1187 if (::internal::CheckForZero<Number>::value(value) ==
true)
1195 .single_nonzero_component_index);
1202 for (
unsigned int d = 0;
1207 .is_nonzero_shape_function_component[d])
1223 template <
int dim,
int spacedim,
typename Number>
1230 &shape_function_data,
1256 if (::internal::CheckForZero<Number>::value(value) ==
true)
1262 .single_nonzero_component_index;
1265 &shape_gradients[
snc][0];
1279 value * (*shape_gradient_ptr)[
ii];
1284 for (
unsigned int d = 0;
1287 spacedim>::n_independent_components;
1290 .is_nonzero_shape_function_component[d])
1302 const unsigned int comp =
1304 .single_nonzero_component_index;
1309 for (
unsigned int q_point = 0;
1310 q_point < n_quadrature_points;
1313 for (
unsigned int j = 0;
j < spacedim; ++
j)
1330 template <
int dim,
int spacedim,
typename Number>
1334 const ::Table<2, double> &shape_values,
1336 &shape_function_data,
1342 const unsigned int n_quadrature_points = values.size();
1363 if (::internal::CheckForZero<Number>::value(value) ==
true)
1369 .single_nonzero_component_index;
1381 for (
unsigned int d = 0; d < dim * dim; ++d)
1383 .is_nonzero_shape_function_component[d])
1400 template <
int dim,
int spacedim,
typename Number>
1406 &shape_function_data,
1433 if (::internal::CheckForZero<Number>::value(value) ==
true)
1439 .single_nonzero_component_index;
1442 &shape_gradients[
snc][0];
1447 const unsigned int ii = indices[0];
1448 const unsigned int jj = indices[1];
1458 for (
unsigned int d = 0; d < dim * dim; ++d)
1460 .is_nonzero_shape_function_component[d])
1470 template <
int dim,
int spacedim,
typename Number>
1476 &shape_function_data,
1478 template solution_gradient_type<Number>> &gradients)
1481 const unsigned int n_quadrature_points = gradients.size();
1503 if (::internal::CheckForZero<Number>::value(value) ==
true)
1509 .single_nonzero_component_index;
1512 &shape_gradients[
snc][0];
1517 const unsigned int ii = indices[0];
1518 const unsigned int jj = indices[1];
1523 gradients[
q_point][
ii][
jj] += value * (*shape_gradient_ptr);
1528 for (
unsigned int d = 0; d < dim * dim; ++d)
1530 .is_nonzero_shape_function_component[d])
1542 template <
int dim,
int spacedim>
1543 template <
class InputVector>
1553 Assert(fe_values->present_cell.is_initialized(),
1556 fe_values->present_cell.n_dofs_for_dof_handler());
1561 fe_values->dofs_per_cell);
1562 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1564 internal::do_function_values<dim, spacedim>(
1566 fe_values->finite_element_output.shape_values,
1567 shape_function_data,
1573 template <
int dim,
int spacedim>
1574 template <
class InputVector>
1584 Assert(fe_values->present_cell.is_initialized(),
1588 internal::do_function_values<dim, spacedim>(
1590 fe_values->finite_element_output.shape_values,
1591 shape_function_data,
1597 template <
int dim,
int spacedim>
1598 template <
class InputVector>
1607 "update_gradients")));
1608 Assert(fe_values->present_cell.is_initialized(),
1611 fe_values->present_cell.n_dofs_for_dof_handler());
1615 fe_values->dofs_per_cell);
1616 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1618 internal::do_function_derivatives<1, dim, spacedim>(
1620 fe_values->finite_element_output.shape_gradients,
1621 shape_function_data,
1627 template <
int dim,
int spacedim>
1628 template <
class InputVector>
1637 "update_gradients")));
1638 Assert(fe_values->present_cell.is_initialized(),
1642 internal::do_function_derivatives<1, dim, spacedim>(
1644 fe_values->finite_element_output.shape_gradients,
1645 shape_function_data,
1651 template <
int dim,
int spacedim>
1652 template <
class InputVector>
1661 "update_hessians")));
1662 Assert(fe_values->present_cell.is_initialized(),
1665 fe_values->present_cell.n_dofs_for_dof_handler());
1669 fe_values->dofs_per_cell);
1670 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1672 internal::do_function_derivatives<2, dim, spacedim>(
1674 fe_values->finite_element_output.shape_hessians,
1675 shape_function_data,
1681 template <
int dim,
int spacedim>
1682 template <
class InputVector>
1691 "update_hessians")));
1692 Assert(fe_values->present_cell.is_initialized(),
1696 internal::do_function_derivatives<2, dim, spacedim>(
1698 fe_values->finite_element_output.shape_hessians,
1699 shape_function_data,
1705 template <
int dim,
int spacedim>
1706 template <
class InputVector>
1715 "update_hessians")));
1716 Assert(fe_values->present_cell.is_initialized(),
1719 fe_values->present_cell.n_dofs_for_dof_handler());
1723 fe_values->dofs_per_cell);
1724 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1726 internal::do_function_laplacians<dim, spacedim>(
1728 fe_values->finite_element_output.shape_hessians,
1729 shape_function_data,
1735 template <
int dim,
int spacedim>
1736 template <
class InputVector>
1745 "update_hessians")));
1746 Assert(fe_values->present_cell.is_initialized(),
1750 internal::do_function_laplacians<dim, spacedim>(
1752 fe_values->finite_element_output.shape_hessians,
1753 shape_function_data,
1759 template <
int dim,
int spacedim>
1760 template <
class InputVector>
1770 "update_3rd_derivatives")));
1771 Assert(fe_values->present_cell.is_initialized(),
1774 fe_values->present_cell.n_dofs_for_dof_handler());
1778 fe_values->dofs_per_cell);
1779 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1781 internal::do_function_derivatives<3, dim, spacedim>(
1783 fe_values->finite_element_output.shape_3rd_derivatives,
1784 shape_function_data,
1790 template <
int dim,
int spacedim>
1791 template <
class InputVector>
1801 "update_3rd_derivatives")));
1802 Assert(fe_values->present_cell.is_initialized(),
1806 internal::do_function_derivatives<3, dim, spacedim>(
1808 fe_values->finite_element_output.shape_3rd_derivatives,
1809 shape_function_data,
1815 template <
int dim,
int spacedim>
1816 template <
class InputVector>
1826 Assert(fe_values->present_cell.is_initialized(),
1829 fe_values->present_cell.n_dofs_for_dof_handler());
1833 fe_values->dofs_per_cell);
1834 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1836 internal::do_function_values<dim, spacedim>(
1838 fe_values->finite_element_output.shape_values,
1839 shape_function_data,
1845 template <
int dim,
int spacedim>
1846 template <
class InputVector>
1856 Assert(fe_values->present_cell.is_initialized(),
1860 internal::do_function_values<dim, spacedim>(
1862 fe_values->finite_element_output.shape_values,
1863 shape_function_data,
1869 template <
int dim,
int spacedim>
1870 template <
class InputVector>
1879 "update_gradients")));
1880 Assert(fe_values->present_cell.is_initialized(),
1883 fe_values->present_cell.n_dofs_for_dof_handler());
1887 fe_values->dofs_per_cell);
1888 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1890 internal::do_function_derivatives<1, dim, spacedim>(
1892 fe_values->finite_element_output.shape_gradients,
1893 shape_function_data,
1899 template <
int dim,
int spacedim>
1900 template <
class InputVector>
1909 "update_gradients")));
1910 Assert(fe_values->present_cell.is_initialized(),
1914 internal::do_function_derivatives<1, dim, spacedim>(
1916 fe_values->finite_element_output.shape_gradients,
1917 shape_function_data,
1923 template <
int dim,
int spacedim>
1924 template <
class InputVector>
1934 "update_gradients")));
1935 Assert(fe_values->present_cell.is_initialized(),
1938 fe_values->present_cell.n_dofs_for_dof_handler());
1942 fe_values->dofs_per_cell);
1943 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
1945 internal::do_function_symmetric_gradients<dim, spacedim>(
1947 fe_values->finite_element_output.shape_gradients,
1948 shape_function_data,
1954 template <
int dim,
int spacedim>
1955 template <
class InputVector>
1965 "update_gradients")));
1966 Assert(fe_values->present_cell.is_initialized(),
1970 internal::do_function_symmetric_gradients<dim, spacedim>(
1972 fe_values->finite_element_output.shape_gradients,
1973 shape_function_data,
1979 template <
int dim,
int spacedim>
1980 template <
class InputVector>
1989 "update_gradients")));
1990 Assert(fe_values->present_cell.is_initialized(),
1993 fe_values->present_cell.n_dofs_for_dof_handler());
1998 fe_values->dofs_per_cell);
1999 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2001 internal::do_function_divergences<dim, spacedim>(
2003 fe_values->finite_element_output.shape_gradients,
2004 shape_function_data,
2010 template <
int dim,
int spacedim>
2011 template <
class InputVector>
2020 "update_gradients")));
2021 Assert(fe_values->present_cell.is_initialized(),
2025 internal::do_function_divergences<dim, spacedim>(
2027 fe_values->finite_element_output.shape_gradients,
2028 shape_function_data,
2034 template <
int dim,
int spacedim>
2035 template <
class InputVector>
2044 "update_gradients")));
2045 Assert(fe_values->present_cell.is_initialized(),
2046 ExcMessage(
"FEValues object is not reinited to any cell"));
2048 fe_values->present_cell.n_dofs_for_dof_handler());
2052 fe_values->dofs_per_cell);
2053 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2055 internal::do_function_curls<dim, spacedim>(
2057 fe_values->finite_element_output.shape_gradients,
2058 shape_function_data,
2064 template <
int dim,
int spacedim>
2065 template <
class InputVector>
2074 "update_gradients")));
2075 Assert(fe_values->present_cell.is_initialized(),
2076 ExcMessage(
"FEValues object is not reinited to any cell"));
2079 internal::do_function_curls<dim, spacedim>(
2081 fe_values->finite_element_output.shape_gradients,
2082 shape_function_data,
2088 template <
int dim,
int spacedim>
2089 template <
class InputVector>
2098 "update_hessians")));
2099 Assert(fe_values->present_cell.is_initialized(),
2102 fe_values->present_cell.n_dofs_for_dof_handler());
2106 fe_values->dofs_per_cell);
2107 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2109 internal::do_function_derivatives<2, dim, spacedim>(
2111 fe_values->finite_element_output.shape_hessians,
2112 shape_function_data,
2118 template <
int dim,
int spacedim>
2119 template <
class InputVector>
2128 "update_hessians")));
2129 Assert(fe_values->present_cell.is_initialized(),
2133 internal::do_function_derivatives<2, dim, spacedim>(
2135 fe_values->finite_element_output.shape_hessians,
2136 shape_function_data,
2142 template <
int dim,
int spacedim>
2143 template <
class InputVector>
2152 "update_hessians")));
2155 fe_values->n_quadrature_points));
2156 Assert(fe_values->present_cell.is_initialized(),
2159 fe_function.
size() == fe_values->present_cell.n_dofs_for_dof_handler(),
2161 fe_values->present_cell.n_dofs_for_dof_handler()));
2165 fe_values->dofs_per_cell);
2166 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2168 internal::do_function_laplacians<dim, spacedim>(
2170 fe_values->finite_element_output.shape_hessians,
2171 shape_function_data,
2177 template <
int dim,
int spacedim>
2178 template <
class InputVector>
2187 "update_hessians")));
2190 fe_values->n_quadrature_points));
2191 Assert(fe_values->present_cell.is_initialized(),
2195 internal::do_function_laplacians<dim, spacedim>(
2197 fe_values->finite_element_output.shape_hessians,
2198 shape_function_data,
2204 template <
int dim,
int spacedim>
2205 template <
class InputVector>
2215 "update_3rd_derivatives")));
2216 Assert(fe_values->present_cell.is_initialized(),
2219 fe_values->present_cell.n_dofs_for_dof_handler());
2223 fe_values->dofs_per_cell);
2224 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2226 internal::do_function_derivatives<3, dim, spacedim>(
2228 fe_values->finite_element_output.shape_3rd_derivatives,
2229 shape_function_data,
2235 template <
int dim,
int spacedim>
2236 template <
class InputVector>
2246 "update_3rd_derivatives")));
2247 Assert(fe_values->present_cell.is_initialized(),
2251 internal::do_function_derivatives<3, dim, spacedim>(
2253 fe_values->finite_element_output.shape_3rd_derivatives,
2254 shape_function_data,
2260 template <
int dim,
int spacedim>
2261 template <
class InputVector>
2271 Assert(fe_values->present_cell.is_initialized(),
2274 fe_values->present_cell.n_dofs_for_dof_handler());
2278 fe_values->dofs_per_cell);
2279 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2281 internal::do_function_values<dim, spacedim>(
2283 fe_values->finite_element_output.shape_values,
2284 shape_function_data,
2290 template <
int dim,
int spacedim>
2291 template <
class InputVector>
2301 Assert(fe_values->present_cell.is_initialized(),
2305 internal::do_function_values<dim, spacedim>(
2307 fe_values->finite_element_output.shape_values,
2308 shape_function_data,
2314 template <
int dim,
int spacedim>
2315 template <
class InputVector>
2324 "update_gradients")));
2325 Assert(fe_values->present_cell.is_initialized(),
2328 fe_values->present_cell.n_dofs_for_dof_handler());
2333 fe_values->dofs_per_cell);
2334 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2336 internal::do_function_divergences<dim, spacedim>(
2338 fe_values->finite_element_output.shape_gradients,
2339 shape_function_data,
2345 template <
int dim,
int spacedim>
2346 template <
class InputVector>
2356 "update_gradients")));
2357 Assert(fe_values->present_cell.is_initialized(),
2361 internal::do_function_divergences<dim, spacedim>(
2363 fe_values->finite_element_output.shape_gradients,
2364 shape_function_data,
2370 template <
int dim,
int spacedim>
2371 template <
class InputVector>
2381 Assert(fe_values->present_cell.is_initialized(),
2384 fe_values->present_cell.n_dofs_for_dof_handler());
2388 fe_values->dofs_per_cell);
2389 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2391 internal::do_function_values<dim, spacedim>(
2393 fe_values->finite_element_output.shape_values,
2394 shape_function_data,
2400 template <
int dim,
int spacedim>
2401 template <
class InputVector>
2411 Assert(fe_values->present_cell.is_initialized(),
2415 internal::do_function_values<dim, spacedim>(
2417 fe_values->finite_element_output.shape_values,
2418 shape_function_data,
2424 template <
int dim,
int spacedim>
2425 template <
class InputVector>
2434 "update_gradients")));
2435 Assert(fe_values->present_cell.is_initialized(),
2438 fe_values->present_cell.n_dofs_for_dof_handler());
2443 fe_values->dofs_per_cell);
2444 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2446 internal::do_function_divergences<dim, spacedim>(
2448 fe_values->finite_element_output.shape_gradients,
2449 shape_function_data,
2455 template <
int dim,
int spacedim>
2456 template <
class InputVector>
2465 "update_gradients")));
2466 Assert(fe_values->present_cell.is_initialized(),
2470 internal::do_function_divergences<dim, spacedim>(
2472 fe_values->finite_element_output.shape_gradients,
2473 shape_function_data,
2479 template <
int dim,
int spacedim>
2480 template <
class InputVector>
2489 "update_gradients")));
2490 Assert(fe_values->present_cell.is_initialized(),
2493 fe_values->present_cell.n_dofs_for_dof_handler());
2498 fe_values->dofs_per_cell);
2499 fe_values->present_cell.get_interpolated_dof_values(
fe_function,
2501 internal::do_function_gradients<dim, spacedim>(
2503 fe_values->finite_element_output.shape_gradients,
2504 shape_function_data,
2510 template <
int dim,
int spacedim>
2511 template <
class InputVector>
2520 "update_gradients")));
2521 Assert(fe_values->present_cell.is_initialized(),
2525 internal::do_function_gradients<dim, spacedim>(
2527 fe_values->finite_element_output.shape_gradients,
2528 shape_function_data,
2539 template <
int dim,
int spacedim>
2544 const unsigned int n_scalars = fe.n_components();
2546 for (
unsigned int component = 0; component <
n_scalars; ++component)
2547 scalars.emplace_back(fe_values, component);
2552 const unsigned int n_vectors =
2557 vectors.reserve(n_vectors);
2558 for (
unsigned int component = 0; component < n_vectors; ++component)
2559 vectors.emplace_back(fe_values, component);
2563 (fe.n_components() >=
2569 for (
unsigned int component = 0;
2572 symmetric_second_order_tensors.emplace_back(fe_values, component);
2584 second_order_tensors.emplace_back(fe_values, component);
2593template <
int dim,
int spacedim>
2595 : initialized(
false)
2598 , level_dof_access(
false)
2603template <
int dim,
int spacedim>
2609 , level_dof_access(
false)
2614template <
int dim,
int spacedim>
2623template <
int dim,
int spacedim>
2634template <
int dim,
int spacedim>
2640 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2642 return dof_handler->n_dofs();
2647template <
int dim,
int spacedim>
2648template <
typename VectorType>
2651 const VectorType & in,
2655 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2657 if (level_dof_access)
2662 .get_interpolated_dof_values(in, out);
2668 .get_interpolated_dof_values(in, out);
2673template <
int dim,
int spacedim>
2680 Assert(dof_handler !=
nullptr, ExcNeedsDoFHandler());
2684 &cell->get_triangulation(), cell->level(), cell->index(), dof_handler);
2690 for (
unsigned int i = 0; i <
cell_dofs.get_fe().n_dofs_per_cell(); ++i)
2698 namespace FEValuesImplementation
2700 template <
int dim,
int spacedim>
2703 const unsigned int n_quadrature_points,
2710 this->shape_function_to_row_table =
2716 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
2726 n_quadrature_points);
2727 this->shape_values.fill(numbers::signaling_nan<double>());
2733 n_quadrature_points);
2734 this->shape_gradients.fill(
2741 n_quadrature_points);
2742 this->shape_hessians.fill(
2749 n_quadrature_points);
2750 this->shape_3rd_derivatives.fill(
2757 template <
int dim,
int spacedim>
2776template <
int dim,
int spacedim>
2778 const unsigned int n_q_points,
2792 ExcMessage(
"There is nothing useful you can do with an FEValues "
2793 "object when using a quadrature formula with zero "
2794 "quadrature points!"));
2800template <
int dim,
int spacedim>
2803 tria_listener_refinement.disconnect();
2804 tria_listener_mesh_transform.disconnect();
2818 template <
typename Number,
typename Number2>
2821 const ::Table<2, double> &shape_values,
2822 std::vector<Number> & values)
2825 const unsigned int dofs_per_cell = shape_values.n_rows();
2826 const unsigned int n_quadrature_points = values.size();
2829 std::fill_n(values.begin(),
2830 n_quadrature_points,
2851 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
2858 template <
int dim,
int spacedim,
typename VectorType>
2862 const ::Table<2, double> & shape_values,
2864 const std::vector<unsigned int> &shape_function_to_row_table,
2869 using Number =
typename VectorType::value_type;
2871 for (
unsigned int i = 0; i < values.size(); ++i)
2872 std::fill_n(values[i].begin(),
2874 typename VectorType::value_type());
2878 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
2879 if (dofs_per_cell == 0)
2882 const unsigned int n_quadrature_points =
2884 const unsigned int n_components = fe.n_components();
2892 for (
unsigned int i = 0; i < values.size(); ++i)
2898 for (
unsigned int i = 0; i < values.size(); ++i)
2913 if (::internal::CheckForZero<Number>::value(
value) ==
true)
2918 const unsigned int comp =
2919 fe.system_to_component_index(
shape_func).first +
2921 const unsigned int row =
2929 for (
unsigned int point = 0; point < n_quadrature_points;
2934 for (
unsigned int point = 0; point < n_quadrature_points;
2939 for (
unsigned int c = 0; c < n_components; ++c)
2941 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
2944 const unsigned int row =
2945 shape_function_to_row_table[
shape_func * n_components + c];
2948 const unsigned int comp = c +
mc * n_components;
2953 for (
unsigned int point = 0; point < n_quadrature_points;
2958 for (
unsigned int point = 0; point < n_quadrature_points;
2969 template <
int order,
int spacedim,
typename Number>
2976 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
2981 n_quadrature_points,
2997 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3002 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
3009 template <
int order,
int dim,
int spacedim,
typename Number>
3015 const std::vector<unsigned int> &shape_function_to_row_table,
3028 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
3029 if (dofs_per_cell == 0)
3033 const unsigned int n_quadrature_points =
3035 const unsigned int n_components = fe.n_components();
3064 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3069 const unsigned int comp =
3070 fe.system_to_component_index(
shape_func).first +
3072 const unsigned int row =
3076 &shape_derivatives[row][0];
3079 for (
unsigned int point = 0; point < n_quadrature_points;
3083 for (
unsigned int point = 0; point < n_quadrature_points;
3088 for (
unsigned int c = 0; c < n_components; ++c)
3090 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
3093 const unsigned int row =
3094 shape_function_to_row_table[
shape_func * n_components + c];
3097 &shape_derivatives[row][0];
3098 const unsigned int comp = c +
mc * n_components;
3101 for (
unsigned int point = 0; point < n_quadrature_points;
3106 for (
unsigned int point = 0; point < n_quadrature_points;
3116 template <
int spacedim,
typename Number,
typename Number2>
3123 const unsigned int dofs_per_cell = shape_hessians.
size()[0];
3128 n_quadrature_points,
3146 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
3153 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3159 const std::vector<unsigned int> & shape_function_to_row_table,
3168 typename VectorType::value_type());
3172 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
3173 if (dofs_per_cell == 0)
3178 const unsigned int n_components = fe.n_components();
3207 if (::internal::CheckForZero<Number>::value(
value) ==
true)
3212 const unsigned int comp =
3213 fe.system_to_component_index(
shape_func).first +
3215 const unsigned int row =
3219 &shape_hessians[row][0];
3223 for (
unsigned int point = 0; point < n_quadrature_points;
3229 for (
unsigned int point = 0; point < n_quadrature_points;
3235 for (
unsigned int c = 0; c < n_components; ++c)
3237 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
3240 const unsigned int row =
3241 shape_function_to_row_table[
shape_func * n_components + c];
3244 &shape_hessians[row][0];
3245 const unsigned int comp = c +
mc * n_components;
3250 for (
unsigned int point = 0; point < n_quadrature_points;
3256 for (
unsigned int point = 0; point < n_quadrature_points;
3267template <
int dim,
int spacedim>
3268template <
class InputVector>
3272 std::vector<typename InputVector::value_type> &values)
const
3276 ExcAccessToUninitializedField(
"update_values"));
3278 Assert(present_cell.is_initialized(), ExcNotReinited());
3286 this->finite_element_output.shape_values,
3292template <
int dim,
int spacedim>
3293template <
class InputVector>
3298 std::vector<typename InputVector::value_type> & values)
const
3302 ExcAccessToUninitializedField(
"update_values"));
3306 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3307 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3311 this->finite_element_output.shape_values,
3317template <
int dim,
int spacedim>
3318template <
class InputVector>
3325 Assert(present_cell.is_initialized(), ExcNotReinited());
3328 ExcAccessToUninitializedField(
"update_values"));
3336 this->finite_element_output.shape_values,
3338 this->finite_element_output.shape_function_to_row_table,
3344template <
int dim,
int spacedim>
3345template <
class InputVector>
3358 ExcAccessToUninitializedField(
"update_values"));
3360 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3361 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3365 this->finite_element_output.shape_values,
3367 this->finite_element_output.shape_function_to_row_table,
3370 indices.
size() / dofs_per_cell);
3375template <
int dim,
int spacedim>
3376template <
class InputVector>
3381 ArrayView<std::vector<typename InputVector::value_type>> values,
3386 ExcAccessToUninitializedField(
"update_values"));
3393 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3394 for (
unsigned int i = 0; i < indices.
size(); ++i)
3398 this->finite_element_output.shape_values,
3400 this->finite_element_output.shape_function_to_row_table,
3403 indices.
size() / dofs_per_cell);
3408template <
int dim,
int spacedim>
3409template <
class InputVector>
3418 ExcAccessToUninitializedField(
"update_gradients"));
3420 Assert(present_cell.is_initialized(), ExcNotReinited());
3428 this->finite_element_output.shape_gradients,
3434template <
int dim,
int spacedim>
3435template <
class InputVector>
3445 ExcAccessToUninitializedField(
"update_gradients"));
3449 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3450 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3454 this->finite_element_output.shape_gradients,
3460template <
int dim,
int spacedim>
3461template <
class InputVector>
3471 ExcAccessToUninitializedField(
"update_gradients"));
3472 Assert(present_cell.is_initialized(), ExcNotReinited());
3480 this->finite_element_output.shape_gradients,
3482 this->finite_element_output.shape_function_to_row_table,
3488template <
int dim,
int spacedim>
3489template <
class InputVector>
3504 ExcAccessToUninitializedField(
"update_gradients"));
3506 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3507 for (
unsigned int i = 0; i < indices.
size(); ++i)
3511 this->finite_element_output.shape_gradients,
3513 this->finite_element_output.shape_function_to_row_table,
3516 indices.
size() / dofs_per_cell);
3521template <
int dim,
int spacedim>
3522template <
class InputVector>
3532 ExcAccessToUninitializedField(
"update_hessians"));
3533 Assert(present_cell.is_initialized(), ExcNotReinited());
3541 this->finite_element_output.shape_hessians,
3547template <
int dim,
int spacedim>
3548template <
class InputVector>
3558 ExcAccessToUninitializedField(
"update_hessians"));
3562 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3563 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3567 this->finite_element_output.shape_hessians,
3573template <
int dim,
int spacedim>
3574template <
class InputVector>
3585 ExcAccessToUninitializedField(
"update_hessians"));
3586 Assert(present_cell.is_initialized(), ExcNotReinited());
3594 this->finite_element_output.shape_hessians,
3596 this->finite_element_output.shape_function_to_row_table,
3603template <
int dim,
int spacedim>
3604template <
class InputVector>
3615 ExcAccessToUninitializedField(
"update_hessians"));
3619 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3620 for (
unsigned int i = 0; i < indices.
size(); ++i)
3624 this->finite_element_output.shape_hessians,
3626 this->finite_element_output.shape_function_to_row_table,
3629 indices.
size() / dofs_per_cell);
3634template <
int dim,
int spacedim>
3635template <
class InputVector>
3639 std::vector<typename InputVector::value_type> &
laplacians)
const
3643 ExcAccessToUninitializedField(
"update_hessians"));
3645 Assert(present_cell.is_initialized(), ExcNotReinited());
3653 this->finite_element_output.shape_hessians,
3659template <
int dim,
int spacedim>
3660template <
class InputVector>
3665 std::vector<typename InputVector::value_type> &
laplacians)
const
3669 ExcAccessToUninitializedField(
"update_hessians"));
3673 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3674 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3678 this->finite_element_output.shape_hessians,
3684template <
int dim,
int spacedim>
3685template <
class InputVector>
3692 Assert(present_cell.is_initialized(), ExcNotReinited());
3694 ExcAccessToUninitializedField(
"update_hessians"));
3702 this->finite_element_output.shape_hessians,
3704 this->finite_element_output.shape_function_to_row_table,
3710template <
int dim,
int spacedim>
3711template <
class InputVector>
3724 ExcAccessToUninitializedField(
"update_hessians"));
3726 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3727 for (
unsigned int i = 0; i < indices.
size(); ++i)
3731 this->finite_element_output.shape_hessians,
3733 this->finite_element_output.shape_function_to_row_table,
3736 indices.
size() / dofs_per_cell);
3741template <
int dim,
int spacedim>
3742template <
class InputVector>
3747 std::vector<std::vector<typename InputVector::value_type>> &
laplacians,
3754 ExcAccessToUninitializedField(
"update_hessians"));
3756 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3757 for (
unsigned int i = 0; i < indices.
size(); ++i)
3761 this->finite_element_output.shape_hessians,
3763 this->finite_element_output.shape_function_to_row_table,
3766 indices.
size() / dofs_per_cell);
3771template <
int dim,
int spacedim>
3772template <
class InputVector>
3782 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3783 Assert(present_cell.is_initialized(), ExcNotReinited());
3791 this->finite_element_output.shape_3rd_derivatives,
3797template <
int dim,
int spacedim>
3798template <
class InputVector>
3808 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3812 boost::container::small_vector<Number, 200>
dof_values(dofs_per_cell);
3813 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3817 this->finite_element_output.shape_3rd_derivatives,
3823template <
int dim,
int spacedim>
3824template <
class InputVector>
3835 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3836 Assert(present_cell.is_initialized(), ExcNotReinited());
3844 this->finite_element_output.shape_3rd_derivatives,
3846 this->finite_element_output.shape_function_to_row_table,
3853template <
int dim,
int spacedim>
3854template <
class InputVector>
3865 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3869 boost::container::small_vector<Number, 200>
dof_values(indices.
size());
3870 for (
unsigned int i = 0; i < indices.
size(); ++i)
3874 this->finite_element_output.shape_3rd_derivatives,
3876 this->finite_element_output.shape_function_to_row_table,
3884template <
int dim,
int spacedim>
3888 return present_cell;
3893template <
int dim,
int spacedim>
3894const std::vector<Tensor<1, spacedim>> &
3899 "update_normal_vectors")));
3901 return this->mapping_output.normal_vectors;
3906template <
int dim,
int spacedim>
3910 return (
sizeof(this->update_flags) +
3913 sizeof(cell_similarity) +
3927template <
int dim,
int spacedim>
3938 UpdateFlags flags = update_flags | fe->requires_update_flags(update_flags);
3939 flags |= mapping->requires_update_flags(flags);
3946template <
int dim,
int spacedim>
3957 tria_listener_refinement.disconnect();
3958 tria_listener_mesh_transform.disconnect();
3964template <
int dim,
int spacedim>
3969 if (present_cell.is_initialized())
3971 if (&cell->get_triangulation() !=
3975 ->get_triangulation())
3982 invalidate_present_cell();
3983 tria_listener_refinement =
3984 cell->get_triangulation().signals.any_change.connect(
3985 [
this]() { this->invalidate_present_cell(); });
3986 tria_listener_mesh_transform =
3987 cell->get_triangulation().signals.mesh_movement.connect(
3988 [
this]() { this->invalidate_present_cell(); });
3996 tria_listener_refinement =
3997 cell->get_triangulation().signals.post_refinement.connect(
3998 [
this]() { this->invalidate_present_cell(); });
3999 tria_listener_mesh_transform =
4000 cell->get_triangulation().signals.mesh_movement.connect(
4001 [
this]() { this->invalidate_present_cell(); });
4007template <
int dim,
int spacedim>
4034 if (this->present_cell.is_initialized() ==
false)
4043 (cell->is_translation_of(
4045 &
>(this->present_cell)) ?
4052 &
>(this->present_cell)
4053 ->direction_flag() != cell->direction_flag())
4062template <
int dim,
int spacedim>
4066 return cell_similarity;
4071template <
int dim,
int spacedim>
4076template <
int dim,
int spacedim>
4081template <
int dim,
int spacedim>
4086template <
int dim,
int spacedim>
4092 fe.n_dofs_per_cell(),
4103template <
int dim,
int spacedim>
4108 :
FEValues(mapping, fe,
q[0], update_flags)
4115template <
int dim,
int spacedim>
4121 fe.n_dofs_per_cell(),
4132template <
int dim,
int spacedim>
4143template <
int dim,
int spacedim>
4149 if (dim != spacedim - 1)
4151 ExcMessage(
"You can only pass the 'update_normal_vectors' "
4152 "flag to FEFaceValues or FESubfaceValues objects, "
4153 "but not to an FEValues object unless the "
4154 "triangulation it refers to is embedded in a higher "
4155 "dimensional space."));
4157 const UpdateFlags flags = this->compute_update_flags(update_flags);
4161 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4162 this->finite_element_output.initialize(this->max_n_quadrature_points,
4169 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4171 return this->fe->get_data(flags,
4174 this->finite_element_output);
4178 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4182 [&]() {
return this->mapping->get_data(flags, quadrature); });
4184 this->update_flags = flags;
4187 this->fe_data = std::move(
fe_get_data.return_value());
4191 this->mapping_data =
4192 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4197template <
int dim,
int spacedim>
4203 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4205 "You are trying to call FEValues::reinit() with a cell of type " +
4206 cell->reference_cell().to_string() +
4207 " with a Mapping that is not compatible with it."));
4211 this->maybe_invalidate_previous_present_cell(cell);
4212 this->check_cell_similarity(cell);
4214 this->present_cell = {cell};
4224template <
int dim,
int spacedim>
4237 Assert(this->get_mapping().is_compatible_with(cell->reference_cell()),
4239 "You are trying to call FEValues::reinit() with a cell of type " +
4240 cell->reference_cell().to_string() +
4241 " with a Mapping that is not compatible with it."));
4243 this->maybe_invalidate_previous_present_cell(cell);
4244 this->check_cell_similarity(cell);
4246 this->present_cell = {cell};
4256template <
int dim,
int spacedim>
4266 this->cell_similarity =
4267 this->get_mapping().fill_fe_values(this->present_cell,
4268 this->cell_similarity,
4270 *this->mapping_data,
4271 this->mapping_output);
4278 this->get_fe().fill_fe_values(this->present_cell,
4279 this->cell_similarity,
4281 this->get_mapping(),
4282 *this->mapping_data,
4283 this->mapping_output,
4285 this->finite_element_output);
4290template <
int dim,
int spacedim>
4302template <
int dim,
int spacedim>
4304 const unsigned int dofs_per_cell,
4313 hp::QCollection<dim - 1>(quadrature))
4318template <
int dim,
int spacedim>
4320 const unsigned int dofs_per_cell,
4325 :
FEValuesBase<dim, spacedim>(quadrature.max_n_quadrature_points(),
4330 , present_face_index(
numbers::invalid_unsigned_int)
4331 , quadrature(quadrature)
4334 quadrature.
size() ==
fe.reference_cell().n_faces(),
4340template <
int dim,
int spacedim>
4341const std::vector<Tensor<1, spacedim>> &
4346 "update_boundary_forms")));
4347 return this->mapping_output.boundary_forms;
4352template <
int dim,
int spacedim>
4363template <
int dim,
int spacedim>
4368template <
int dim,
int spacedim>
4373template <
int dim,
int spacedim>
4381 hp::QCollection<dim - 1>(quadrature),
4387template <
int dim,
int spacedim>
4404template <
int dim,
int spacedim>
4410 hp::QCollection<dim - 1>(quadrature),
4416template <
int dim,
int spacedim>
4422 fe.n_dofs_per_cell(),
4433template <
int dim,
int spacedim>
4437 const UpdateFlags flags = this->compute_update_flags(update_flags);
4441 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4442 this->finite_element_output.initialize(this->max_n_quadrature_points,
4449 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase> (
4458 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> (
4465 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4471 this->finite_element_output);
4473 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4481 this->update_flags = flags;
4484 this->fe_data = std::move(
fe_get_data.return_value());
4488 this->mapping_data =
4489 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4494template <
int dim,
int spacedim>
4505 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4510 this->maybe_invalidate_previous_present_cell(cell);
4511 this->present_cell = {cell};
4521template <
int dim,
int spacedim>
4528 const auto face_n = cell->face_iterator_to_index(face);
4534template <
int dim,
int spacedim>
4542 this->maybe_invalidate_previous_present_cell(cell);
4543 this->present_cell = {cell};
4553template <
int dim,
int spacedim>
4559 const auto face_n = cell->face_iterator_to_index(face);
4565template <
int dim,
int spacedim>
4569 this->present_face_no =
face_no;
4574 this->present_face_index = cell->face_index(
face_no);
4578 this->get_mapping().fill_fe_face_values(this->present_cell,
4581 *this->mapping_data,
4582 this->mapping_output);
4585 this->get_fe().fill_fe_face_values(this->present_cell,
4588 this->get_mapping(),
4589 *this->mapping_data,
4590 this->mapping_output,
4592 this->finite_element_output);
4594 const_cast<unsigned int &
>(this->n_quadrature_points) =
4602template <
int dim,
int spacedim>
4607template <
int dim,
int spacedim>
4612template <
int dim,
int spacedim>
4629template <
int dim,
int spacedim>
4642template <
int dim,
int spacedim>
4648 fe.n_dofs_per_cell(),
4659template <
int dim,
int spacedim>
4671template <
int dim,
int spacedim>
4675 const UpdateFlags flags = this->compute_update_flags(update_flags);
4679 this->mapping_output.initialize(this->max_n_quadrature_points, flags);
4680 this->finite_element_output.initialize(this->max_n_quadrature_points,
4688 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>>
4694 this->quadrature[0],
4695 this->finite_element_output);
4697 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>>
4704 this->quadrature[0]);
4706 this->update_flags = flags;
4709 this->fe_data = std::move(
fe_get_data.return_value());
4713 this->mapping_data =
4714 std::make_unique<typename Mapping<dim, spacedim>::InternalDataBase>();
4719template <
int dim,
int spacedim>
4731 cell->get_dof_handler().get_fe(cell->active_fe_index())),
4747 cell->face(
face_no)->n_active_descendants()));
4748 Assert(cell->has_children() ==
false,
4749 ExcMessage(
"You can't use subface data for cells that are "
4750 "already refined. Iterate over their children "
4751 "instead in these cases."));
4753 this->maybe_invalidate_previous_present_cell(cell);
4754 this->present_cell = {cell};
4764template <
int dim,
int spacedim>
4773 cell->face_iterator_to_index(face),
4774 face->child_iterator_to_index(subface));
4779template <
int dim,
int spacedim>
4792 (cell->has_periodic_neighbor(
face_no) ?
4793 cell->periodic_neighbor(
face_no)
4794 ->face(cell->periodic_neighbor_face_no(
face_no))
4796 cell->face(
face_no)->n_children()));
4798 this->maybe_invalidate_previous_present_cell(cell);
4799 this->present_cell = {cell};
4809template <
int dim,
int spacedim>
4817 cell->face_iterator_to_index(face),
4818 face->child_iterator_to_index(subface));
4823template <
int dim,
int spacedim>
4828 this->present_face_no =
face_no;
4834 if (!cell->face(
face_no)->has_children())
4837 this->present_face_index = cell->face_index(
face_no);
4845 switch (cell->subface_case(
face_no))
4854 subface_index = cell->face(
face_no)
4868 subface_index = cell->face(
face_no)->child_index(1);
4879 subface_index = cell->face(
face_no)->child_index(0);
4896 this->present_face_index = subface_index;
4902 this->get_mapping().fill_fe_subface_values(this->present_cell,
4905 this->quadrature[0],
4906 *this->mapping_data,
4907 this->mapping_output);
4910 this->get_fe().fill_fe_subface_values(this->present_cell,
4913 this->quadrature[0],
4914 this->get_mapping(),
4915 *this->mapping_data,
4916 this->mapping_output,
4918 this->finite_element_output);
4923#define SPLIT_INSTANTIATIONS_COUNT 6
4924#ifndef SPLIT_INSTANTIATIONS_INDEX
4925# define SPLIT_INSTANTIATIONS_INDEX 0
4927#include "fe_values.inst"
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
void reinit(value_type *starting_element, const std::size_t n_elements)
FEFaceValuesBase(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)
std::size_t memory_consumption() const
const std::vector< Tensor< 1, spacedim > > & get_boundary_forms() const
void initialize(const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no)
void do_reinit(const unsigned int face_no)
FEFaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature, const UpdateFlags update_flags)
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &face_quadrature, const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
void initialize(const UpdateFlags update_flags)
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
bool is_initialized() const
void get_interpolated_dof_values(const VectorType &in, Vector< typename VectorType::value_type > &out) const
types::global_dof_index n_dofs_for_dof_handler() const
CellSimilarity::Similarity cell_similarity
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) 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)
virtual ~FEValuesBase() override
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
const unsigned int dofs_per_cell
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
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
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename InputVector::value_type > &laplacians) const
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
void invalidate_present_cell()
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const unsigned int max_n_quadrature_points
void get_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type > > &third_derivatives) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
const unsigned int component
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
std::vector< ShapeFunctionData > shape_function_data
void get_function_laplacians(const InputVector &fe_function, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
typename ProductType< Number, value_type >::type solution_laplacian_type
void get_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
void get_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_symmetric_gradient_type< typename InputVector::value_type > > &symmetric_gradients) const
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
typename ProductType< Number, divergence_type >::type solution_divergence_type
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
void get_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_function_curls_from_local_dof_values(const InputVector &dof_values, std::vector< solution_curl_type< typename InputVector::value_type > > &curls) const
void get_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
const unsigned int first_vector_component
std::vector< ShapeFunctionData > shape_function_data
void get_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< solution_symmetric_gradient_type< typename InputVector::value_type > > &symmetric_gradients) const
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_function_laplacians(const InputVector &fe_function, std::vector< solution_laplacian_type< typename InputVector::value_type > > &laplacians) const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_function_curls(const InputVector &fe_function, std::vector< solution_curl_type< typename InputVector::value_type > > &curls) const
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< solution_divergence_type< typename InputVector::value_type > > &divergences) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_function_divergences(const InputVector &fe_function, std::vector< solution_divergence_type< typename InputVector::value_type > > &divergences) const
FEValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags update_flags)
void initialize(const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
std::size_t memory_consumption() const
bool is_element(const size_type index) const
Abstract base class for mapping classes.
static unsigned int n_threads()
static DEAL_II_HOST constexpr unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
static DEAL_II_HOST constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
DEAL_II_HOST constexpr SymmetricTensor()=default
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotReinited()
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_gradients
Shape function gradients.
@ update_default
No update.
@ update_boundary_forms
Outer normal vector, not normalized.
Task< RT > new_task(const std::function< RT()> &function)
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
void do_function_laplacians(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 2, spacedim > > &shape_hessians, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Scalar< dim, spacedim >::template solution_laplacian_type< Number > > &laplacians)
void do_function_values(const ArrayView< Number > &dof_values, const Table< 2, double > &shape_values, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, double >::type > &values)
void do_function_gradients(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Tensor< 2, dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Tensor< 2, dim, spacedim >::template solution_gradient_type< Number > > &gradients)
void do_function_divergences(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename Vector< dim, spacedim >::template solution_divergence_type< Number > > &divergences)
void do_function_curls(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, typename ::internal::CurlType< spacedim >::type >::type > &curls)
void do_function_symmetric_gradients(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< 1, spacedim > > &shape_gradients, const std::vector< typename Vector< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, ::SymmetricTensor< 2, spacedim > >::type > &symmetric_gradients)
void do_function_derivatives(const ArrayView< Number > &dof_values, const Table< 2, ::Tensor< order, spacedim > > &shape_derivatives, const std::vector< typename Scalar< dim, spacedim >::ShapeFunctionData > &shape_function_data, std::vector< typename ProductType< Number, ::Tensor< order, spacedim > >::type > &derivatives)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
void do_function_laplacians(const ArrayView< Number2 > &dof_values, const ::Table< 2, Tensor< 2, spacedim > > &shape_hessians, std::vector< Number > &laplacians)
VectorType::value_type get_vector_element(const VectorType &vector, const types::global_dof_index cell_number)
void do_function_derivatives(const ArrayView< Number > &dof_values, const ::Table< 2, Tensor< order, spacedim > > &shape_derivatives, std::vector< Tensor< order, spacedim, Number > > &derivatives)
std::vector< unsigned int > make_shape_function_to_row_table(const FiniteElement< dim, spacedim > &fe)
void do_function_values(const ArrayView< Number2 > &dof_values, const ::Table< 2, double > &shape_values, std::vector< Number > &values)
static const unsigned int invalid_unsigned_int
typename internal::ProductTypeImpl< typename std::decay< T >::type, typename std::decay< U >::type >::type type
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)
Cache(const FEValuesBase< dim, spacedim > &fe_values)
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE const T & value(const T &t)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
DEAL_II_HOST constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)