Reference documentation for deal.II version GIT 9042b9283b 2023-12-02 14:50: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\}}\)
tria_objects.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2006 - 2020 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 
17 
18 #include <deal.II/grid/tria.h>
22 
23 #include <algorithm>
24 #include <functional>
25 
26 
27 
29 
30 namespace internal
31 {
32  namespace TriangulationImplementation
33  {
34  template <int dim, int spacedim>
35  typename ::Triangulation<dim, spacedim>::raw_hex_iterator
36  TriaObjects::next_free_hex(const ::Triangulation<dim, spacedim> &tria,
37  const unsigned int level)
38  {
39  AssertDimension(this->structdim, 3);
40 
41  // TODO: Think of a way to ensure that we are using the correct
42  // triangulation, i.e. the one containing *this.
43 
44  int pos = next_free_pair, last = used.size() - 1;
45  for (; pos < last; ++pos)
46  if (!used[pos])
47  {
48  // this should be a pair slot
49  Assert(!used[pos + 1], ExcInternalError());
50  break;
51  }
52  if (pos >= last)
53  // no free slot
54  return tria.end_hex();
55  else
56  next_free_pair = pos + 2;
57 
58  return
59  typename ::Triangulation<dim, spacedim>::raw_hex_iterator(&tria,
60  level,
61  pos);
62  }
63 
64 
65  std::size_t
67  {
75  user_data.capacity() * sizeof(UserData) + sizeof(user_data));
76  }
77 
78 
79 
80  // explicit instantiations
81 #ifndef DOXYGEN
82 # include "tria_objects.inst"
83 #endif
84  } // namespace TriangulationImplementation
85 } // namespace internal
86 
hex_iterator end_hex() const
std::vector< types::manifold_id > manifold_id
Definition: tria_objects.h:186
std::vector< BoundaryOrMaterialId > boundary_or_material_id
Definition: tria_objects.h:180
Triangulation< dim, spacedim >::raw_hex_iterator next_free_hex(const Triangulation< dim, spacedim > &tria, const unsigned int level)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
unsigned int level
Definition: grid_out.cc:4617
static ::ExceptionBase & ExcInternalError()
#define Assert(cond, exc)
Definition: exceptions.h:1631
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1820
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
const ::Triangulation< dim, spacedim > & tria