deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+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\}}\)
Loading...
Searching...
No Matches
tria_objects_orientations.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2023 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_tria_objects_orientations_h
16#define dealii_tria_objects_orientations_h
17
18#include <deal.II/base/config.h>
19
23
25
26#include <vector>
27
29
30namespace internal
31{
32 namespace TriangulationImplementation
33 {
41 {
42 public:
47
52 TriaObjectsOrientations(const unsigned int n_objects);
53
57 unsigned int
58 n_objects() const;
59
63 void
64 reinit(const unsigned int n_objects);
65
70 void
71 resize(const unsigned int n_objects);
72
76 std::size_t
77 memory_consumption() const;
78
83 unsigned char
84 get_combined_orientation(const unsigned int object) const;
85
89 bool
90 get_orientation(const unsigned int object) const;
91
95 bool
96 get_rotation(const unsigned int object) const;
97
101 bool
102 get_flip(const unsigned int object) const;
103
108 void
109 set_combined_orientation(const unsigned int object,
110 const unsigned char value);
111
117 template <class Archive>
118 void
119 serialize(Archive &ar, const unsigned int version);
120
121 private:
125 unsigned int n_stored_objects;
126
130 std::vector<unsigned char> flags;
131 };
132
133 //----------------------------------------------------------------------//
134
139
140
141
143 const unsigned int n_objects)
144 {
146 }
147
148
149
150 inline void
151 TriaObjectsOrientations::reinit(const unsigned int n_objects)
152 {
154 // Assign to the default orientation
155 flags.assign(n_objects,
157 }
158
159
160
161 inline void
168
169
170
171 inline std::size_t
177
178
179
180 inline unsigned int
185
186
187
188 inline unsigned char
190 const unsigned int object) const
191 {
193 return flags[object];
194 }
195
196
197
198 inline bool
199 TriaObjectsOrientations::get_orientation(const unsigned int object) const
200 {
202 return Utilities::get_bit(flags[object], 0);
203 }
204
205
206
207 inline bool
208 TriaObjectsOrientations::get_rotation(const unsigned int object) const
209 {
211 return Utilities::get_bit(flags[object], 1);
212 }
213
214
215
216 inline bool
217 TriaObjectsOrientations::get_flip(const unsigned int object) const
218 {
220 return Utilities::get_bit(flags[object], 2);
221 }
222
223
224
225 inline void
227 const unsigned char value)
228 {
230 flags[object] = value;
231 }
232
233
234
235 template <class Archive>
236 void
237 TriaObjectsOrientations::serialize(Archive &ar, const unsigned int)
238 {
240 }
241 } // namespace TriangulationImplementation
242} // namespace internal
243
245
246#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
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define AssertIndexRange(index, range)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
bool get_bit(const unsigned char number, const unsigned int n)
Definition utilities.h:1593