17 #ifndef dealii_matrix_free_fe_evaluation_data_h
18 #define dealii_matrix_free_fe_evaluation_data_h
50 <<
"You are requesting information from an FEEvaluation/FEFaceEvaluation "
51 <<
"object for which this kind of information has not been computed. What "
52 <<
"information these objects compute is determined by the update_* flags you "
53 <<
"pass to MatrixFree::reinit() via MatrixFree::AdditionalData. Here, "
54 <<
"the operation you are attempting requires the <" << arg1
55 <<
"> flag to be set, but it was apparently not specified "
56 <<
"upon initialization.");
62 int n_q_points_1d = fe_degree + 1,
63 int n_components_ = 1,
77 namespace MatrixFreeFunctions
79 template <
int,
typename>
80 class MappingDataOnTheFly;
113 template <
int dim,
typename Number,
bool is_face>
118 MappingInfoStorage<(is_face ? dim - 1 : dim), dim, Number>;
164 const unsigned int n_components);
193 JxW(
const unsigned int q_point)
const;
387 const std::vector<unsigned int> &
485 const std::array<unsigned int, n_lanes> &
499 const std::array<unsigned int, n_lanes> &
528 const std::array<unsigned int, n_lanes> &
580 template <
typename T>
581 std::array<
T, Number::size()>
589 template <
typename T>
592 const std::array<
T, Number::size()> & value)
const;
620 template <
typename T>
621 std::array<
T, Number::size()>
629 template <
typename T>
632 const std::array<
T, Number::size()> & value)
const;
667 const std::shared_ptr<
1018 template <
int,
int,
typename,
bool,
typename>
1021 template <
int,
int,
int,
int,
typename,
typename>
1042 template <
int dim,
typename Number,
bool is_face>
1047 InitializationData{&shape_info, nullptr, nullptr, 0, 0, nullptr},
1054 template <
int dim,
typename Number,
bool is_face>
1056 const InitializationData &initialization_data,
1060 :
data(initialization_data.shape_info)
1105 template <
int dim,
typename Number,
bool is_face>
1107 const std::shared_ptr<
1145 .jacobian_gradients_non_inverse[0]
1153 template <
int dim,
typename Number,
bool is_face>
1206 template <
int dim,
typename Number,
bool is_face>
1214 const unsigned int tensor_dofs_per_component =
1215 Utilities::fixed_power<dim>(
data->
data.front().fe_degree + 1);
1218 const unsigned int size_scratch_data =
1222 const unsigned int size_data_arrays =
1224 (
n_components * ((dim * (dim + 1)) / 2 + 2 * dim + 2) *
1227 const unsigned int allocated_size = size_scratch_data + size_data_arrays;
1231 Number(numbers::signaling_nan<ScalarNumber>()));
1257 template <
int dim,
typename Number,
bool is_face>
1263 ExcMessage(
"Faces can only be set if the is_face template parameter "
1288 template <
int dim,
typename Number,
bool is_face>
1291 const unsigned int q_point)
const
1296 "update_normal_vectors"));
1305 template <
int dim,
typename Number,
bool is_face>
1312 "update_values|update_gradients"));
1324 template <
int dim,
typename Number,
bool is_face>
1327 const unsigned int q)
const
1332 "update_quadrature_points"));
1337 if (is_face ==
false &&
1345 for (
unsigned int d = 0;
d < dim; ++
d)
1346 point[
d] += jac[
d][
d] *
static_cast<typename Number::value_type
>(
1349 for (
unsigned int d = 0;
d < dim; ++
d)
1350 for (
unsigned int e = 0;
e < dim; ++
e)
1351 point[
d] += jac[
d][
e] *
static_cast<typename Number::value_type
>(
1361 template <
int dim,
typename Number,
bool is_face>
1364 const unsigned int q_point)
const
1369 "update_gradients"));
1378 template <
int dim,
typename Number,
bool is_face>
1379 inline const Number *
1387 template <
int dim,
typename Number,
bool is_face>
1399 template <
int dim,
typename Number,
bool is_face>
1400 inline const Number *
1411 template <
int dim,
typename Number,
bool is_face>
1424 template <
int dim,
typename Number,
bool is_face>
1425 inline const Number *
1437 template <
int dim,
typename Number,
bool is_face>
1450 template <
int dim,
typename Number,
bool is_face>
1451 inline const Number *
1462 template <
int dim,
typename Number,
bool is_face>
1474 template <
int dim,
typename Number,
bool is_face>
1491 template <
int dim,
typename Number,
bool is_face>
1503 template <
int dim,
typename Number,
bool is_face>
1513 template <
int dim,
typename Number,
bool is_face>
1519 "FEEvaluation was not initialized with a MatrixFree object!"));
1525 template <
int dim,
typename Number,
bool is_face>
1526 inline const std::vector<unsigned int> &
1534 template <
int dim,
typename Number,
bool is_face>
1543 template <
int dim,
typename Number,
bool is_face>
1556 template <
int dim,
typename Number,
bool is_face>
1565 template <
int dim,
typename Number,
bool is_face>
1574 template <
int dim,
typename Number,
bool is_face>
1583 template <
int dim,
typename Number,
bool is_face>
1592 template <
int dim,
typename Number,
bool is_face>
1601 ExcMessage(
"All face numbers can only be queried for ECL at exterior "
1602 "faces. Use get_face_no() in other cases."));
1609 template <
int dim,
typename Number,
bool is_face>
1618 template <
int dim,
typename Number,
bool is_face>
1621 const unsigned int v)
const
1628 ExcMessage(
"All face numbers can only be queried for ECL at exterior "
1629 "faces. Use get_face_no() in other cases."));
1636 template <
int dim,
typename Number,
bool is_face>
1645 template <
int dim,
typename Number,
bool is_face>
1654 template <
int dim,
typename Number,
bool is_face>
1665 template <std::size_t
N,
1666 typename VectorizedArrayType2,
1667 typename GlobalVectorType,
1670 process_cell_or_face_data(
const std::array<unsigned int, N> indices,
1671 GlobalVectorType & array,
1672 VectorizedArrayType2 & out,
1675 for (
unsigned int i = 0; i <
N; ++i)
1679 fu(out[i], array[indices[i] /
N][indices[i] %
N]);
1686 template <
int dim,
typename Number,
bool is_face>
1691 Number out = Number(1.);
1692 internal::process_cell_or_face_data(this->get_cell_ids(),
1695 [](
auto &local,
const auto &global) {
1703 template <
int dim,
typename Number,
bool is_face>
1707 const Number & in)
const
1709 internal::process_cell_or_face_data(this->get_cell_ids(),
1712 [](
const auto &local,
auto &global) {
1719 template <
int dim,
typename Number,
bool is_face>
1720 template <
typename T>
1721 inline std::array<
T, Number::size()>
1725 std::array<
T, Number::size()> out;
1726 internal::process_cell_or_face_data(this->get_cell_ids(),
1729 [](
auto &local,
const auto &global) {
1737 template <
int dim,
typename Number,
bool is_face>
1738 template <
typename T>
1742 const std::array<
T, Number::size()> & in)
const
1744 internal::process_cell_or_face_data(this->get_cell_ids(),
1747 [](
const auto &local,
auto &global) {
1754 template <
int dim,
typename Number,
bool is_face>
1759 Number out = Number(1.);
1760 internal::process_cell_or_face_data(this->get_face_ids(),
1763 [](
auto &local,
const auto &global) {
1771 template <
int dim,
typename Number,
bool is_face>
1775 const Number & in)
const
1777 internal::process_cell_or_face_data(this->get_face_ids(),
1780 [](
const auto &local,
auto &global) {
1787 template <
int dim,
typename Number,
bool is_face>
1788 template <
typename T>
1789 inline std::array<
T, Number::size()>
1793 std::array<
T, Number::size()> out;
1794 internal::process_cell_or_face_data(this->get_face_ids(),
1797 [](
auto &local,
const auto &global) {
1805 template <
int dim,
typename Number,
bool is_face>
1806 template <
typename T>
1810 const std::array<
T, Number::size()> & in)
const
1812 internal::process_cell_or_face_data(this->get_face_ids(),
1815 [](
const auto &local,
auto &global) {
void resize_fast(const size_type new_size)
void resize(const size_type new_size)
void reinit(value_type *starting_element, const std::size_t n_elements)
AlignedVector< VectorizedArrayType > * scratch_data_array
const unsigned int quad_no
bool hessians_quad_submitted
internal::MatrixFreeFunctions::GeometryType get_cell_type() const
const Tensor< 2, dim, Number > * jacobian
const MappingInfoStorageType::QuadratureDescriptor * descriptor
Point< dim, Number > quadrature_point(const unsigned int q) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > quadrature_point_indices() const
const unsigned int n_quadrature_points
const MappingInfoStorageType * mapping_data
internal::MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index
std::uint8_t get_face_no(const unsigned int v=0) const
ArrayView< Number > scratch_data
internal::MatrixFreeFunctions::DoFInfo::DoFAccessIndex get_dof_access_index() const
const Point< dim, Number > * quadrature_points
unsigned int subface_index
const Tensor< 1, dim *(dim+1)/2, Tensor< 1, dim, Number > > * jacobian_gradients_non_inverse
bool values_quad_submitted
FEEvaluationData(const FEEvaluationData &other)=default
void reinit_face(const internal::MatrixFreeFunctions::FaceToCellTopology< n_lanes > &face)
Number read_face_data(const AlignedVector< Number > &array) const
Number JxW(const unsigned int q_point) const
FEEvaluationData & operator=(const FEEvaluationData &other)
const std::array< unsigned int, n_lanes > & get_cell_or_face_ids() const
unsigned int get_first_selected_component() const
const unsigned int n_fe_components
void set_cell_data(AlignedVector< Number > &array, const Number &value) const
const ShapeInfoType * data
Number * gradients_from_hessians_quad
std::shared_ptr< internal::MatrixFreeFunctions::MappingDataOnTheFly< dim, Number > > mapped_geometry
internal::MatrixFreeFunctions::DoFInfo DoFInfo
unsigned int get_active_quadrature_index() const
unsigned int get_mapping_data_index_offset() const
bool gradients_quad_initialized
void set_data_pointers(AlignedVector< Number > *scratch_data, const unsigned int n_components)
std::array< std::uint8_t, n_lanes > face_numbers
const unsigned int active_fe_index
static constexpr unsigned int n_lanes
const Tensor< 1, dim, Number > * normal_vectors
Tensor< 1, dim, Number > get_normal_vector(const unsigned int q_point) const
const Number * begin_values() const
internal::MatrixFreeFunctions::GeometryType cell_type
std::array< T, Number::size()> read_face_data(const AlignedVector< std::array< T, Number::size()>> &array) const
const Number * begin_hessians() const
const std::array< unsigned int, n_lanes > & get_cell_ids() const
Number * begin_dof_values()
std::array< unsigned int, n_lanes > cell_ids
unsigned int get_current_cell_index() const
unsigned int get_subface_index() const
Number * begin_gradients()
bool divergence_is_requested
Number read_cell_data(const AlignedVector< Number > &array) const
const unsigned int active_quad_index
unsigned int get_active_fe_index() const
Number * values_from_gradients_quad
const Number * begin_gradients() const
bool gradients_quad_submitted
const std::vector< unsigned int > & get_internal_dof_numbering() const
unsigned int get_quadrature_index() const
std::array< std::uint8_t, n_lanes > face_orientations
const ScalarNumber * quadrature_weights
const Tensor< 1, dim *(dim+1)/2, Tensor< 1, dim, Number > > * jacobian_gradients
std::array< T, Number::size()> read_cell_data(const AlignedVector< std::array< T, Number::size()>> &array) const
const Tensor< 1, dim, Number > * normal_x_jacobian
const internal::MatrixFreeFunctions::DoFInfo & get_dof_info() const
bool is_interior_face() const
const std::array< unsigned int, n_lanes > & get_face_ids() const
virtual ~FEEvaluationData()=default
ArrayView< Number > get_scratch_data() const
static constexpr unsigned int dimension
internal::MatrixFreeFunctions::ShapeInfo< VectorizedArrayType > ShapeInfoType
FEEvaluationData(const std::shared_ptr< internal::MatrixFreeFunctions::MappingDataOnTheFly< dim, Number >> &mapping_data, const unsigned int n_fe_components, const unsigned int first_selected_component)
Tensor< 2, dim, Number > inverse_jacobian(const unsigned int q_point) const
bool values_quad_initialized
FEEvaluationData(const ShapeInfoType &shape_info, const bool is_interior_face=true)
void set_cell_data(AlignedVector< std::array< T, Number::size()>> &array, const std::array< T, Number::size()> &value) const
bool dof_values_initialized
typename internal::VectorizedArrayTrait< Number >::value_type ScalarNumber
std::array< unsigned int, n_lanes > face_ids
const ShapeInfoType & get_shape_info() const
FEEvaluationData(const InitializationData &initialization_data, const bool is_interior_face, const unsigned int quad_no, const unsigned int first_selected_component)
void set_face_data(AlignedVector< Number > &array, const Number &value) const
Number * begin_hessians()
std::uint8_t get_face_orientation(const unsigned int v=0) const
bool hessians_quad_initialized
unsigned int get_cell_or_face_batch_id() const
void set_face_data(AlignedVector< std::array< T, Number::size()>> &array, const std::array< T, Number::size()> &value) const
const unsigned int first_selected_component
const Number * begin_dof_values() const
const unsigned int dofs_per_component
const unsigned int n_q_points
static constexpr unsigned int n_components
const Point< dim > & point(const unsigned int i) const
#define DEAL_II_ALWAYS_INLINE
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcAccessToUninitializedField()
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNotInitialized()
#define Assert(cond, exc)
static ::ExceptionBase & ExcMatrixFreeAccessToUninitializedMappingField(std::string arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcMessage(std::string arg1)
@ general
No special properties.
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim >>> &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double >> &properties={})
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
VectorType::value_type * begin(VectorType &V)
static const unsigned int invalid_unsigned_int
boost::integer_range< IncrementableType > iota_view
const MappingInfoStorageType * mapping_data
unsigned int active_quad_index
const MappingInfoStorageType::QuadratureDescriptor * descriptor
const ShapeInfoType * shape_info
unsigned int active_fe_index
@ dof_access_face_exterior
@ dof_access_face_interior
unsigned char subface_index
unsigned char interior_face_no
std::array< unsigned int, vectorization_width > cells_interior
types::boundary_id exterior_face_no
std::array< unsigned int, vectorization_width > cells_exterior
unsigned char face_orientation
Quadrature< structdim > quadrature
AlignedVector< unsigned int > data_index_offsets
unsigned int dofs_per_component_on_cell
std::vector< UnivariateShapeData< Number > > data
std::vector< unsigned int > lexicographic_numbering