15#ifndef dealii_fe_values_base_h
16#define dealii_fe_values_base_h
153template <
int dim,
int spacedim>
275 shape_value(
const unsigned int i,
const unsigned int q_point)
const;
299 const unsigned int q_point,
300 const unsigned int component)
const;
328 shape_grad(
const unsigned int i,
const unsigned int q_point)
const;
348 const unsigned int q_point,
349 const unsigned int component)
const;
391 const unsigned int q_point,
392 const unsigned int component)
const;
434 const unsigned int q_point,
435 const unsigned int component)
const;
485 template <
typename Number>
488 std::vector<Number> &values)
const;
503 template <
typename Number>
564 template <
typename Number>
568 std::vector<Number> &values)
const;
578 template <
typename Number>
606 template <
typename Number>
611 const bool quadrature_points_fastest)
const;
659 template <
typename Number>
681 template <
typename Number>
695 template <
typename Number>
710 template <
typename Number>
716 const bool quadrature_points_fastest =
false)
const;
761 template <
typename Number>
784 template <
typename Number>
789 const bool quadrature_points_fastest =
false)
const;
799 template <
typename Number>
814 template <
typename Number>
820 const bool quadrature_points_fastest =
false)
const;
862 template <
typename Number>
865 std::vector<Number> &laplacians)
const;
886 template <
typename Number>
899 template <
typename Number>
904 std::vector<Number> &laplacians)
const;
914 template <
typename Number>
929 template <
typename Number>
934 std::vector<std::vector<Number>> &laplacians,
935 const bool quadrature_points_fastest =
false)
const;
979 template <
typename Number>
1004 template <
typename Number>
1009 const bool quadrature_points_fastest =
false)
const;
1019 template <
typename Number>
1034 template <
typename Number>
1040 const bool quadrature_points_fastest =
false)
const;
1182 const std::vector<Point<spacedim>> &
1202 JxW(
const unsigned int q_point)
const;
1207 const std::vector<double> &
1225 const std::vector<DerivativeForm<1, dim, spacedim>> &
1244 const std::vector<DerivativeForm<2, dim, spacedim>> &
1264 const std::vector<Tensor<3, spacedim>> &
1283 const std::vector<DerivativeForm<3, dim, spacedim>> &
1304 const std::vector<Tensor<4, spacedim>> &
1324 const std::vector<DerivativeForm<4, dim, spacedim>> &
1345 const std::vector<Tensor<5, spacedim>> &
1363 const std::vector<DerivativeForm<1, spacedim, dim>> &
1395 const std::vector<Tensor<1, spacedim>> &
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 "
1509 <<
"> flag to be set, but it was apparently not specified "
1510 <<
"upon construction.");
1518 "FEValues object is not reinit'ed to any cell");
1528 "The FiniteElement you provided to FEValues and the FiniteElement that belongs "
1529 "to the DoFHandler that provided the cell iterator do not match.");
1537 <<
"The shape function with index " << arg1
1538 <<
" is not primitive, i.e. it is vector-valued and "
1539 <<
"has more than one non-zero vector component. This "
1540 <<
"function cannot be called for these shape functions. "
1541 <<
"Maybe you want to use the same function with the "
1542 <<
"_component suffix?");
1552 "The given FiniteElement is not a primitive element but the requested operation "
1553 "only works for those. See FiniteElement::is_primitive() for more information.");
1577 "You have previously called the FEValues::reinit() function with a "
1578 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However, "
1579 "when you do this, you cannot call some functions in the FEValues "
1580 "class, such as the get_function_values/gradients/hessians/third_derivatives "
1581 "functions. If you need these functions, then you need to call "
1582 "FEValues::reinit() with an iterator type that allows to extract "
1583 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
1634 template <
typename Number>
1646 std::variant<typename Triangulation<dim, spacedim>::cell_iterator,
1709 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
1732 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1793 template <
int,
int,
int>
1795 template <
int,
int,
int>
1803template <
int dim,
int spacedim>
1810 return fe_values_views_cache.
scalars[scalar.component].value_or_initialize(
1818template <
int dim,
int spacedim>
1824 fe_values_views_cache.
vectors.size());
1827 .value_or_initialize([vector,
this]() {
1835template <
int dim,
int spacedim>
1847 return fe_values_views_cache
1849 .value_or_initialize([tensor,
this]() {
1857template <
int dim,
int spacedim>
1865 return fe_values_views_cache
1867 .value_or_initialize([tensor,
this]() {
1875template <
int dim,
int spacedim>
1876inline const double &
1878 const unsigned int q_point)
const
1882 ExcAccessToUninitializedField(
"update_values"));
1883 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1887 if (fe->is_primitive())
1888 return this->finite_element_output.shape_values(i, q_point);
1899 const unsigned int row =
1900 this->finite_element_output
1901 .shape_function_to_row_table[i * fe->n_components() +
1902 fe->system_to_component_index(i).first];
1903 return this->finite_element_output.shape_values(row, q_point);
1909template <
int dim,
int spacedim>
1912 const unsigned int i,
1913 const unsigned int q_point,
1914 const unsigned int component)
const
1918 ExcAccessToUninitializedField(
"update_values"));
1925 if (fe->get_nonzero_components(i)[component] ==
false)
1931 const unsigned int row =
1932 this->finite_element_output
1933 .shape_function_to_row_table[i * fe->n_components() + component];
1934 return this->finite_element_output.shape_values(row, q_point);
1939template <
int dim,
int spacedim>
1942 const unsigned int q_point)
const
1946 ExcAccessToUninitializedField(
"update_gradients"));
1947 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1951 if (fe->is_primitive())
1952 return this->finite_element_output.shape_gradients[i][q_point];
1963 const unsigned int row =
1964 this->finite_element_output
1965 .shape_function_to_row_table[i * fe->n_components() +
1966 fe->system_to_component_index(i).first];
1967 return this->finite_element_output.shape_gradients[row][q_point];
1973template <
int dim,
int spacedim>
1976 const unsigned int i,
1977 const unsigned int q_point,
1978 const unsigned int component)
const
1982 ExcAccessToUninitializedField(
"update_gradients"));
1988 if (fe->get_nonzero_components(i)[component] ==
false)
1994 const unsigned int row =
1995 this->finite_element_output
1996 .shape_function_to_row_table[i * fe->n_components() + component];
1997 return this->finite_element_output.shape_gradients[row][q_point];
2002template <
int dim,
int spacedim>
2005 const unsigned int q_point)
const
2009 ExcAccessToUninitializedField(
"update_hessians"));
2010 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2014 if (fe->is_primitive())
2015 return this->finite_element_output.shape_hessians[i][q_point];
2026 const unsigned int row =
2027 this->finite_element_output
2028 .shape_function_to_row_table[i * fe->n_components() +
2029 fe->system_to_component_index(i).first];
2030 return this->finite_element_output.shape_hessians[row][q_point];
2036template <
int dim,
int spacedim>
2039 const unsigned int i,
2040 const unsigned int q_point,
2041 const unsigned int component)
const
2045 ExcAccessToUninitializedField(
"update_hessians"));
2051 if (fe->get_nonzero_components(i)[component] ==
false)
2057 const unsigned int row =
2058 this->finite_element_output
2059 .shape_function_to_row_table[i * fe->n_components() + component];
2060 return this->finite_element_output.shape_hessians[row][q_point];
2065template <
int dim,
int spacedim>
2068 const unsigned int i,
2069 const unsigned int q_point)
const
2073 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
2074 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2078 if (fe->is_primitive())
2079 return this->finite_element_output.shape_3rd_derivatives[i][q_point];
2090 const unsigned int row =
2091 this->finite_element_output
2092 .shape_function_to_row_table[i * fe->n_components() +
2093 fe->system_to_component_index(i).first];
2094 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2100template <
int dim,
int spacedim>
2103 const unsigned int i,
2104 const unsigned int q_point,
2105 const unsigned int component)
const
2109 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
2115 if (fe->get_nonzero_components(i)[component] ==
false)
2121 const unsigned int row =
2122 this->finite_element_output
2123 .shape_function_to_row_table[i * fe->n_components() + component];
2124 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2129template <
int dim,
int spacedim>
2138template <
int dim,
int spacedim>
2147template <
int dim,
int spacedim>
2151 return this->update_flags;
2156template <
int dim,
int spacedim>
2157inline const std::vector<Point<spacedim>> &
2161 ExcAccessToUninitializedField(
"update_quadrature_points"));
2163 return this->mapping_output.quadrature_points;
2168template <
int dim,
int spacedim>
2169inline const std::vector<double> &
2173 ExcAccessToUninitializedField(
"update_JxW_values"));
2175 return this->mapping_output.JxW_values;
2180template <
int dim,
int spacedim>
2181inline const std::vector<DerivativeForm<1, dim, spacedim>> &
2185 ExcAccessToUninitializedField(
"update_jacobians"));
2187 return this->mapping_output.jacobians;
2192template <
int dim,
int spacedim>
2193inline const std::vector<DerivativeForm<2, dim, spacedim>> &
2197 ExcAccessToUninitializedField(
"update_jacobians_grads"));
2199 return this->mapping_output.jacobian_grads;
2204template <
int dim,
int spacedim>
2207 const unsigned int q_point)
const
2210 ExcAccessToUninitializedField(
"update_jacobian_pushed_forward_grads"));
2212 return this->mapping_output.jacobian_pushed_forward_grads[q_point];
2217template <
int dim,
int spacedim>
2218inline const std::vector<Tensor<3, spacedim>> &
2222 ExcAccessToUninitializedField(
"update_jacobian_pushed_forward_grads"));
2224 return this->mapping_output.jacobian_pushed_forward_grads;
2229template <
int dim,
int spacedim>
2232 const unsigned int q_point)
const
2235 ExcAccessToUninitializedField(
"update_jacobian_2nd_derivatives"));
2237 return this->mapping_output.jacobian_2nd_derivatives[q_point];
2242template <
int dim,
int spacedim>
2243inline const std::vector<DerivativeForm<3, dim, spacedim>> &
2247 ExcAccessToUninitializedField(
"update_jacobian_2nd_derivatives"));
2249 return this->mapping_output.jacobian_2nd_derivatives;
2254template <
int dim,
int spacedim>
2257 const unsigned int q_point)
const
2260 ExcAccessToUninitializedField(
2261 "update_jacobian_pushed_forward_2nd_derivatives"));
2263 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[q_point];
2268template <
int dim,
int spacedim>
2269inline const std::vector<Tensor<4, spacedim>> &
2273 ExcAccessToUninitializedField(
2274 "update_jacobian_pushed_forward_2nd_derivatives"));
2276 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
2281template <
int dim,
int spacedim>
2284 const unsigned int q_point)
const
2287 ExcAccessToUninitializedField(
"update_jacobian_3rd_derivatives"));
2289 return this->mapping_output.jacobian_3rd_derivatives[q_point];
2294template <
int dim,
int spacedim>
2295inline const std::vector<DerivativeForm<4, dim, spacedim>> &
2299 ExcAccessToUninitializedField(
"update_jacobian_3rd_derivatives"));
2301 return this->mapping_output.jacobian_3rd_derivatives;
2306template <
int dim,
int spacedim>
2309 const unsigned int q_point)
const
2312 ExcAccessToUninitializedField(
2313 "update_jacobian_pushed_forward_3rd_derivatives"));
2315 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[q_point];
2320template <
int dim,
int spacedim>
2321inline const std::vector<Tensor<5, spacedim>> &
2325 ExcAccessToUninitializedField(
2326 "update_jacobian_pushed_forward_3rd_derivatives"));
2328 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
2333template <
int dim,
int spacedim>
2334inline const std::vector<DerivativeForm<1, spacedim, dim>> &
2338 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
2340 return this->mapping_output.inverse_jacobians;
2345template <
int dim,
int spacedim>
2349 return {0U, dofs_per_cell};
2354template <
int dim,
int spacedim>
2357 const unsigned int start_dof_index)
const
2359 Assert(start_dof_index <= dofs_per_cell,
2361 return {start_dof_index, dofs_per_cell};
2366template <
int dim,
int spacedim>
2369 const unsigned int end_dof_index)
const
2371 Assert(end_dof_index < dofs_per_cell,
2373 return {0U, end_dof_index + 1};
2378template <
int dim,
int spacedim>
2382 return {0U, n_quadrature_points};
2387template <
int dim,
int spacedim>
2392 ExcAccessToUninitializedField(
"update_quadrature_points"));
2396 return this->mapping_output.quadrature_points[q_point];
2401template <
int dim,
int spacedim>
2406 ExcAccessToUninitializedField(
"update_JxW_values"));
2410 return this->mapping_output.JxW_values[q_point];
2415template <
int dim,
int spacedim>
2420 ExcAccessToUninitializedField(
"update_jacobians"));
2424 return this->mapping_output.jacobians[q_point];
2429template <
int dim,
int spacedim>
2434 ExcAccessToUninitializedField(
"update_jacobians_grads"));
2438 return this->mapping_output.jacobian_grads[q_point];
2443template <
int dim,
int spacedim>
2448 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
2452 return this->mapping_output.inverse_jacobians[q_point];
2457template <
int dim,
int spacedim>
2463 "update_normal_vectors")));
2467 return this->mapping_output.normal_vectors[q_point];
typename LevelSelector::cell_iterator level_cell_iterator
types::global_dof_index n_dofs_for_dof_handler() const
CellIteratorWrapper()=default
std::optional< std::variant< typename Triangulation< dim, spacedim >::cell_iterator, typename DoFHandler< dim, spacedim >::cell_iterator, typename DoFHandler< dim, spacedim >::level_cell_iterator > > cell
bool is_initialized() const
void get_interpolated_dof_values(const ReadVector< Number > &in, Vector< Number > &out) const
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
boost::signals2::connection tria_listener_mesh_transform
void get_function_values(const ReadVector< Number > &fe_function, std::vector< Number > &values) const
const std::vector< Point< spacedim > > & get_quadrature_points() 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)
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 SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
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
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
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
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
boost::signals2::connection tria_listener_refinement
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
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 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.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
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
@ 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
boost::integer_range< IncrementableType > iota_view
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