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,
1710 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
1733 std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
1794 template <
int,
int,
int>
1796 template <
int,
int,
int>
1804template <
int dim,
int spacedim>
1811 return fe_values_views_cache.
scalars[scalar.component].value_or_initialize(
1819template <
int dim,
int spacedim>
1825 fe_values_views_cache.
vectors.size());
1828 .value_or_initialize([vector,
this]() {
1836template <
int dim,
int spacedim>
1848 return fe_values_views_cache
1850 .value_or_initialize([tensor,
this]() {
1858template <
int dim,
int spacedim>
1866 return fe_values_views_cache
1868 .value_or_initialize([tensor,
this]() {
1876template <
int dim,
int spacedim>
1877inline const double &
1879 const unsigned int q_point)
const
1883 ExcAccessToUninitializedField(
"update_values"));
1884 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1888 if (fe->is_primitive())
1889 return this->finite_element_output.shape_values(i, q_point);
1900 const unsigned int row =
1901 this->finite_element_output
1902 .shape_function_to_row_table[i * fe->n_components() +
1903 fe->system_to_component_index(i).first];
1904 return this->finite_element_output.shape_values(row, q_point);
1910template <
int dim,
int spacedim>
1913 const unsigned int i,
1914 const unsigned int q_point,
1915 const unsigned int component)
const
1919 ExcAccessToUninitializedField(
"update_values"));
1926 if (fe->get_nonzero_components(i)[component] ==
false)
1932 const unsigned int row =
1933 this->finite_element_output
1934 .shape_function_to_row_table[i * fe->n_components() + component];
1935 return this->finite_element_output.shape_values(row, q_point);
1940template <
int dim,
int spacedim>
1943 const unsigned int q_point)
const
1947 ExcAccessToUninitializedField(
"update_gradients"));
1948 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
1952 if (fe->is_primitive())
1953 return this->finite_element_output.shape_gradients[i][q_point];
1964 const unsigned int row =
1965 this->finite_element_output
1966 .shape_function_to_row_table[i * fe->n_components() +
1967 fe->system_to_component_index(i).first];
1968 return this->finite_element_output.shape_gradients[row][q_point];
1974template <
int dim,
int spacedim>
1977 const unsigned int i,
1978 const unsigned int q_point,
1979 const unsigned int component)
const
1983 ExcAccessToUninitializedField(
"update_gradients"));
1989 if (fe->get_nonzero_components(i)[component] ==
false)
1995 const unsigned int row =
1996 this->finite_element_output
1997 .shape_function_to_row_table[i * fe->n_components() + component];
1998 return this->finite_element_output.shape_gradients[row][q_point];
2003template <
int dim,
int spacedim>
2006 const unsigned int q_point)
const
2010 ExcAccessToUninitializedField(
"update_hessians"));
2011 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2015 if (fe->is_primitive())
2016 return this->finite_element_output.shape_hessians[i][q_point];
2027 const unsigned int row =
2028 this->finite_element_output
2029 .shape_function_to_row_table[i * fe->n_components() +
2030 fe->system_to_component_index(i).first];
2031 return this->finite_element_output.shape_hessians[row][q_point];
2037template <
int dim,
int spacedim>
2040 const unsigned int i,
2041 const unsigned int q_point,
2042 const unsigned int component)
const
2046 ExcAccessToUninitializedField(
"update_hessians"));
2052 if (fe->get_nonzero_components(i)[component] ==
false)
2058 const unsigned int row =
2059 this->finite_element_output
2060 .shape_function_to_row_table[i * fe->n_components() + component];
2061 return this->finite_element_output.shape_hessians[row][q_point];
2066template <
int dim,
int spacedim>
2069 const unsigned int i,
2070 const unsigned int q_point)
const
2074 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
2075 Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
2079 if (fe->is_primitive())
2080 return this->finite_element_output.shape_3rd_derivatives[i][q_point];
2091 const unsigned int row =
2092 this->finite_element_output
2093 .shape_function_to_row_table[i * fe->n_components() +
2094 fe->system_to_component_index(i).first];
2095 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2101template <
int dim,
int spacedim>
2104 const unsigned int i,
2105 const unsigned int q_point,
2106 const unsigned int component)
const
2110 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
2116 if (fe->get_nonzero_components(i)[component] ==
false)
2122 const unsigned int row =
2123 this->finite_element_output
2124 .shape_function_to_row_table[i * fe->n_components() + component];
2125 return this->finite_element_output.shape_3rd_derivatives[row][q_point];
2130template <
int dim,
int spacedim>
2139template <
int dim,
int spacedim>
2148template <
int dim,
int spacedim>
2152 return this->update_flags;
2157template <
int dim,
int spacedim>
2158inline const std::vector<Point<spacedim>> &
2162 ExcAccessToUninitializedField(
"update_quadrature_points"));
2164 return this->mapping_output.quadrature_points;
2169template <
int dim,
int spacedim>
2170inline const std::vector<double> &
2174 ExcAccessToUninitializedField(
"update_JxW_values"));
2176 return this->mapping_output.JxW_values;
2181template <
int dim,
int spacedim>
2182inline const std::vector<DerivativeForm<1, dim, spacedim>> &
2186 ExcAccessToUninitializedField(
"update_jacobians"));
2188 return this->mapping_output.jacobians;
2193template <
int dim,
int spacedim>
2194inline const std::vector<DerivativeForm<2, dim, spacedim>> &
2198 ExcAccessToUninitializedField(
"update_jacobians_grads"));
2200 return this->mapping_output.jacobian_grads;
2205template <
int dim,
int spacedim>
2208 const unsigned int q_point)
const
2211 ExcAccessToUninitializedField(
"update_jacobian_pushed_forward_grads"));
2213 return this->mapping_output.jacobian_pushed_forward_grads[q_point];
2218template <
int dim,
int spacedim>
2219inline const std::vector<Tensor<3, spacedim>> &
2223 ExcAccessToUninitializedField(
"update_jacobian_pushed_forward_grads"));
2225 return this->mapping_output.jacobian_pushed_forward_grads;
2230template <
int dim,
int spacedim>
2233 const unsigned int q_point)
const
2236 ExcAccessToUninitializedField(
"update_jacobian_2nd_derivatives"));
2238 return this->mapping_output.jacobian_2nd_derivatives[q_point];
2243template <
int dim,
int spacedim>
2244inline const std::vector<DerivativeForm<3, dim, spacedim>> &
2248 ExcAccessToUninitializedField(
"update_jacobian_2nd_derivatives"));
2250 return this->mapping_output.jacobian_2nd_derivatives;
2255template <
int dim,
int spacedim>
2258 const unsigned int q_point)
const
2261 ExcAccessToUninitializedField(
2262 "update_jacobian_pushed_forward_2nd_derivatives"));
2264 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[q_point];
2269template <
int dim,
int spacedim>
2270inline const std::vector<Tensor<4, spacedim>> &
2274 ExcAccessToUninitializedField(
2275 "update_jacobian_pushed_forward_2nd_derivatives"));
2277 return this->mapping_output.jacobian_pushed_forward_2nd_derivatives;
2282template <
int dim,
int spacedim>
2285 const unsigned int q_point)
const
2288 ExcAccessToUninitializedField(
"update_jacobian_3rd_derivatives"));
2290 return this->mapping_output.jacobian_3rd_derivatives[q_point];
2295template <
int dim,
int spacedim>
2296inline const std::vector<DerivativeForm<4, dim, spacedim>> &
2300 ExcAccessToUninitializedField(
"update_jacobian_3rd_derivatives"));
2302 return this->mapping_output.jacobian_3rd_derivatives;
2307template <
int dim,
int spacedim>
2310 const unsigned int q_point)
const
2313 ExcAccessToUninitializedField(
2314 "update_jacobian_pushed_forward_3rd_derivatives"));
2316 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[q_point];
2321template <
int dim,
int spacedim>
2322inline const std::vector<Tensor<5, spacedim>> &
2326 ExcAccessToUninitializedField(
2327 "update_jacobian_pushed_forward_3rd_derivatives"));
2329 return this->mapping_output.jacobian_pushed_forward_3rd_derivatives;
2334template <
int dim,
int spacedim>
2335inline const std::vector<DerivativeForm<1, spacedim, dim>> &
2339 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
2341 return this->mapping_output.inverse_jacobians;
2346template <
int dim,
int spacedim>
2350 return {0U, dofs_per_cell};
2355template <
int dim,
int spacedim>
2358 const unsigned int start_dof_index)
const
2360 Assert(start_dof_index <= dofs_per_cell,
2362 return {start_dof_index, dofs_per_cell};
2367template <
int dim,
int spacedim>
2370 const unsigned int end_dof_index)
const
2372 Assert(end_dof_index < dofs_per_cell,
2374 return {0U, end_dof_index + 1};
2379template <
int dim,
int spacedim>
2383 return {0U, n_quadrature_points};
2388template <
int dim,
int spacedim>
2393 ExcAccessToUninitializedField(
"update_quadrature_points"));
2397 return this->mapping_output.quadrature_points[q_point];
2402template <
int dim,
int spacedim>
2407 ExcAccessToUninitializedField(
"update_JxW_values"));
2411 return this->mapping_output.JxW_values[q_point];
2416template <
int dim,
int spacedim>
2421 ExcAccessToUninitializedField(
"update_jacobians"));
2425 return this->mapping_output.jacobians[q_point];
2430template <
int dim,
int spacedim>
2435 ExcAccessToUninitializedField(
"update_jacobians_grads"));
2439 return this->mapping_output.jacobian_grads[q_point];
2444template <
int dim,
int spacedim>
2449 ExcAccessToUninitializedField(
"update_inverse_jacobians"));
2453 return this->mapping_output.inverse_jacobians[q_point];
2458template <
int dim,
int spacedim>
2464 "update_normal_vectors")));
2468 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
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
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
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
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.
#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