36#include <boost/container/small_vector.hpp>
47 template <
int dim,
int spacedim>
48 inline std::vector<unsigned int>
51 std::vector<unsigned int> shape_function_to_row_table(
54 for (
unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
61 for (
unsigned int c = 0; c < fe.n_components(); ++c)
62 if (fe.get_nonzero_components(i)[c] ==
true)
64 shape_function_to_row_table[i * fe.n_components() + c] =
68 row += fe.n_nonzero_components(i);
71 return shape_function_to_row_table;
78 template <
typename Number,
typename T =
void>
93 template <
typename Number>
96 std::
enable_if_t<Differentiation::AD::is_ad_number<Number>::value>>
99 value(
const Number & )
110template <
int dim,
int spacedim>
118template <
int dim,
int spacedim>
126template <
int dim,
int spacedim>
134template <
int dim,
int spacedim>
138 return cell.has_value();
143template <
int dim,
int spacedim>
152 [](
auto &cell_iterator) ->
154 return cell_iterator;
161template <
int dim,
int spacedim>
167 switch (cell.value().index())
170 return std::get<1>(cell.value())->get_dof_handler().n_dofs();
172 return std::get<2>(cell.value())->get_dof_handler().n_dofs();
174 Assert(
false, ExcNeedsDoFHandler());
181template <
int dim,
int spacedim>
182template <
typename Number>
190 switch (cell.value().index())
193 std::get<1>(cell.value())->get_interpolated_dof_values(in, out);
197 std::get<2>(cell.value())->get_interpolated_dof_values(in, out);
201 Assert(
false, ExcNeedsDoFHandler());
211template <
int dim,
int spacedim>
213 const unsigned int n_q_points,
228 ExcMessage(
"There is nothing useful you can do with an FEValues "
229 "object when using a quadrature formula with zero "
230 "quadrature points!"));
236template <
int dim,
int spacedim>
245template <
int dim,
int spacedim>
264 template <
typename Number,
typename Number2>
267 const ::Table<2, double> &shape_values,
268 std::vector<Number> &values)
271 const unsigned int dofs_per_cell = shape_values.n_rows();
272 const unsigned int n_quadrature_points = values.size();
275 std::fill_n(values.begin(),
297 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
304 template <
int dim,
int spacedim,
typename VectorType>
308 const ::Table<2, double> &shape_values,
310 const std::vector<unsigned int> &shape_function_to_row_table,
315 using Number =
typename VectorType::value_type;
317 for (
unsigned int i = 0; i < values.size(); ++i)
318 std::fill_n(values[i].begin(),
320 typename VectorType::value_type());
324 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
325 if (dofs_per_cell == 0)
328 const unsigned int n_quadrature_points =
330 const unsigned int n_components = fe.n_components();
338 for (
unsigned int i = 0; i < values.size(); ++i)
344 for (
unsigned int i = 0; i < values.size(); ++i)
359 if (::internal::CheckForZero<Number>::value(
value) ==
true)
364 const unsigned int comp =
365 fe.system_to_component_index(
shape_func).first +
367 const unsigned int row =
375 for (
unsigned int point = 0; point < n_quadrature_points;
380 for (
unsigned int point = 0; point < n_quadrature_points;
385 for (
unsigned int c = 0; c < n_components; ++c)
387 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
390 const unsigned int row =
391 shape_function_to_row_table[
shape_func * n_components + c];
394 const unsigned int comp = c +
mc * n_components;
399 for (
unsigned int point = 0; point < n_quadrature_points;
404 for (
unsigned int point = 0; point < n_quadrature_points;
415 template <
int order,
int spacedim,
typename Number>
417 do_function_derivatives(
422 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
423 const unsigned int n_quadrature_points =
derivatives.size();
443 if (::internal::CheckForZero<Number>::value(
value) ==
true)
448 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
455 template <
int order,
int dim,
int spacedim,
typename Number>
457 do_function_derivatives(
461 const std::vector<unsigned int> &shape_function_to_row_table,
467 for (
unsigned int i = 0; i <
derivatives.size(); ++i)
474 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
475 if (dofs_per_cell == 0)
479 const unsigned int n_quadrature_points =
481 const unsigned int n_components = fe.n_components();
495 for (
unsigned int i = 0; i <
derivatives.size(); ++i)
510 if (::internal::CheckForZero<Number>::value(value) ==
true)
515 const unsigned int comp =
516 fe.system_to_component_index(
shape_func).first +
518 const unsigned int row =
522 &shape_derivatives[row][0];
525 for (
unsigned int point = 0; point < n_quadrature_points;
529 for (
unsigned int point = 0; point < n_quadrature_points;
534 for (
unsigned int c = 0; c < n_components; ++c)
536 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
539 const unsigned int row =
540 shape_function_to_row_table[
shape_func * n_components + c];
543 &shape_derivatives[row][0];
544 const unsigned int comp = c +
mc * n_components;
547 for (
unsigned int point = 0; point < n_quadrature_points;
552 for (
unsigned int point = 0; point < n_quadrature_points;
562 template <
int spacedim,
typename Number,
typename Number2>
564 do_function_laplacians(
569 const unsigned int dofs_per_cell = shape_hessians.size()[0];
570 const unsigned int n_quadrature_points =
laplacians.size();
592 for (
unsigned int point = 0; point < n_quadrature_points; ++point)
599 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
601 do_function_laplacians(
605 const std::vector<unsigned int> &shape_function_to_row_table,
611 for (
unsigned int i = 0; i <
laplacians.size(); ++i)
614 typename VectorType::value_type());
618 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
619 if (dofs_per_cell == 0)
623 const unsigned int n_quadrature_points =
laplacians.size();
624 const unsigned int n_components = fe.n_components();
632 for (
unsigned int i = 0; i <
laplacians.size(); ++i)
638 for (
unsigned int i = 0; i <
laplacians.size(); ++i)
653 if (::internal::CheckForZero<Number>::value(value) ==
true)
658 const unsigned int comp =
659 fe.system_to_component_index(
shape_func).first +
661 const unsigned int row =
665 &shape_hessians[row][0];
669 for (
unsigned int point = 0; point < n_quadrature_points;
675 for (
unsigned int point = 0; point < n_quadrature_points;
681 for (
unsigned int c = 0; c < n_components; ++c)
683 if (fe.get_nonzero_components(
shape_func)[c] ==
false)
686 const unsigned int row =
687 shape_function_to_row_table[
shape_func * n_components + c];
690 &shape_hessians[row][0];
691 const unsigned int comp = c +
mc * n_components;
696 for (
unsigned int point = 0; point < n_quadrature_points;
702 for (
unsigned int point = 0; point < n_quadrature_points;
713template <
int dim,
int spacedim>
714template <
typename Number>
718 std::vector<Number> &values)
const
731 this->finite_element_output.shape_values,
737template <
int dim,
int spacedim>
738template <
typename Number>
743 std::vector<Number> &values)
const
760template <
int dim,
int spacedim>
761template <
typename Number>
778 this->finite_element_output.shape_values,
780 this->finite_element_output.shape_function_to_row_table,
786template <
int dim,
int spacedim>
787template <
typename Number>
808 this->finite_element_output.shape_function_to_row_table,
816template <
int dim,
int spacedim>
817template <
typename Number>
840 this->finite_element_output.shape_function_to_row_table,
848template <
int dim,
int spacedim>
849template <
typename Number>
866 this->finite_element_output.shape_gradients,
872template <
int dim,
int spacedim>
873template <
typename Number>
895template <
int dim,
int spacedim>
896template <
typename Number>
912 this->finite_element_output.shape_gradients,
914 this->finite_element_output.shape_function_to_row_table,
920template <
int dim,
int spacedim>
921template <
typename Number>
943 this->finite_element_output.shape_function_to_row_table,
951template <
int dim,
int spacedim>
952template <
typename Number>
969 this->finite_element_output.shape_hessians,
975template <
int dim,
int spacedim>
976template <
typename Number>
998template <
int dim,
int spacedim>
999template <
typename Number>
1016 this->finite_element_output.shape_hessians,
1018 this->finite_element_output.shape_function_to_row_table,
1025template <
int dim,
int spacedim>
1026template <
typename Number>
1039 boost::container::small_vector<Number, 200>
dof_values(indices.size());
1046 this->finite_element_output.shape_function_to_row_table,
1054template <
int dim,
int spacedim>
1055template <
typename Number>
1072 this->finite_element_output.shape_hessians,
1078template <
int dim,
int spacedim>
1079template <
typename Number>
1101template <
int dim,
int spacedim>
1102template <
typename Number>
1118 this->finite_element_output.shape_hessians,
1120 this->finite_element_output.shape_function_to_row_table,
1126template <
int dim,
int spacedim>
1127template <
typename Number>
1141 boost::container::small_vector<Number, 200>
dof_values(indices.size());
1148 this->finite_element_output.shape_function_to_row_table,
1156template <
int dim,
int spacedim>
1157template <
typename Number>
1162 std::vector<std::vector<Number>> &
laplacians,
1170 boost::container::small_vector<Number, 200>
dof_values(indices.size());
1177 this->finite_element_output.shape_function_to_row_table,
1185template <
int dim,
int spacedim>
1186template <
typename Number>
1203 this->finite_element_output.shape_3rd_derivatives,
1209template <
int dim,
int spacedim>
1210template <
typename Number>
1231template <
int dim,
int spacedim>
1232template <
typename Number>
1249 this->finite_element_output.shape_3rd_derivatives,
1251 this->finite_element_output.shape_function_to_row_table,
1258template <
int dim,
int spacedim>
1259template <
typename Number>
1272 boost::container::small_vector<Number, 200>
dof_values(indices.size());
1279 this->finite_element_output.shape_function_to_row_table,
1287template <
int dim,
int spacedim>
1296template <
int dim,
int spacedim>
1297const std::vector<Tensor<1, spacedim>> &
1302 "update_normal_vectors")));
1309template <
int dim,
int spacedim>
1330template <
int dim,
int spacedim>
1342 flags |=
mapping->requires_update_flags(flags);
1349template <
int dim,
int spacedim>
1367template <
int dim,
int spacedim>
1374 if (&cell->get_triangulation() !=
1378 ->get_triangulation())
1387 cell->get_triangulation().signals.any_change.connect(
1390 cell->get_triangulation().signals.mesh_movement.connect(
1400 cell->get_triangulation().signals.post_refinement.connect(
1403 cell->get_triangulation().signals.mesh_movement.connect(
1410template <
int dim,
int spacedim>
1431 (cell->is_translation_of(
1442 ->direction_flag() != cell->direction_flag())
1451template <
int dim,
int spacedim>
1460template <
int dim,
int spacedim>
1465template <
int dim,
int spacedim>
1471#include "fe/fe_values_base.inst"
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
typename LevelSelector::cell_iterator level_cell_iterator
types::global_dof_index n_dofs_for_dof_handler() const
CellIteratorWrapper()=default
bool is_initialized() const
void get_interpolated_dof_values(const ReadVector< Number > &in, Vector< Number > &out) const
CellSimilarity::Similarity cell_similarity
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
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
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)
internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > mapping_output
virtual ~FEValuesBase() override
const unsigned int dofs_per_cell
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
CellIteratorWrapper present_cell
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
friend class FEValuesViews::Tensor
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
void get_function_third_derivatives(const ReadVector< Number > &fe_function, std::vector< Tensor< 3, spacedim, Number > > &third_derivatives) 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
boost::signals2::connection tria_listener_refinement
void invalidate_present_cell()
const ObserverPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
bool check_for_cell_similarity_allowed
::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > finite_element_output
const ObserverPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const unsigned int max_n_quadrature_points
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcAccessToUninitializedField(std::string arg1)
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotReinited()
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
typename ActiveSelector::cell_iterator cell_iterator
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.
std::enable_if_t< std::is_fundamental_v< T >, 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)
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)
constexpr types::global_dof_index invalid_dof_index
constexpr unsigned int invalid_unsigned_int
static constexpr const T & value(const T &t)
DEAL_II_HOST constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)