Reference documentation for deal.II version 9.6.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
persistent_tria.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1999 - 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_persistent_tria_h
16#define dealii_persistent_tria_h
17
18
19#include <deal.II/base/config.h>
20
22
23#include <deal.II/grid/tria.h>
24
25#include <vector>
26
28
106template <int dim, int spacedim = dim>
107class PersistentTriangulation : public Triangulation<dim, spacedim>
108{
109public:
113 static constexpr unsigned int dimension = dim;
114 static const unsigned int spacedimension = spacedim;
115
126
134
138 virtual ~PersistentTriangulation() override = default;
139
146 virtual void
148
161 void
162 restore();
163
172 void
173 restore(const unsigned int step_no);
174
179 unsigned int
180 n_refinement_steps() const;
181
191 virtual void
193
198 virtual void
200 const std::vector<CellData<dim>> &cells,
201 const SubCellData &subcelldata) override;
202
208 virtual void
211 &construction_data) override;
212
216 virtual void
217 write_flags(std::ostream &out) const;
218
224 virtual void
225 read_flags(std::istream &in);
226
230 virtual void
231 clear_flags();
232
237 virtual std::size_t
238 memory_consumption() const override;
239
248
249private:
256
262 std::vector<std::vector<bool>> refine_flags;
263
267 std::vector<std::vector<bool>> coarsen_flags;
268};
269
270
272
273#endif
virtual void read_flags(std::istream &in)
virtual ~PersistentTriangulation() override=default
static constexpr unsigned int dimension
virtual void write_flags(std::ostream &out) const
virtual std::size_t memory_consumption() const override
static const unsigned int spacedimension
virtual void create_triangulation(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata) override
SmartPointer< const Triangulation< dim, spacedim >, PersistentTriangulation< dim, spacedim > > coarse_grid
std::vector< std::vector< bool > > coarsen_flags
virtual void copy_triangulation(const Triangulation< dim, spacedim > &tria) override
unsigned int n_refinement_steps() const
virtual void execute_coarsening_and_refinement() override
std::vector< std::vector< bool > > refine_flags
PersistentTriangulation(const Triangulation< dim, spacedim > &coarse_grid)
Definition point.h:111
std::vector< Point< spacedim > > vertices
Definition tria.h:4467
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
#define DeclException0(Exception0)
Definition exceptions.h:471
static ::ExceptionBase & ExcFlagsNotCleared()
static ::ExceptionBase & ExcTriaNotEmpty()