deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00: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.cc
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
14#include <deal.II/base/config.h>
15
18
22
23#include <cstddef>
24#include <ostream>
25#include <vector>
26
28
29
30namespace internal
31{
32 namespace TriangulationImplementation
33 {
34 template <int dim>
35 TriaFaces<dim>::TriaFaces(const unsigned int max_children_per_quad,
36 const unsigned int max_lines_per_quad)
37 : lines_per_quad(max_lines_per_quad)
38 , quads(2, max_children_per_quad, lines_per_quad)
39 , lines(1,
40 ReferenceCells::max_n_children<1>(),
41 ReferenceCells::max_n_faces<1>())
42 {}
43
44
45
46 template <int dim>
47 void
48 TriaFaces<dim>::allocate(const std::size_t n_lines,
49 const std::size_t n_quads)
50 {
51 if (dim > 1)
52 {
53 lines.allocate(n_lines);
54 }
55
56 if (dim == 3)
57 {
58 quads.allocate(n_quads);
59 quad_is_quadrilateral.assign(n_quads, true);
60 quads_line_orientations.assign(n_quads * lines_per_quad, true);
61 }
62 }
63
64 template <int dim>
65 void
66 TriaFaces<dim>::allocate_end(const std::size_t new_quads_in_pairs,
67 const std::size_t new_quads_single)
68 {
69 if (dim < 3)
70 return;
71
72 const auto old_n_objects = quads.n_objects();
73 quads.allocate_end(new_quads_in_pairs, new_quads_single);
74
75 if (quads.n_objects() > old_n_objects)
76 {
77 // reserve the field of the derived class
78 quads_line_orientations.resize(quads.n_objects() *
79 quads.faces_per_object,
80 true);
81
82 quad_is_quadrilateral.insert(quad_is_quadrilateral.end(),
83 quads.n_objects() -
84 quad_is_quadrilateral.size(),
85 true);
86 }
87 }
88
89
90
91 template <int dim>
92 std::size_t
94 {
95 if (dim == 2)
97 if (dim == 3)
99 MemoryConsumption::memory_consumption(quads_line_orientations) +
100 MemoryConsumption::memory_consumption(quad_is_quadrilateral) +
102
103 return 0;
104 }
105
106
107 template class TriaFaces<1>;
108 template class TriaFaces<2>;
109 template class TriaFaces<3>;
110 } // namespace TriangulationImplementation
111} // namespace internal
112
void allocate(const std::size_t n_lines, const std::size_t n_quads)
Definition tria_faces.cc:48
void allocate_end(const std::size_t new_quads_in_pairs, const std::size_t new_quads_single)
Definition tria_faces.cc:66
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)