Reference documentation for deal.II version 9.2.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 - 2020 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 
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 
205  /*
206  * @copydoc Triangulation::create_triangulation()
207  *
208  * @note Not inmplemented yet.
209  */
210  virtual void
213  &construction_data) override;
214 
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
PersistentTriangulation::restore
void restore()
Definition: persistent_tria.cc:78
PersistentTriangulation::coarsen_flags
std::vector< std::vector< bool > > coarsen_flags
Definition: persistent_tria.h:281
PersistentTriangulation::~PersistentTriangulation
virtual ~PersistentTriangulation() override=default
PersistentTriangulation::clear_flags
virtual void clear_flags()
Definition: persistent_tria.cc:241
PersistentTriangulation::n_refinement_steps
unsigned int n_refinement_steps() const
Definition: persistent_tria.cc:116
CellData
Definition: tria_description.h:67
Triangulation
Definition: tria.h:1109
tria.h
PersistentTriangulation
Definition: persistent_tria.h:109
PersistentTriangulation::dimension
static const unsigned int dimension
Definition: persistent_tria.h:115
PersistentTriangulation::create_triangulation
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata) override
Definition: persistent_tria.cc:138
PersistentTriangulation::memory_consumption
virtual std::size_t memory_consumption() const override
Definition: persistent_tria.cc:251
PersistentTriangulation::coarse_grid
SmartPointer< const Triangulation< dim, spacedim >, PersistentTriangulation< dim, spacedim > > coarse_grid
Definition: persistent_tria.h:269
PersistentTriangulation::execute_coarsening_and_refinement
virtual void execute_coarsening_and_refinement() override
Definition: persistent_tria.cc:59
PersistentTriangulation::refine_flags
std::vector< std::vector< bool > > refine_flags
Definition: persistent_tria.h:276
PersistentTriangulation::spacedimension
static const unsigned int spacedimension
Definition: persistent_tria.h:116
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
PersistentTriangulation::copy_triangulation
virtual void copy_triangulation(const Triangulation< dim, spacedim > &tria) override
Definition: persistent_tria.cc:125
smartpointer.h
PersistentTriangulation::PersistentTriangulation
PersistentTriangulation(const Triangulation< dim, spacedim > &coarse_grid)
Definition: persistent_tria.cc:34
PersistentTriangulation::ExcTriaNotEmpty
static ::ExceptionBase & ExcTriaNotEmpty()
SmartPointer
Definition: smartpointer.h:68
PersistentTriangulation::create_triangulation_compatibility
virtual void create_triangulation_compatibility(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata) override
Definition: persistent_tria.cc:162
PersistentTriangulation::write_flags
virtual void write_flags(std::ostream &out) const
Definition: persistent_tria.cc:174
DeclException0
#define DeclException0(Exception0)
Definition: exceptions.h:473
Triangulation< dim, dim >::vertices
std::vector< Point< spacedim > > vertices
Definition: tria.h:3848
PersistentTriangulation::ExcFlagsNotCleared
static ::ExceptionBase & ExcFlagsNotCleared()
Point< spacedim >
config.h
TriangulationDescription::Description
Definition: tria_description.h:347
SubCellData
Definition: tria_description.h:199
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
PersistentTriangulation::read_flags
virtual void read_flags(std::istream &in)
Definition: persistent_tria.cc:203