Reference documentation for deal.II version GIT relicensing-222-g16f23ad599 2024-03-28 18:20:02+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
grid_tools_cache.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2024 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#ifndef dealii_grid_grid_tools_cache_h
16#define dealii_grid_grid_tools_cache_h
17
18
19#include <deal.II/base/config.h>
20
22#include <deal.II/base/point.h>
24
25#include <deal.II/fe/mapping.h>
26
28#include <deal.II/grid/tria.h>
31
33
34#include <boost/signals2.hpp>
35
36#include <cmath>
37
39
40namespace GridTools
41{
63 template <int dim, int spacedim = dim>
64 class Cache : public Subscriptor
65 {
66 public:
78 (ReferenceCells::get_hypercube<dim>()
79#ifndef _MSC_VER
80 .template get_default_linear_mapping<dim, spacedim>()
81#else
82 .ReferenceCell::get_default_linear_mapping<dim, spacedim>()
83#endif
84 ));
85
89 ~Cache() override;
90
101 void
103
104
109 const std::vector<
110 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>> &
112
117 const std::vector<std::vector<Tensor<1, spacedim>>> &
119
124 const std::map<unsigned int, Point<spacedim>> &
125 get_used_vertices() const;
126
131 const RTree<std::pair<Point<spacedim>, unsigned int>> &
133
140 const RTree<
141 std::pair<BoundingBox<spacedim>,
144
155 const RTree<
156 std::pair<BoundingBox<spacedim>,
159
160
167 const std::vector<std::set<unsigned int>> &
169
174 const std::map<unsigned int, std::set<types::subdomain_id>> &
176
182
187 get_mapping() const;
188
189
218 const RTree<std::pair<BoundingBox<spacedim>, unsigned int>> &
219 get_covering_rtree(const unsigned int level = 0) const;
220
221 private:
226
231
236
237
242 mutable std::vector<
243 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>>
245
250 mutable std::vector<std::vector<Tensor<1, spacedim>>>
252
261 mutable std::map<unsigned int,
264
269 mutable std::map<unsigned int, Point<spacedim>> used_vertices;
270
275
280 mutable RTree<
281 std::pair<BoundingBox<spacedim>,
284
289 mutable RTree<
290 std::pair<BoundingBox<spacedim>,
293
294
299 mutable std::vector<std::set<unsigned int>> vertex_to_neighbor_subdomain;
300
305 mutable std::map<unsigned int, std::set<::types::subdomain_id>>
307
311 boost::signals2::connection tria_signal;
312 };
313
314
315
316 // Inline functions
317 template <int dim, int spacedim>
318 inline const Triangulation<dim, spacedim> &
320 {
321 return *tria;
322 }
323
324
325
326 template <int dim, int spacedim>
327 inline const Mapping<dim, spacedim> &
329 {
330 return *mapping;
331 }
332} // namespace GridTools
333
334
335
337
338#endif
SmartPointer< const Triangulation< dim, spacedim >, Cache< dim, spacedim > > tria
CacheUpdateFlags update_flags
const std::vector< std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > & get_vertex_to_cell_map() const
std::vector< std::vector< Tensor< 1, spacedim > > > vertex_to_cell_centers
const RTree< std::pair< BoundingBox< spacedim >, unsigned int > > & get_covering_rtree(const unsigned int level=0) const
SmartPointer< const Mapping< dim, spacedim >, Cache< dim, spacedim > > mapping
std::vector< std::set< unsigned int > > vertex_to_neighbor_subdomain
const std::vector< std::vector< Tensor< 1, spacedim > > > & get_vertex_to_cell_centers_directions() const
RTree< std::pair< BoundingBox< spacedim >, typename Triangulation< dim, spacedim >::active_cell_iterator > > cell_bounding_boxes_rtree
RTree< std::pair< BoundingBox< spacedim >, typename Triangulation< dim, spacedim >::active_cell_iterator > > locally_owned_cell_bounding_boxes_rtree
const std::vector< std::set< unsigned int > > & get_vertex_to_neighbor_subdomain() const
std::map< unsigned int, Point< spacedim > > used_vertices
const std::map< unsigned int, std::set< types::subdomain_id > > & get_vertices_with_ghost_neighbors() const
const RTree< std::pair< BoundingBox< spacedim >, typename Triangulation< dim, spacedim >::active_cell_iterator > > & get_locally_owned_cell_bounding_boxes_rtree() const
const Mapping< dim, spacedim > & get_mapping() const
RTree< std::pair< Point< spacedim >, unsigned int > > used_vertices_rtree
const Triangulation< dim, spacedim > & get_triangulation() const
const RTree< std::pair< Point< spacedim >, unsigned int > > & get_used_vertices_rtree() const
std::map< unsigned int, std::set<::types::subdomain_id > > vertices_with_ghost_neighbors
const RTree< std::pair< BoundingBox< spacedim >, typename Triangulation< dim, spacedim >::active_cell_iterator > > & get_cell_bounding_boxes_rtree() const
std::vector< std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > vertex_to_cells
const std::map< unsigned int, Point< spacedim > > & get_used_vertices() const
std::map< unsigned int, RTree< std::pair< BoundingBox< spacedim >, unsigned int > > > covering_rtree
void mark_for_update(const CacheUpdateFlags &flags=update_all)
boost::signals2::connection tria_signal
Abstract base class for mapping classes.
Definition mapping.h:316
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
unsigned int level
Definition grid_out.cc:4616
spacedim & mapping
const Triangulation< dim, spacedim > & tria
boost::geometry::index::rtree< LeafType, IndexType, IndexableGetter > RTree
Definition rtree.h:143