Reference documentation for deal.II version 9.4.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\}}\)
persistent_tria.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 1999 - 2022 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_persistent_tria_h
17#define dealii_persistent_tria_h
18
19
20#include <deal.II/base/config.h>
21
23
24#include <deal.II/grid/tria.h>
25
26#include <vector>
27
29
107template <int dim, int spacedim = dim>
108class PersistentTriangulation : public Triangulation<dim, spacedim>
109{
110public:
114 static constexpr unsigned int dimension = dim;
115 static const unsigned int spacedimension = spacedim;
116
127
135
139 virtual ~PersistentTriangulation() override = default;
140
147 virtual void
149
162 void
163 restore();
164
173 void
174 restore(const unsigned int step_no);
175
180 unsigned int
181 n_refinement_steps() const;
182
192 virtual void
194
199 virtual void
201 const std::vector<CellData<dim>> & cells,
202 const SubCellData &subcelldata) override;
203
209 virtual void
212 &construction_data) override;
213
221 virtual void
223 const std::vector<Point<spacedim>> &vertices,
224 const std::vector<CellData<dim>> & cells,
225 const SubCellData & subcelldata) override;
226
230 virtual void
231 write_flags(std::ostream &out) const;
232
238 virtual void
239 read_flags(std::istream &in);
240
244 virtual void
245 clear_flags();
246
251 virtual std::size_t
252 memory_consumption() const override;
253
262
263private:
270
276 std::vector<std::vector<bool>> refine_flags;
277
281 std::vector<std::vector<bool>> coarsen_flags;
282};
283
284
286
287#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 create_triangulation_compatibility(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata) override
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)
std::vector< Point< spacedim > > vertices
Definition: tria.h:4167
#define DEAL_II_DEPRECATED
Definition: config.h:164
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
#define DeclException0(Exception0)
Definition: exceptions.h:464
static ::ExceptionBase & ExcFlagsNotCleared()
static ::ExceptionBase & ExcTriaNotEmpty()
const ::Triangulation< dim, spacedim > & tria