dune-grid  2.2.1
virtualrefinement.hh
Go to the documentation of this file.
1 #ifndef DUNE_GRID_COMMON_VIRTUALREFINEMENT_HH
2 #define DUNE_GRID_COMMON_VIRTUALREFINEMENT_HH
3 
4 // This file is part of DUNE, a Distributed and Unified Numerics Environment
5 // This file is copyright (C) 2005 Jorrit Fahlke <jorrit@jorrit.de>
6 // This file is licensed under version 2 of the GNU General Public License,
7 // with a special "runtime exception." See COPYING at the top of the source
8 // tree for the full licence.
9 
272 #include <vector>
273 #include <dune/geometry/type.hh>
274 #include <dune/common/fvector.hh>
275 #include "refinement.hh"
276 
277 namespace Dune {
278 
279  // //////////////////////////////////////////
280  //
281  // The virtual base class and its iterators
282  //
283 
284  //
285  // Refinement
286  //
287 
293  template<int dimension, class CoordType>
295  {
296  public:
297  template<int codimension>
298  struct Codim;
303 
308  typedef FieldVector<CoordType, dimension> CoordVector;
313  typedef std::vector<int> IndexVector;
314 
315  template<int codimension>
319 
321  virtual int nVertices(int level) const = 0;
323  VertexIterator vBegin(int level) const;
325  VertexIterator vEnd(int level) const;
326 
328  virtual int nElements(int level) const = 0;
330  ElementIterator eBegin(int level) const;
332  ElementIterator eEnd(int level) const;
333 
336  {}
337 
338  protected:
339  virtual VertexIteratorBack *vBeginBack(int level) const = 0;
340  virtual VertexIteratorBack *vEndBack(int level) const = 0;
341  virtual ElementIteratorBack *eBeginBack(int level) const = 0;
342  virtual ElementIteratorBack *eEndBack(int level) const = 0;
343  };
344 
346  template<int dimension, class CoordType>
347  template<int codimension>
348  struct VirtualRefinement<dimension, CoordType>::Codim
349  {
350  class SubEntityIterator;
351  };
352 
353  // ////////////////////////
354  //
355  // The refinement builder
356  //
357 
358  template<int dimension, class CoordType>
359  VirtualRefinement<dimension, CoordType> &
361  GeometryType coerceTo);
362 
363 } // namespace Dune
364 
365 #include "virtualrefinement.cc"
366 
367 #endif //DUNE_GRID_COMMON_VIRTUALREFINEMENT_HH