Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
persistent_tria.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 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 
22 #include <deal.II/base/smartpointer.h>
23 
24 #include <deal.II/grid/tria.h>
25 
26 #include <vector>
27 
28 DEAL_II_NAMESPACE_OPEN
29 
108 template <int dim, int spacedim = dim>
109 class PersistentTriangulation : public Triangulation<dim, spacedim>
110 {
111 public:
115  static const unsigned int dimension = dim;
116  static const unsigned int spacedimension = spacedim;
117 
128 
136 
140  virtual ~PersistentTriangulation() override = default;
141 
148  virtual void
150 
163  void
164  restore();
165 
174  void
175  restore(const unsigned int step_no);
176 
181  unsigned int
182  n_refinement_steps() const;
183 
193  virtual void
194  copy_triangulation(const Triangulation<dim, spacedim> &tria) override;
195 
200  virtual void
201  create_triangulation(const std::vector<Point<spacedim>> &vertices,
202  const std::vector<CellData<dim>> & cells,
203  const SubCellData &subcelldata) override;
204 
211  virtual void
213  const std::vector<Point<spacedim>> &vertices,
214  const std::vector<CellData<dim>> & cells,
215  const SubCellData & subcelldata) override;
216 
220  virtual void
221  write_flags(std::ostream &out) const;
222 
228  virtual void
229  read_flags(std::istream &in);
230 
234  virtual void
235  clear_flags();
236 
241  virtual std::size_t
242  memory_consumption() const override;
243 
252 
253 private:
260 
266  std::vector<std::vector<bool>> refine_flags;
267 
271  std::vector<std::vector<bool>> coarsen_flags;
272 };
273 
274 
275 DEAL_II_NAMESPACE_CLOSE
276 
277 #endif
std::vector< Point< spacedim > > vertices
Definition: tria.h:3963
unsigned int n_refinement_steps() const
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
#define DeclException0(Exception0)
Definition: exceptions.h:473
PersistentTriangulation(const Triangulation< dim, spacedim > &coarse_grid)
virtual void write_flags(std::ostream &out) const
static ::ExceptionBase & ExcTriaNotEmpty()
virtual void read_flags(std::istream &in)
std::vector< std::vector< bool > > coarsen_flags
virtual ~PersistentTriangulation() override=default