Reference documentation for deal.II version 9.3.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
shape_info.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2011 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_matrix_free_shape_info_h
18 #define dealii_matrix_free_shape_info_h
19 
20 
21 #include <deal.II/base/config.h>
22 
26 
27 #include <deal.II/fe/fe.h>
28 
29 
31 
32 namespace internal
33 {
34  namespace MatrixFreeFunctions
35  {
53  {
63 
70 
77 
82 
88 
95 
100  };
101 
102 
103 
112  template <typename Number>
114  {
119 
123  std::size_t
124  memory_consumption() const;
125 
132 
140 
148 
156 
162 
168 
175 
182 
189 
197 
205 
221 
226 
232  std::array<AlignedVector<Number>, 2> shape_data_on_face;
233 
244  std::array<AlignedVector<Number>, 2> quadrature_data_on_face;
245 
250  std::array<AlignedVector<Number>, 2> values_within_subface;
251 
256  std::array<AlignedVector<Number>, 2> gradients_within_subface;
257 
262  std::array<AlignedVector<Number>, 2> hessians_within_subface;
263 
269 
273  unsigned int fe_degree;
274 
278  unsigned int n_q_points_1d;
279 
285 
292 
299  };
300 
301 
302 
313  template <typename Number>
314  struct ShapeInfo
315  {
322 
326  ShapeInfo();
327 
331  template <int dim, int dim_q>
332  ShapeInfo(const Quadrature<dim_q> & quad,
333  const FiniteElement<dim> &fe,
334  const unsigned int base_element = 0);
335 
344  template <int dim, int dim_q>
345  void
346  reinit(const Quadrature<dim_q> & quad,
347  const FiniteElement<dim> &fe_dim,
348  const unsigned int base_element = 0);
349 
353  template <int dim, int spacedim>
354  static bool
355  is_supported(const FiniteElement<dim, spacedim> &fe);
356 
364  get_shape_data(const unsigned int dimension = 0,
365  const unsigned int component = 0) const;
366 
370  std::size_t
371  memory_consumption() const;
372 
380  std::vector<unsigned int> lexicographic_numbering;
381 
386  std::vector<UnivariateShapeData<Number>> data;
387 
394 
398  unsigned int n_dimensions;
399 
404  unsigned int n_components;
405 
410  unsigned int n_q_points;
411 
417 
421  unsigned int n_q_points_face;
422 
427  std::vector<unsigned int> n_q_points_faces;
428 
433 
470 
510 
518 
519  private:
524  bool
525  check_1d_shapes_symmetric(
526  UnivariateShapeData<Number> &univariate_shape_data);
527 
534  bool
535  check_1d_shapes_collocation(
536  const UnivariateShapeData<Number> &univariate_shape_data) const;
537  };
538 
539 
540 
541  // ------------------------------------------ inline functions
542 
543  template <typename Number>
544  template <int dim, int dim_q>
546  const FiniteElement<dim> &fe_in,
547  const unsigned int base_element_number)
549  , n_dimensions(0)
550  , n_components(0)
551  , n_q_points(0)
552  , dofs_per_component_on_cell(0)
553  , n_q_points_face(0)
554  , dofs_per_component_on_face(0)
555  {
556  reinit(quad, fe_in, base_element_number);
557  }
558 
559  template <typename Number>
560  inline const UnivariateShapeData<Number> &
561  ShapeInfo<Number>::get_shape_data(const unsigned int dimension,
562  const unsigned int component) const
563  {
564  AssertDimension(n_dimensions, data_access.size(0));
565  AssertDimension(n_components, data_access.size(1));
566  AssertIndexRange(dimension, n_dimensions);
567  AssertIndexRange(component, n_components);
568  return *(data_access(dimension, component));
569  }
570 
571  } // end of namespace MatrixFreeFunctions
572 
573 } // end of namespace internal
574 
576 
577 #endif
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
Definition: matrix_block.h:618
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1622
#define AssertIndexRange(index, range)
Definition: exceptions.h:1690
AlignedVector< Number > shape_hessians_collocation_eo
Definition: shape_info.h:204
std::array< AlignedVector< Number >, 2 > shape_data_on_face
Definition: shape_info.h:232
std::vector< unsigned int > n_q_points_faces
Definition: shape_info.h:427
std::array< AlignedVector< Number >, 2 > values_within_subface
Definition: shape_info.h:250
std::array< AlignedVector< Number >, 2 > gradients_within_subface
Definition: shape_info.h:256
::Table< 2, UnivariateShapeData< Number > * > data_access
Definition: shape_info.h:393
::Table< 2, unsigned int > face_orientations
Definition: shape_info.h:517
AlignedVector< Number > shape_gradients_collocation_eo
Definition: shape_info.h:196
std::array< AlignedVector< Number >, 2 > quadrature_data_on_face
Definition: shape_info.h:244
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
std::array< AlignedVector< Number >, 2 > hessians_within_subface
Definition: shape_info.h:262
::Table< 2, unsigned int > face_to_cell_index_hermite
Definition: shape_info.h:509
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
::Table< 2, unsigned int > face_to_cell_index_nodal
Definition: shape_info.h:469
std::vector< UnivariateShapeData< Number > > data
Definition: shape_info.h:386
std::vector< unsigned int > lexicographic_numbering
Definition: shape_info.h:380