Reference documentation for deal.II version Git 1d2117d9d6 2021-12-01 15:23:49 -0500
\(\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 - 2021 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 
107 template <int dim, int spacedim = dim>
108 class PersistentTriangulation : public Triangulation<dim, spacedim>
109 {
110 public:
114  static const 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
200  create_triangulation(const std::vector<Point<spacedim>> &vertices,
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 
263 private:
270 
276  std::vector<std::vector<bool>> refine_flags;
277 
281  std::vector<std::vector<bool>> coarsen_flags;
282 };
283 
284 
286 
287 #endif
std::vector< Point< spacedim > > vertices
Definition: tria.h:3993
unsigned int n_refinement_steps() const
const ::Triangulation< dim, spacedim > & tria
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata) override
virtual void execute_coarsening_and_refinement() override
static ::ExceptionBase & ExcFlagsNotCleared()
SmartPointer< const Triangulation< dim, spacedim >, PersistentTriangulation< dim, spacedim > > coarse_grid
static const unsigned int dimension
virtual std::size_t memory_consumption() const override
std::vector< std::vector< bool > > refine_flags
virtual void copy_triangulation(const Triangulation< dim, spacedim > &tria) override
virtual void create_triangulation_compatibility(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata) override
static const unsigned int spacedimension
#define DeclException0(Exception0)
Definition: exceptions.h:464
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:404
PersistentTriangulation(const Triangulation< dim, spacedim > &coarse_grid)
virtual void write_flags(std::ostream &out) const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:403
static ::ExceptionBase & ExcTriaNotEmpty()
virtual void read_flags(std::istream &in)
std::vector< std::vector< bool > > coarsen_flags
#define DEAL_II_DEPRECATED
Definition: config.h:160
virtual ~PersistentTriangulation() override=default