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
tria_objects_orientations.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2022 - 2023 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_objects_orientations_h
17#define dealii_tria_objects_orientations_h
18
19#include <deal.II/base/config.h>
20
24
26
27#include <vector>
28
30
31namespace internal
32{
33 namespace TriangulationImplementation
34 {
69 {
70 public:
75
80 TriaObjectsOrientations(const unsigned int n_objects);
81
85 unsigned int
86 n_objects() const;
87
91 void
92 reinit(const unsigned int n_objects);
93
98 void
99 resize(const unsigned int n_objects);
100
104 std::size_t
105 memory_consumption() const;
106
111 unsigned char
112 get_combined_orientation(const unsigned int object) const;
113
117 bool
118 get_orientation(const unsigned int object) const;
119
123 bool
124 get_rotation(const unsigned int object) const;
125
129 bool
130 get_flip(const unsigned int object) const;
131
136 void
137 set_combined_orientation(const unsigned int object,
138 const unsigned char value);
139
143 void
144 set_orientation(const unsigned int object, const bool value);
145
149 void
150 set_rotation(const unsigned int object, const bool value);
151
155 void
156 set_flip(const unsigned int object, const bool value);
157
163 template <class Archive>
164 void
165 serialize(Archive &ar, const unsigned int version);
166
167 private:
171 unsigned int n_stored_objects;
172
176 std::vector<unsigned char> flags;
177 };
178
179 //----------------------------------------------------------------------//
180
182 {
183 reinit(0);
184 }
185
186
187
189 const unsigned int n_objects)
190 {
192 }
193
194
195
196 inline void
197 TriaObjectsOrientations::reinit(const unsigned int n_objects)
198 {
200 // Assign to the default orientation
201 flags.assign(n_objects,
203 }
204
205
206
207 inline void
208 TriaObjectsOrientations::resize(const unsigned int n_objects)
209 {
210 flags.resize(n_objects,
213 }
214
215
216
217 inline std::size_t
219 {
222 }
223
224
225
226 inline unsigned int
228 {
229 return n_stored_objects;
230 }
231
232
233
234 inline unsigned char
236 const unsigned int object) const
237 {
239 return flags[object];
240 }
241
242
243
244 inline bool
245 TriaObjectsOrientations::get_orientation(const unsigned int object) const
246 {
248 return Utilities::get_bit(flags[object], 0);
249 }
250
251
252
253 inline bool
254 TriaObjectsOrientations::get_rotation(const unsigned int object) const
255 {
257 return Utilities::get_bit(flags[object], 1);
258 }
259
260
261
262 inline bool
263 TriaObjectsOrientations::get_flip(const unsigned int object) const
264 {
266 return Utilities::get_bit(flags[object], 2);
267 }
268
269
270
271 inline void
273 const unsigned char value)
274 {
276 flags[object] = value;
277 }
278
279
280
281 inline void
283 const bool value)
284 {
286 Utilities::set_bit(flags[object], 0, value);
287 }
288
289
290
291 inline void
292 TriaObjectsOrientations::set_rotation(const unsigned int object,
293 const bool value)
294 {
296 Utilities::set_bit(flags[object], 1, value);
297 }
298
299
300
301 inline void
302 TriaObjectsOrientations::set_flip(const unsigned int object,
303 const bool value)
304 {
306 Utilities::set_bit(flags[object], 2, value);
307 }
308
309
310
311 template <class Archive>
312 void
313 TriaObjectsOrientations::serialize(Archive &ar, const unsigned int)
314 {
316 }
317 } // namespace TriangulationImplementation
318} // namespace internal
319
321
322#endif
static constexpr unsigned char default_combined_face_orientation()
void set_combined_orientation(const unsigned int object, const unsigned char value)
unsigned char get_combined_orientation(const unsigned int object) const
void set_orientation(const unsigned int object, const bool value)
void set_rotation(const unsigned int object, const bool value)
void set_flip(const unsigned int object, const bool value)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#define AssertIndexRange(index, range)
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
bool get_bit(const unsigned char number, const unsigned int n)
Definition utilities.h:1566
void set_bit(unsigned char &number, const unsigned int n, const bool x)
Definition utilities.h:1579