Reference documentation for deal.II version 9.2.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 - 2020 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  };
96 
97 
98 
109  template <typename Number>
111  {
116 
120  std::size_t
121  memory_consumption() const;
122 
129 
138 
147 
156 
162 
168 
175 
182 
189 
197 
205 
221 
226 
233 
239 
245 
251 
257 
261  unsigned int fe_degree;
262 
266  unsigned int n_q_points_1d;
267 
273  };
274 
275 
276 
289  template <typename Number>
290  struct ShapeInfo
291  {
298 
302  ShapeInfo();
303 
307  template <int dim>
308  ShapeInfo(const Quadrature<1> & quad,
309  const FiniteElement<dim> &fe,
310  const unsigned int base_element = 0);
311 
320  template <int dim>
321  void
322  reinit(const Quadrature<1> & quad,
323  const FiniteElement<dim> &fe_dim,
324  const unsigned int base_element = 0);
325 
333  get_shape_data(const unsigned int dimension = 0,
334  const unsigned int component = 0) const;
335 
339  std::size_t
340  memory_consumption() const;
341 
349  std::vector<unsigned int> lexicographic_numbering;
350 
355  std::vector<UnivariateShapeData<Number>> data;
356 
363 
367  unsigned int n_dimensions;
368 
373  unsigned int n_components;
374 
379  unsigned int n_q_points;
380 
386 
390  unsigned int n_q_points_face;
391 
396 
433 
473 
474  private:
479  bool
481  UnivariateShapeData<Number> &univariate_shape_data);
482 
489  bool
491  const UnivariateShapeData<Number> &univariate_shape_data) const;
492  };
493 
494 
495 
496  // ------------------------------------------ inline functions
497 
498  template <typename Number>
499  template <int dim>
501  const FiniteElement<dim> &fe_in,
502  const unsigned int base_element_number)
503  : element_type(tensor_general)
504  , n_dimensions(0)
505  , n_components(0)
506  , n_q_points(0)
507  , dofs_per_component_on_cell(0)
508  , n_q_points_face(0)
509  , dofs_per_component_on_face(0)
510  {
511  reinit(quad, fe_in, base_element_number);
512  }
513 
514  template <typename Number>
515  inline const UnivariateShapeData<Number> &
516  ShapeInfo<Number>::get_shape_data(const unsigned int dimension,
517  const unsigned int component) const
518  {
519  AssertDimension(n_dimensions, data_access.size(0));
520  AssertDimension(n_components, data_access.size(1));
521  AssertIndexRange(dimension, n_dimensions);
522  AssertIndexRange(component, n_components);
523  return *(data_access(dimension, component));
524  }
525 
526  } // end of namespace MatrixFreeFunctions
527 
528 } // end of namespace internal
529 
531 
532 #endif
internal::MatrixFreeFunctions::UnivariateShapeData::inverse_shape_values
AlignedVector< Number > inverse_shape_values
Definition: shape_info.h:220
internal::MatrixFreeFunctions::ShapeInfo::memory_consumption
std::size_t memory_consumption() const
internal::MatrixFreeFunctions::UnivariateShapeData::gradients_within_subface
AlignedVector< Number > gradients_within_subface[2]
Definition: shape_info.h:244
internal::MatrixFreeFunctions::ShapeInfo::data
std::vector< UnivariateShapeData< Number > > data
Definition: shape_info.h:355
internal::MatrixFreeFunctions::UnivariateShapeData::quadrature
Quadrature< 1 > quadrature
Definition: shape_info.h:256
internal::MatrixFreeFunctions::UnivariateShapeData::fe_degree
unsigned int fe_degree
Definition: shape_info.h:261
internal::MatrixFreeFunctions::UnivariateShapeData::values_within_subface
AlignedVector< Number > values_within_subface[2]
Definition: shape_info.h:238
internal::MatrixFreeFunctions::ShapeInfo::element_type
ElementType element_type
Definition: shape_info.h:297
internal::MatrixFreeFunctions::ShapeInfo::ShapeInfo
ShapeInfo()
internal::MatrixFreeFunctions::UnivariateShapeData::nodal_at_cell_boundaries
bool nodal_at_cell_boundaries
Definition: shape_info.h:272
internal::MatrixFreeFunctions::UnivariateShapeData::hessians_within_subface
AlignedVector< Number > hessians_within_subface[2]
Definition: shape_info.h:250
internal::MatrixFreeFunctions::UnivariateShapeData::shape_values
AlignedVector< Number > shape_values
Definition: shape_info.h:137
internal::MatrixFreeFunctions::UnivariateShapeData::n_q_points_1d
unsigned int n_q_points_1d
Definition: shape_info.h:266
internal::MatrixFreeFunctions::UnivariateShapeData::inverse_shape_values_eo
AlignedVector< Number > inverse_shape_values_eo
Definition: shape_info.h:225
internal::MatrixFreeFunctions::ShapeInfo::n_q_points
unsigned int n_q_points
Definition: shape_info.h:379
internal::MatrixFreeFunctions::ShapeInfo
Definition: shape_info.h:290
internal::MatrixFreeFunctions::ShapeInfo::n_dimensions
unsigned int n_dimensions
Definition: shape_info.h:367
internal::MatrixFreeFunctions::ShapeInfo::face_to_cell_index_nodal
::Table< 2, unsigned int > face_to_cell_index_nodal
Definition: shape_info.h:432
internal::MatrixFreeFunctions::tensor_symmetric
@ tensor_symmetric
Definition: shape_info.h:76
AssertIndexRange
#define AssertIndexRange(index, range)
Definition: exceptions.h:1649
DoFHandler::n_components
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
internal::MatrixFreeFunctions::truncated_tensor
@ truncated_tensor
Definition: shape_info.h:87
DoFTools::n_components
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
internal::MatrixFreeFunctions::ShapeInfo::lexicographic_numbering
std::vector< unsigned int > lexicographic_numbering
Definition: shape_info.h:349
quadrature_lib.h
internal::MatrixFreeFunctions::UnivariateShapeData::memory_consumption
std::size_t memory_consumption() const
Table
Definition: table.h:699
internal::MatrixFreeFunctions::UnivariateShapeData::shape_values_eo
AlignedVector< Number > shape_values_eo
Definition: shape_info.h:174
internal::MatrixFreeFunctions::ElementType
ElementType
Definition: shape_info.h:52
internal::MatrixFreeFunctions::ShapeInfo::data_access
::Table< 2, UnivariateShapeData< Number > * > data_access
Definition: shape_info.h:362
internal::MatrixFreeFunctions::ShapeInfo::n_q_points_face
unsigned int n_q_points_face
Definition: shape_info.h:390
internal::reinit
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
Definition: matrix_block.h:621
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
fe.h
AlignedVector< Number >
internal::MatrixFreeFunctions::UnivariateShapeData::shape_hessians_eo
AlignedVector< Number > shape_hessians_eo
Definition: shape_info.h:188
internal::MatrixFreeFunctions::ShapeInfo::dofs_per_component_on_face
unsigned int dofs_per_component_on_face
Definition: shape_info.h:395
internal::MatrixFreeFunctions::UnivariateShapeData
Definition: shape_info.h:110
AssertDimension
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1579
internal::MatrixFreeFunctions::tensor_general
@ tensor_general
Definition: shape_info.h:81
internal::MatrixFreeFunctions::ShapeInfo::check_1d_shapes_collocation
bool check_1d_shapes_collocation(const UnivariateShapeData< Number > &univariate_shape_data) const
internal::MatrixFreeFunctions::tensor_symmetric_hermite
@ tensor_symmetric_hermite
Definition: shape_info.h:69
internal::MatrixFreeFunctions::UnivariateShapeData::shape_gradients_eo
AlignedVector< Number > shape_gradients_eo
Definition: shape_info.h:181
FiniteElement< dim >
exceptions.h
internal::MatrixFreeFunctions::ShapeInfo::reinit
void reinit(const Quadrature< 1 > &quad, const FiniteElement< dim > &fe_dim, const unsigned int base_element=0)
internal::MatrixFreeFunctions::tensor_symmetric_collocation
@ tensor_symmetric_collocation
Definition: shape_info.h:62
internal::MatrixFreeFunctions::UnivariateShapeData::shape_gradients_collocation
AlignedVector< Number > shape_gradients_collocation
Definition: shape_info.h:161
aligned_vector.h
internal::MatrixFreeFunctions::UnivariateShapeData::shape_hessians
AlignedVector< Number > shape_hessians
Definition: shape_info.h:155
internal::MatrixFreeFunctions::UnivariateShapeData::shape_gradients
AlignedVector< Number > shape_gradients
Definition: shape_info.h:146
internal::MatrixFreeFunctions::ShapeInfo::get_shape_data
const UnivariateShapeData< Number > & get_shape_data(const unsigned int dimension=0, const unsigned int component=0) const
Definition: shape_info.h:516
config.h
internal::MatrixFreeFunctions::ShapeInfo::face_to_cell_index_hermite
::Table< 2, unsigned int > face_to_cell_index_hermite
Definition: shape_info.h:472
internal
Definition: aligned_vector.h:369
internal::MatrixFreeFunctions::ShapeInfo::check_1d_shapes_symmetric
bool check_1d_shapes_symmetric(UnivariateShapeData< Number > &univariate_shape_data)
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::MatrixFreeFunctions::UnivariateShapeData::shape_hessians_collocation_eo
AlignedVector< Number > shape_hessians_collocation_eo
Definition: shape_info.h:204
internal::MatrixFreeFunctions::UnivariateShapeData::shape_data_on_face
AlignedVector< Number > shape_data_on_face[2]
Definition: shape_info.h:232
Quadrature< 1 >
internal::MatrixFreeFunctions::ShapeInfo::dofs_per_component_on_cell
unsigned int dofs_per_component_on_cell
Definition: shape_info.h:385
internal::MatrixFreeFunctions::UnivariateShapeData::shape_hessians_collocation
AlignedVector< Number > shape_hessians_collocation
Definition: shape_info.h:167
internal::MatrixFreeFunctions::tensor_symmetric_plus_dg0
@ tensor_symmetric_plus_dg0
Definition: shape_info.h:94
internal::MatrixFreeFunctions::UnivariateShapeData::UnivariateShapeData
UnivariateShapeData()
internal::MatrixFreeFunctions::ShapeInfo::n_components
unsigned int n_components
Definition: shape_info.h:373
internal::MatrixFreeFunctions::UnivariateShapeData::shape_gradients_collocation_eo
AlignedVector< Number > shape_gradients_collocation_eo
Definition: shape_info.h:196
internal::MatrixFreeFunctions::UnivariateShapeData::element_type
ElementType element_type
Definition: shape_info.h:128