Reference documentation for deal.II version 9.5.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\}}\)
Loading...
Searching...
No Matches
grid_tools_cache.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2017 - 2022 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#ifndef dealii_grid_grid_tools_cache_h
17#define dealii_grid_grid_tools_cache_h
18
19
20#include <deal.II/base/config.h>
21
23#include <deal.II/base/point.h>
25
26#include <deal.II/fe/mapping.h>
27
29#include <deal.II/grid/tria.h>
32
34
35#include <boost/signals2.hpp>
36
37#include <cmath>
38
40
41namespace GridTools
42{
64 template <int dim, int spacedim = dim>
65 class Cache : public Subscriptor
66 {
67 public:
79 (ReferenceCells::get_hypercube<dim>()
80#ifndef _MSC_VER
81 .template get_default_linear_mapping<dim, spacedim>()
82#else
83 .ReferenceCell::get_default_linear_mapping<dim, spacedim>()
84#endif
85 ));
86
90 ~Cache() override;
91
102 void
104
105
110 const std::vector<
111 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>> &
113
118 const std::vector<std::vector<Tensor<1, spacedim>>> &
120
125 const std::map<unsigned int, Point<spacedim>> &
126 get_used_vertices() const;
127
132 const RTree<std::pair<Point<spacedim>, unsigned int>> &
134
141 const RTree<
142 std::pair<BoundingBox<spacedim>,
145
156 const RTree<
157 std::pair<BoundingBox<spacedim>,
160
161
168 const std::vector<std::set<unsigned int>> &
170
175 const std::map<unsigned int, std::set<types::subdomain_id>> &
177
183
188 get_mapping() const;
189
190
219 const RTree<std::pair<BoundingBox<spacedim>, unsigned int>> &
220 get_covering_rtree(const unsigned int level = 0) const;
221
222 private:
227
232
237
238
243 mutable std::vector<
244 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>>
246
251 mutable std::vector<std::vector<Tensor<1, spacedim>>>
253
262 mutable std::map<unsigned int,
265
270 mutable std::map<unsigned int, Point<spacedim>> used_vertices;
271
276
281 mutable RTree<
282 std::pair<BoundingBox<spacedim>,
285
290 mutable RTree<
291 std::pair<BoundingBox<spacedim>,
294
295
300 mutable std::vector<std::set<unsigned int>> vertex_to_neighbor_subdomain;
301
306 mutable std::map<unsigned int, std::set<::types::subdomain_id>>
308
312 boost::signals2::connection tria_signal;
313 };
314
315
316
317 // Inline functions
318 template <int dim, int spacedim>
319 inline const Triangulation<dim, spacedim> &
321 {
322 return *tria;
323 }
324
325
326
327 template <int dim, int spacedim>
328 inline const Mapping<dim, spacedim> &
330 {
331 return *mapping;
332 }
333} // namespace GridTools
334
335
336
338
339#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:317
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
unsigned int level
Definition grid_out.cc:4618
boost::geometry::index::rtree< LeafType, IndexType, IndexableGetter > RTree
Definition rtree.h:144
const ::Triangulation< dim, spacedim > & tria