dune-geometry  2.3.1
virtualrefinement.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
4 #define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
5 
266 #include <vector>
267 
268 #include <dune/common/fvector.hh>
269 
270 #include "refinement.hh"
271 #include "type.hh"
272 
273 namespace Dune
274 {
275  // //////////////////////////////////////////
276  //
277  // The virtual base class and its iterators
278  //
279 
280  //
281  // Refinement
282  //
283 
290  template<int dimension, class CoordType>
292  {
293  public:
294  template<int codimension>
295  struct Codim;
300 
306  typedef FieldVector<CoordType, dimension> CoordVector;
312  typedef std::vector<int> IndexVector;
313 
314  template<int codimension>
318 
320  virtual int nVertices(int level) const = 0;
322  VertexIterator vBegin(int level) const;
324  VertexIterator vEnd(int level) const;
325 
327  virtual int nElements(int level) const = 0;
329  ElementIterator eBegin(int level) const;
331  ElementIterator eEnd(int level) const;
332 
335  {}
336 
337  protected:
338  virtual VertexIteratorBack *vBeginBack(int level) const = 0;
339  virtual VertexIteratorBack *vEndBack(int level) const = 0;
340  virtual ElementIteratorBack *eBeginBack(int level) const = 0;
341  virtual ElementIteratorBack *eEndBack(int level) const = 0;
342  };
343 
345  template<int dimension, class CoordType>
346  template<int codimension>
347  struct VirtualRefinement<dimension, CoordType>::Codim
348  {
349  class SubEntityIterator;
350  };
351 
352  // ////////////////////////
353  //
354  // The refinement builder
355  //
356 
357  template<int dimension, class CoordType>
359  buildRefinement(GeometryType geometryType, GeometryType coerceTo);
360 
361 } // namespace Dune
362 
363 #include "virtualrefinement.cc"
364 
365 #endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH