Reference documentation for deal.II version 9.4.1
\(\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// 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_mapping_info_h
18#define dealii_matrix_free_mapping_info_h
19
20
21#include <deal.II/base/config.h>
22
26
27#include <deal.II/fe/fe.h>
28#include <deal.II/fe/mapping.h>
29
31
34
38
39#include <memory>
40
41
43
44
45namespace internal
46{
47 namespace MatrixFreeFunctions
48 {
55 template <int dim, typename Number, typename VectorizedArrayType>
57 {
66 void
68 const ::Triangulation<dim> & tria,
69 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
70 const FaceInfo<VectorizedArrayType::size()> & face_info,
71 const std::vector<unsigned int> &active_fe_index,
72 const std::shared_ptr<::hp::MappingCollection<dim>> &mapping,
73 const std::vector<::hp::QCollection<dim>> & quad,
78
85 void
87 const ::Triangulation<dim> & tria,
88 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
89 const FaceInfo<VectorizedArrayType::size()> & face_info,
90 const std::vector<unsigned int> &active_fe_index,
91 const std::shared_ptr<::hp::MappingCollection<dim>> &mapping);
92
97 get_cell_type(const unsigned int cell_chunk_no) const;
98
102 void
104
108 std::size_t
110
115 template <typename StreamType>
116 void
117 print_memory_consumption(StreamType & out,
118 const TaskInfo &task_info) const;
119
124
130
136
142
149 std::vector<GeometryType> cell_type;
150
158 std::vector<GeometryType> face_type;
159
167 std::vector<std::array<GeometryType, GeometryInfo<dim>::faces_per_cell>>
169
173 std::vector<MappingInfoStorage<dim, dim, VectorizedArrayType>> cell_data;
174
178 std::vector<MappingInfoStorage<dim - 1, dim, VectorizedArrayType>>
180
185 std::vector<MappingInfoStorage<dim - 1, dim, VectorizedArrayType>>
187
191 std::shared_ptr<::hp::MappingCollection<dim>> mapping_collection;
192
197
202 std::vector<std::vector<::ReferenceCell>> reference_cell_types;
203
225 void
227 const ::Triangulation<dim> & tria,
228 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
229 const FaceInfo<VectorizedArrayType::size()> & face_info);
230
235 void
237 const ::Triangulation<dim> & tria,
238 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
239 const std::vector<unsigned int> & active_fe_index,
240 const ::hp::MappingCollection<dim> &mapping);
241
246 void
248 const ::Triangulation<dim> & tria,
249 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
250 const std::vector<FaceToCellTopology<VectorizedArrayType::size()>>
251 & faces,
252 const std::vector<unsigned int> & active_fe_index,
253 const ::hp::MappingCollection<dim> &mapping);
254
259 void
261 const ::Triangulation<dim> & tria,
262 const std::vector<std::pair<unsigned int, unsigned int>> &cells,
263 const FaceInfo<VectorizedArrayType::size()> & face_info,
264 const ::hp::MappingCollection<dim> & mapping);
265 };
266
267
268
273 template <int, typename, bool, typename>
275
276 template <int dim, typename Number, typename VectorizedArrayType>
277 struct MappingInfoCellsOrFaces<dim, Number, false, VectorizedArrayType>
278 {
281 const unsigned int quad_no)
282 {
283 AssertIndexRange(quad_no, mapping_info.cell_data.size());
284 return mapping_info.cell_data[quad_no];
285 }
286 };
287
288 template <int dim, typename Number, typename VectorizedArrayType>
289 struct MappingInfoCellsOrFaces<dim, Number, true, VectorizedArrayType>
290 {
291 static const MappingInfoStorage<dim - 1, dim, VectorizedArrayType> &
293 const unsigned int quad_no)
294 {
295 AssertIndexRange(quad_no, mapping_info.face_data.size());
296 return mapping_info.face_data[quad_no];
297 }
298 };
299
300
301
313 template <typename Number,
314 typename VectorizedArrayType = VectorizedArray<Number>>
316 {
317 FPArrayComparator(const Number scaling);
318
322 bool
323 operator()(const std::vector<Number> &v1,
324 const std::vector<Number> &v2) const;
325
330 bool
332 const Tensor<1, VectorizedArrayType::size(), Number> &t1,
333 const Tensor<1, VectorizedArrayType::size(), Number> &t2) const;
334
339 template <int dim>
340 bool
342 const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>>
343 &t1,
344 const Tensor<1, dim, Tensor<1, VectorizedArrayType::size(), Number>>
345 &t2) const;
346
351 template <int dim>
352 bool
354 const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>>
355 &t1,
356 const Tensor<2, dim, Tensor<1, VectorizedArrayType::size(), Number>>
357 &t2) const;
358
362 template <int dim>
363 bool
364 operator()(const std::array<Tensor<2, dim, Number>, dim + 1> &t1,
365 const std::array<Tensor<2, dim, Number>, dim + 1> &t2) const;
366
367 Number tolerance;
368 };
369
370
371
372 /* ------------------- inline functions ----------------------------- */
373
374 template <int dim, typename Number, typename VectorizedArrayType>
375 inline GeometryType
377 const unsigned int cell_no) const
378 {
379 AssertIndexRange(cell_no, cell_type.size());
380 return cell_type[cell_no];
381 }
382
383 } // end of namespace MatrixFreeFunctions
384} // end of namespace internal
385
387
388#endif
Definition: tensor.h:503
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
UpdateFlags
const unsigned int v1
Definition: grid_tools.cc:1000
#define AssertIndexRange(index, range)
Definition: exceptions.h:1732
bool operator()(const std::vector< Number > &v1, const std::vector< Number > &v2) const
bool operator()(const std::array< Tensor< 2, dim, Number >, dim+1 > &t1, const std::array< Tensor< 2, dim, Number >, dim+1 > &t2) const
bool operator()(const Tensor< 1, dim, Tensor< 1, VectorizedArrayType::size(), Number > > &t1, const Tensor< 1, dim, Tensor< 1, VectorizedArrayType::size(), Number > > &t2) const
bool operator()(const Tensor< 1, VectorizedArrayType::size(), Number > &t1, const Tensor< 1, VectorizedArrayType::size(), Number > &t2) const
bool operator()(const Tensor< 2, dim, Tensor< 1, VectorizedArrayType::size(), Number > > &t1, const Tensor< 2, dim, Tensor< 1, VectorizedArrayType::size(), Number > > &t2) const
static const MappingInfoStorage< dim, dim, VectorizedArrayType > & get(const MappingInfo< dim, Number, VectorizedArrayType > &mapping_info, const unsigned int quad_no)
Definition: mapping_info.h:280
static const MappingInfoStorage< dim - 1, dim, VectorizedArrayType > & get(const MappingInfo< dim, Number, VectorizedArrayType > &mapping_info, const unsigned int quad_no)
Definition: mapping_info.h:292
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
Definition: mapping_info.h:191
GeometryType get_cell_type(const unsigned int cell_chunk_no) const
Definition: mapping_info.h:376
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
Definition: mapping_info.h:149
std::vector< GeometryType > face_type
Definition: mapping_info.h:158
std::vector< std::array< GeometryType, GeometryInfo< dim >::faces_per_cell > > faces_by_cells_type
Definition: mapping_info.h:168
std::vector< std::vector<::ReferenceCell > > reference_cell_types
Definition: mapping_info.h:202
std::vector< MappingInfoStorage< dim, dim, VectorizedArrayType > > cell_data
Definition: mapping_info.h:173
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)
SmartPointer< const Mapping< dim > > mapping
Definition: mapping_info.h:196
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)
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)
void print_memory_consumption(StreamType &out, const TaskInfo &task_info) const
std::vector< MappingInfoStorage< dim - 1, dim, VectorizedArrayType > > face_data_by_cells
Definition: mapping_info.h:186
std::vector< MappingInfoStorage< dim - 1, dim, VectorizedArrayType > > face_data
Definition: mapping_info.h:179
const ::Triangulation< dim, spacedim > & tria