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_object.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 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 
16 #ifndef dealii_tria_object_h
17 #define dealii_tria_object_h
18 
19 
20 #include <deal.II/base/config.h>
21 
24 
26 
27 namespace internal
28 {
29  namespace TriangulationImplementation
30  {
40  template <int structdim>
41  class TriaObject
42  {
43  public:
44  static const unsigned int dimension = structdim;
45 
49  TriaObject();
50 
56  TriaObject(const int i0, const int i1);
57 
64  TriaObject(const int i0, const int i1, const int i2, const int i3);
65 
72  TriaObject(const int i0,
73  const int i1,
74  const int i2,
75  const int i3,
76  const int i4,
77  const int i5);
78 
79 
83  int
84  face(const unsigned int i) const;
85 
89  void
90  set_face(const unsigned int i, const int index);
91 
96  static std::size_t
98 
103  template <class Archive>
104  void
105  serialize(Archive &ar, const unsigned int version);
106 
107  protected:
113  };
114 
115  //----------------------------------------------------------------------//
116 
117  template <int structdim>
119  {
120  for (const unsigned int i : GeometryInfo<structdim>::face_indices())
121  faces[i] = -1;
122  }
123 
124 
125  template <int structdim>
126  inline TriaObject<structdim>::TriaObject(const int i0, const int i1)
127  {
128  Assert(structdim == 1, ExcImpossibleInDim(structdim));
129  faces[0] = i0;
130  faces[1] = i1;
131  }
132 
133 
134  template <int structdim>
136  const int i1,
137  const int i2,
138  const int i3)
139  {
140  Assert(structdim == 2, ExcImpossibleInDim(structdim));
141  faces[0] = i0;
142  faces[1] = i1;
143  faces[2] = i2;
144  faces[3] = i3;
145  }
146 
147 
148  template <int structdim>
150  const int i1,
151  const int i2,
152  const int i3,
153  const int i4,
154  const int i5)
155  {
156  Assert(structdim == 3, ExcImpossibleInDim(structdim));
157  faces[0] = i0;
158  faces[1] = i1;
159  faces[2] = i2;
160  faces[3] = i3;
161  faces[4] = i4;
162  faces[5] = i5;
163  }
164 
165 
166  template <int structdim>
167  inline int
168  TriaObject<structdim>::face(const unsigned int i) const
169  {
171  return faces[i];
172  }
173 
174 
175 
176  template <int structdim>
177  inline void
178  TriaObject<structdim>::set_face(const unsigned int i, const int index)
179  {
181  faces[i] = index;
182  }
183 
184 
185 
186  template <int structdim>
187  inline std::size_t
189  {
190  return sizeof(TriaObject<structdim>);
191  }
192 
193 
194  template <int structdim>
195  template <class Archive>
196  void
197  TriaObject<structdim>::serialize(Archive &ar, const unsigned int)
198  {
199  ar &faces;
200  }
201 
202 
203  } // namespace TriangulationImplementation
204 } // namespace internal
205 
206 
208 
209 #endif
internal::TriangulationImplementation::TriaObject::face
int face(const unsigned int i) const
Definition: tria_object.h:168
GeometryInfo
Definition: geometry_info.h:1224
AssertIndexRange
#define AssertIndexRange(index, range)
Definition: exceptions.h:1649
internal::TriangulationImplementation::TriaObject::dimension
static const unsigned int dimension
Definition: tria_object.h:44
internal::TriangulationImplementation::TriaObject::TriaObject
TriaObject()
Definition: tria_object.h:118
geometry_info.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
exceptions.h
internal::TriangulationImplementation::TriaObject::memory_consumption
static std::size_t memory_consumption()
Definition: tria_object.h:188
Assert
#define Assert(cond, exc)
Definition: exceptions.h:1419
internal::TriangulationImplementation::TriaObject
Definition: tria_accessor.h:56
StandardExceptions::ExcImpossibleInDim
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
internal::TriangulationImplementation::TriaObject::faces
int faces[GeometryInfo< structdim >::faces_per_cell]
Definition: tria_object.h:112
config.h
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::TriangulationImplementation::TriaObject::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: tria_object.h:197
internal::TriangulationImplementation::TriaObject::set_face
void set_face(const unsigned int i, const int index)
Definition: tria_object.h:178