deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
mapping_info.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2012 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15
16#ifndef dealii_matrix_free_mapping_info_h
17#define dealii_matrix_free_mapping_info_h
18
19
20#include <deal.II/base/config.h>
21
25
26#include <deal.II/fe/fe.h>
27#include <deal.II/fe/mapping.h>
28
30
33
36
37#include <memory>
38
39
41
42
43namespace internal
44{
45 namespace MatrixFreeFunctions
46 {
53 template <int dim, typename Number, typename VectorizedArrayType>
55 {
64 void
66 const ::Triangulation<dim> &tria,
67 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
68 const FaceInfo<VectorizedArrayType::size()> &face_info,
69 const std::vector<unsigned int> &active_fe_index,
70 const std::shared_ptr<::hp::MappingCollection<dim>> &mapping,
71 const std::vector<::hp::QCollection<dim>> &quad,
76 const bool piola_transform);
77
84 void
86 const ::Triangulation<dim> &tria,
87 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
88 const FaceInfo<VectorizedArrayType::size()> &face_info,
89 const std::vector<unsigned int> &active_fe_index,
90 const std::shared_ptr<::hp::MappingCollection<dim>> &mapping);
91
96 get_cell_type(const unsigned int cell_chunk_no) const;
97
101 void
103
107 std::size_t
109
114 template <typename StreamType>
115 void
117 const TaskInfo &task_info) const;
118
123
129
135
141
148 std::vector<GeometryType> cell_type;
149
157 std::vector<GeometryType> face_type;
158
166 std::vector<std::array<GeometryType, GeometryInfo<dim>::faces_per_cell>>
168
172 std::vector<MappingInfoStorage<dim, dim, VectorizedArrayType>> cell_data;
173
177 std::vector<MappingInfoStorage<dim - 1, dim, VectorizedArrayType>>
179
184 std::vector<MappingInfoStorage<dim - 1, dim, VectorizedArrayType>>
186
190 std::shared_ptr<::hp::MappingCollection<dim>> mapping_collection;
191
196
201 std::vector<std::vector<ReferenceCell>> reference_cell_types;
202
224 void
226 const ::Triangulation<dim> &tria,
227 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
228 const FaceInfo<VectorizedArrayType::size()> &face_info);
229
234 void
236 const ::Triangulation<dim> &tria,
237 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
238 const std::vector<unsigned int> &active_fe_index,
239 const ::hp::MappingCollection<dim> &mapping);
240
245 void
247 const ::Triangulation<dim> &tria,
248 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
249 const std::vector<FaceToCellTopology<VectorizedArrayType::size()>>
250 &faces,
251 const std::vector<unsigned int> &active_fe_index,
252 const ::hp::MappingCollection<dim> &mapping);
253
258 void
260 const ::Triangulation<dim> &tria,
261 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
262 const FaceInfo<VectorizedArrayType::size()> &face_info,
263 const ::hp::MappingCollection<dim> &mapping);
264 };
265
266
267
272 template <int, typename, bool, typename>
274
275 template <int dim, typename Number, typename VectorizedArrayType>
276 struct MappingInfoCellsOrFaces<dim, Number, false, VectorizedArrayType>
277 {
280 const unsigned int quad_no)
281 {
282 AssertIndexRange(quad_no, mapping_info.cell_data.size());
283 return mapping_info.cell_data[quad_no];
284 }
285 };
286
287 template <int dim, typename Number, typename VectorizedArrayType>
288 struct MappingInfoCellsOrFaces<dim, Number, true, VectorizedArrayType>
289 {
290 static const MappingInfoStorage<dim - 1, dim, VectorizedArrayType> &
292 const unsigned int quad_no)
293 {
294 AssertIndexRange(quad_no, mapping_info.face_data.size());
295 return mapping_info.face_data[quad_no];
296 }
297 };
298
299
300 /* ------------------- inline functions ----------------------------- */
301
302 template <int dim, typename Number, typename VectorizedArrayType>
303 inline GeometryType
305 const unsigned int cell_no) const
306 {
307 AssertIndexRange(cell_no, cell_type.size());
308 return cell_type[cell_no];
309 }
310
311 } // end of namespace MatrixFreeFunctions
312} // end of namespace internal
313
315
316#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define AssertIndexRange(index, range)
UpdateFlags
static const MappingInfoStorage< dim, dim, VectorizedArrayType > & get(const MappingInfo< dim, Number, VectorizedArrayType > &mapping_info, const unsigned int quad_no)
static const MappingInfoStorage< dim - 1, dim, VectorizedArrayType > & get(const MappingInfo< dim, Number, VectorizedArrayType > &mapping_info, const unsigned int quad_no)
void compute_mapping_q(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const FaceInfo< VectorizedArrayType::size()> &face_info)
void initialize_faces(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const std::vector< FaceToCellTopology< VectorizedArrayType::size()> > &faces, const std::vector< unsigned int > &active_fe_index, const ::hp::MappingCollection< dim > &mapping)
std::shared_ptr<::hp::MappingCollection< dim > > mapping_collection
GeometryType get_cell_type(const unsigned int cell_chunk_no) const
ObserverPointer< const Mapping< dim > > mapping
void initialize_cells(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const std::vector< unsigned int > &active_fe_index, const ::hp::MappingCollection< dim > &mapping)
std::vector< GeometryType > cell_type
std::vector< GeometryType > face_type
std::vector< std::array< GeometryType, GeometryInfo< dim >::faces_per_cell > > faces_by_cells_type
void initialize(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const FaceInfo< VectorizedArrayType::size()> &face_info, const std::vector< unsigned int > &active_fe_index, const std::shared_ptr<::hp::MappingCollection< dim > > &mapping, const std::vector<::hp::QCollection< dim > > &quad, const UpdateFlags update_flags_cells, const UpdateFlags update_flags_boundary_faces, const UpdateFlags update_flags_inner_faces, const UpdateFlags update_flags_faces_by_cells, const bool piola_transform)
std::vector< MappingInfoStorage< dim, dim, VectorizedArrayType > > cell_data
void initialize_faces_by_cells(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const FaceInfo< VectorizedArrayType::size()> &face_info, const ::hp::MappingCollection< dim > &mapping)
void update_mapping(const ::Triangulation< dim > &tria, const std::vector< std::pair< unsigned int, unsigned int > > &cells, const FaceInfo< VectorizedArrayType::size()> &face_info, const std::vector< unsigned int > &active_fe_index, const std::shared_ptr<::hp::MappingCollection< dim > > &mapping)
std::vector< std::vector< ReferenceCell > > reference_cell_types
void print_memory_consumption(StreamType &out, const TaskInfo &task_info) const
std::vector< MappingInfoStorage< dim - 1, dim, VectorizedArrayType > > face_data_by_cells
std::vector< MappingInfoStorage< dim - 1, dim, VectorizedArrayType > > face_data