deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+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_faces.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2006 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_tria_faces_h
14#define dealii_tria_faces_h
15
16#include <deal.II/base/config.h>
17
20
21
23
24namespace internal
25{
26 namespace TriangulationImplementation
27 {
40 template <int dim>
42 {
43 public:
57 TriaFaces(const unsigned int max_children_per_quad,
58 const unsigned int max_lines_per_quad);
59
63 TriaFaces() = default;
64
68 void
69 allocate(const std::size_t n_lines, const std::size_t n_quads);
70
83 void
84 allocate_end(const std::size_t new_quads_in_pairs,
85 const std::size_t new_quads_single);
86
91 unsigned int lines_per_quad;
92
99
106 get_line_orientation(const int index, const unsigned int line_no) const;
107
114 void
115 set_line_orientation(const int index,
116 const unsigned int line_no,
117 types::geometric_orientation line_orientation);
118
122 ReferenceCell<dim - 1>
123 get_quad_type(const int index) const;
124
128 void
129 set_quad_type(const int index, const ReferenceCell<dim - 1> face_type);
130
137
142 std::size_t
143 memory_consumption() const;
144
150 template <class Archive>
151 void
152 serialize(Archive &ar, const unsigned int version);
153
154 private:
162 std::vector<bool> quad_is_quadrilateral;
163
170 std::vector<bool> quads_line_orientations;
171 };
172
173
174
175 template <int dim>
176 inline ReferenceCell<dim - 1>
178 {
180 AssertIndexRange(index, quad_is_quadrilateral.size());
181 if constexpr (dim == 3)
182 return quad_is_quadrilateral[index] ? ReferenceCells::Quadrilateral :
184 else
185 {
187 return ReferenceCells::Invalid<dim - 1>;
188 }
189 }
190
191
192
193 template <int dim>
194 inline void
196 const ReferenceCell<dim - 1> face_type)
197 {
199 AssertIndexRange(index, quad_is_quadrilateral.size());
201 face_type == ReferenceCells::Triangle,
203 if (face_type == ReferenceCells::Quadrilateral)
204 quad_is_quadrilateral[index] = true;
205 else
206 quad_is_quadrilateral[index] = false;
207 }
208
209
210
211 template <int dim>
214 const unsigned int line_no) const
215 {
217 AssertIndexRange(line_no, lines_per_quad);
218 const std::size_t i = index * lines_per_quad + line_no;
219 AssertIndexRange(i, quads_line_orientations.size());
220 if constexpr (dim == 3)
221 return quads_line_orientations[i] ?
224 else
225 {
228 }
229 }
230
231
232
233 template <int dim>
234 inline void
236 const int index,
237 const unsigned int line_no,
238 const types::geometric_orientation line_orientation)
239 {
241 AssertIndexRange(line_no, lines_per_quad);
242 const std::size_t i = index * lines_per_quad + line_no;
243 AssertIndexRange(i, quads_line_orientations.size());
245 line_orientation == numbers::reverse_line_orientation,
247 if constexpr (dim == 3)
248 quads_line_orientations[i] =
249 line_orientation == numbers::default_geometric_orientation;
250 else
252 }
253
254
255
256 template <int dim>
257 template <class Archive>
258 void
259 TriaFaces<dim>::serialize(Archive &ar, const unsigned int)
260 {
261 ar &lines_per_quad &quads &lines &quads_line_orientations
262 &quad_is_quadrilateral;
263 }
264 } // namespace TriangulationImplementation
265} // namespace internal
266
268
269#endif
void allocate(const std::size_t n_lines, const std::size_t n_quads)
Definition tria_faces.cc:48
void serialize(Archive &ar, const unsigned int version)
Definition tria_faces.h:259
void allocate_end(const std::size_t new_quads_in_pairs, const std::size_t new_quads_single)
Definition tria_faces.cc:66
void set_line_orientation(const int index, const unsigned int line_no, types::geometric_orientation line_orientation)
Definition tria_faces.h:235
types::geometric_orientation get_line_orientation(const int index, const unsigned int line_no) const
Definition tria_faces.h:213
void set_quad_type(const int index, const ReferenceCell< dim - 1 > face_type)
Definition tria_faces.h:195
ReferenceCell< dim - 1 > get_quad_type(const int index) const
Definition tria_faces.h:177
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_ASSERT_UNREACHABLE()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
constexpr ReferenceCell< 2 > Quadrilateral
constexpr ReferenceCell< 2 > Triangle
constexpr ReferenceCell< dim > Invalid
constexpr types::geometric_orientation invalid_geometric_orientation
Definition types.h:369
constexpr types::geometric_orientation reverse_line_orientation
Definition types.h:355
constexpr types::geometric_orientation default_geometric_orientation
Definition types.h:342
std::uint8_t geometric_orientation
Definition types.h:38