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\}}\)
tria_levels.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 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_tria_levels_h
17 #define dealii_tria_levels_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/point.h>
23 
26 
27 #include <boost/serialization/utility.hpp>
28 
29 #include <cstdint>
30 #include <vector>
31 
33 
34 namespace internal
35 {
36  namespace TriangulationImplementation
37  {
57  template <int dim>
58  class TriaLevel
59  {
60  public:
69  std::vector<std::uint8_t> refine_flags;
70 
75  std::vector<bool> coarsen_flags;
76 
77 
83  std::vector<unsigned int> active_cell_indices;
84 
118  std::vector<std::pair<int, int>> neighbors;
119 
128  std::vector<types::subdomain_id> subdomain_ids;
129 
137  std::vector<types::subdomain_id> level_subdomain_ids;
138 
148  std::vector<int> parents;
149 
157  std::vector<bool> direction_flags;
158 
163 
164 
176  void
177  reserve_space(const unsigned int total_cells,
178  const unsigned int dimension,
179  const unsigned int space_dimension);
180 
186  void
187  monitor_memory(const unsigned int true_dimension) const;
188 
193  std::size_t
194  memory_consumption() const;
195 
200  template <class Archive>
201  void
202  serialize(Archive &ar, const unsigned int version);
203 
208  int,
209  int,
210  << "The containers have sizes " << arg1 << " and " << arg2
211  << ", which is not as expected.");
212  };
213 
214  // TODO: Replace TriaObjectsHex to avoid this specialization
215 
221  template <>
222  class TriaLevel<3>
223  {
224  public:
225  std::vector<std::uint8_t> refine_flags;
226  std::vector<bool> coarsen_flags;
227  std::vector<unsigned int> active_cell_indices;
228  std::vector<std::pair<int, int>> neighbors;
229  std::vector<types::subdomain_id> subdomain_ids;
230  std::vector<types::subdomain_id> level_subdomain_ids;
231  std::vector<int> parents;
232 
233  // The following is not used
234  // since we don't support
235  // codim=1 meshes in 3d; only
236  // needed to allow
237  // compilation
238  // TODO[TH]: this is no longer true and might be a bug.
239  std::vector<bool> direction_flags;
240 
242 
243 
244  void
245  reserve_space(const unsigned int total_cells,
246  const unsigned int dimension,
247  const unsigned int space_dimension);
248  void
249  monitor_memory(const unsigned int true_dimension) const;
250  std::size_t
251  memory_consumption() const;
252 
257  template <class Archive>
258  void
259  serialize(Archive &ar, const unsigned int version);
260 
265  int,
266  int,
267  << "The containers have sizes " << arg1 << " and " << arg2
268  << ", which is not as expected.");
269  };
270 
271 
272 
273  template <int dim>
274  template <class Archive>
275  void
276  TriaLevel<dim>::serialize(Archive &ar, const unsigned int)
277  {
278  ar &refine_flags &coarsen_flags;
279 
280  // do not serialize 'active_cell_indices' here. instead of storing them
281  // to the stream and re-reading them again later, we just rebuild them
282  // in Triangulation::load()
283 
284  ar &neighbors;
285  ar &subdomain_ids;
286  ar &level_subdomain_ids;
287  ar &parents;
288  ar &direction_flags;
289  ar &cells;
290  }
291 
292 
293 
294  template <class Archive>
295  void
296  TriaLevel<3>::serialize(Archive &ar, const unsigned int)
297  {
299 
300  // do not serialize 'active_cell_indices' here. instead of storing them
301  // to the stream and re-reading them again later, we just rebuild them
302  // in Triangulation::load()
303 
304  ar &neighbors;
305  ar &subdomain_ids;
307  ar &parents;
308  ar &direction_flags;
309  ar &cells;
310  }
311 
312  } // namespace TriangulationImplementation
313 } // namespace internal
314 
315 
316 
318 
319 #endif
internal::TriangulationImplementation::TriaLevel::refine_flags
std::vector< std::uint8_t > refine_flags
Definition: tria_levels.h:69
tria_object.h
internal::TriangulationImplementation::TriaLevel::reserve_space
void reserve_space(const unsigned int total_cells, const unsigned int dimension, const unsigned int space_dimension)
Definition: tria_levels.cc:29
internal::TriangulationImplementation::TriaLevel< 3 >::direction_flags
std::vector< bool > direction_flags
Definition: tria_levels.h:239
internal::TriangulationImplementation::TriaLevel< 3 >::refine_flags
std::vector< std::uint8_t > refine_flags
Definition: tria_levels.h:225
internal::TriangulationImplementation::TriaLevel< 3 >::neighbors
std::vector< std::pair< int, int > > neighbors
Definition: tria_levels.h:228
tria_objects.h
internal::TriangulationImplementation::TriaLevel< 3 >::level_subdomain_ids
std::vector< types::subdomain_id > level_subdomain_ids
Definition: tria_levels.h:230
internal::TriangulationImplementation::TriaLevel::coarsen_flags
std::vector< bool > coarsen_flags
Definition: tria_levels.h:75
internal::TriangulationImplementation::TriaObjects
Definition: tria_accessor.h:58
internal::TriangulationImplementation::TriaLevel< 3 >::cells
TriaObjectsHex cells
Definition: tria_levels.h:241
internal::TriangulationImplementation::TriaLevel::neighbors
std::vector< std::pair< int, int > > neighbors
Definition: tria_levels.h:118
internal::TriangulationImplementation::TriaLevel< 3 >::coarsen_flags
std::vector< bool > coarsen_flags
Definition: tria_levels.h:226
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
internal::TriangulationImplementation::TriaLevel< 3 >::parents
std::vector< int > parents
Definition: tria_levels.h:231
internal::TriangulationImplementation::TriaLevel::memory_consumption
std::size_t memory_consumption() const
Definition: tria_levels.cc:103
internal::TriangulationImplementation::TriaLevel::parents
std::vector< int > parents
Definition: tria_levels.h:148
internal::TriangulationImplementation::TriaLevel::monitor_memory
void monitor_memory(const unsigned int true_dimension) const
Definition: tria_levels.cc:91
internal::TriangulationImplementation::TriaLevel::cells
TriaObjects< TriaObject< dim > > cells
Definition: tria_levels.h:162
internal::TriangulationImplementation::TriaLevel::level_subdomain_ids
std::vector< types::subdomain_id > level_subdomain_ids
Definition: tria_levels.h:137
internal::TriangulationImplementation::TriaLevel< 3 >::active_cell_indices
std::vector< unsigned int > active_cell_indices
Definition: tria_levels.h:227
internal::TriangulationImplementation::TriaObjectsHex
Definition: tria_objects.h:424
config.h
internal::TriangulationImplementation::TriaLevel::active_cell_indices
std::vector< unsigned int > active_cell_indices
Definition: tria_levels.h:83
internal::TriangulationImplementation::TriaLevel::direction_flags
std::vector< bool > direction_flags
Definition: tria_levels.h:157
internal::TriangulationImplementation::TriaLevel< 3 >::subdomain_ids
std::vector< types::subdomain_id > subdomain_ids
Definition: tria_levels.h:229
internal
Definition: aligned_vector.h:369
internal::TriangulationImplementation::TriaLevel::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: tria_levels.h:276
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::TriangulationImplementation::TriaLevel::subdomain_ids
std::vector< types::subdomain_id > subdomain_ids
Definition: tria_levels.h:128
DeclException2
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:541
internal::TriangulationImplementation::TriaLevel
Definition: tria_levels.h:58
internal::TriangulationImplementation::TriaLevel::ExcMemoryInexact
static ::ExceptionBase & ExcMemoryInexact(int arg1, int arg2)
point.h