Reference documentation for deal.II version 9.0.0
persistent_tria.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2017 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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/smartpointer.h>
22 #include <deal.II/grid/tria.h>
23 #include <vector>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
105 template <int dim, int spacedim=dim>
106 class PersistentTriangulation : public Triangulation<dim, spacedim>
107 {
108 public:
112  static const unsigned int dimension = dim;
113  static const unsigned int spacedimension = spacedim;
114 
125 
132 
136  virtual ~PersistentTriangulation () = default;
137 
144  virtual void execute_coarsening_and_refinement ();
145 
158  void restore ();
159 
168  void restore (const unsigned int step_no);
169 
174  unsigned int n_refinement_steps () const;
175 
185  virtual void copy_triangulation (const Triangulation<dim, spacedim> &tria);
186 
191  virtual void create_triangulation (const std::vector<Point<spacedim> > &vertices,
192  const std::vector<CellData<dim> > &cells,
193  const SubCellData &subcelldata);
194 
202  const std::vector<Point<spacedim> > &vertices,
203  const std::vector<CellData<dim> > &cells,
204  const SubCellData &subcelldata);
205 
209  virtual void write_flags(std::ostream &out) const;
210 
216  virtual void read_flags(std::istream &in);
217 
221  virtual void clear_flags();
222 
227  virtual std::size_t memory_consumption () const;
228 
237 
238 private:
243 
249  std::vector<std::vector<bool> > refine_flags;
250 
254  std::vector<std::vector<bool> > coarsen_flags;
255 };
256 
257 
258 DEAL_II_NAMESPACE_CLOSE
259 
260 #endif
virtual void create_triangulation_compatibility(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata)
std::vector< Point< spacedim > > vertices
Definition: tria.h:3587
unsigned int n_refinement_steps() const
virtual void execute_coarsening_and_refinement()
virtual std::size_t memory_consumption() const
static ::ExceptionBase & ExcFlagsNotCleared()
static const unsigned int dimension
std::vector< std::vector< bool > > refine_flags
virtual void create_triangulation(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata)
virtual ~PersistentTriangulation()=default
#define DeclException0(Exception0)
Definition: exceptions.h:323
PersistentTriangulation(const Triangulation< dim, spacedim > &coarse_grid)
SmartPointer< const Triangulation< dim, spacedim >, PersistentTriangulation< dim, spacedim > > coarse_grid
virtual void write_flags(std::ostream &out) const
static ::ExceptionBase & ExcTriaNotEmpty()
virtual void copy_triangulation(const Triangulation< dim, spacedim > &tria)
virtual void read_flags(std::istream &in)
std::vector< std::vector< bool > > coarsen_flags