identitygridleveliterator.hh

Go to the documentation of this file.
00001 #ifndef DUNE_IDENTITYGRIDLEVELITERATOR_HH
00002 #define DUNE_IDENTITYGRIDLEVELITERATOR_HH
00003 
00008 namespace Dune {
00009 
00010 
00011 
00012 
00013 //**********************************************************************
00014 //
00015 // --IdentityGridLevelIterator
00019 template<int codim, PartitionIteratorType pitype, class GridImp>
00020 class IdentityGridLevelIterator :
00021     public Dune::IdentityGridEntityPointer <codim,GridImp>
00022 {
00023     private:
00024     
00025         enum {dim = GridImp::dimension};
00026     
00027         
00028     public:
00029         
00031         explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level)
00032             : IdentityGridEntityPointer<codim,GridImp>(identityGrid, identityGrid->hostgrid_->template lbegin<codim>(level)),
00033               hostGridLevelIterator_(identityGrid->hostgrid_->template lbegin<codim>(level)),
00034               hostGridLevelEndIterator_(identityGrid->hostgrid_->template lend<codim>(level))
00035         {
00036             this->virtualEntity_.setToTarget(hostGridLevelIterator_);
00037         }
00038         
00039         
00043         explicit IdentityGridLevelIterator(const GridImp* identityGrid, int level, bool endDummy)
00044             : 
00045             IdentityGridEntityPointer<codim,GridImp>(identityGrid, identityGrid->hostgrid_->template lend<codim>(level)),
00046             hostGridLevelIterator_(identityGrid->hostgrid_->template lend<codim>(level)),
00047             hostGridLevelEndIterator_(identityGrid->hostgrid_->template lend<codim>(level))
00048         {
00049         }
00050         
00051         
00053         void increment() {
00054             ++hostGridLevelIterator_;
00055             this->virtualEntity_.setToTarget(hostGridLevelIterator_);
00056         }
00057         
00058         
00059     private:
00060         
00061         // LevelIterator to the equivalent entity in the host grid
00062         typedef typename GridImp::HostGridType::Traits::template Codim<codim>::LevelIterator HostGridLevelIterator;
00063     
00065         HostGridLevelIterator hostGridLevelIterator_;
00066         
00068         HostGridLevelIterator hostGridLevelEndIterator_;
00069         
00070 };
00071 
00072 
00073 }  // namespace Dune
00074   
00075 #endif

Generated on 29 Jul 2009 with Doxygen (ver 1.5.6)