dune-grid  2.2.0
common/grid.hh
Go to the documentation of this file.
00001 #ifndef DUNE_GRID_HH
00002 #define DUNE_GRID_HH
00003 
00007 // system includes 
00008 #include <iostream>
00009 #include <string>
00010 
00011 // dune-common includes 
00012 #include <dune/common/fvector.hh>
00013 #include <dune/common/typetraits.hh>
00014 
00015 // dune-geometry includes
00016 #include <dune/geometry/type.hh>
00017 
00018 // local includes 
00019 #include <dune/grid/common/gridenums.hh>
00020 #include <dune/grid/common/exceptions.hh>
00021 #include <dune/grid/common/capabilities.hh>
00022 #include <dune/grid/common/datahandleif.hh>
00023 #include <dune/grid/common/gridview.hh>
00024 #include <dune/grid/common/defaultgridview.hh>
00025 
00026 // inlcude this file after all other, because other files might undef the
00027 // macros that are defined in that file 
00028 #include <dune/common/bartonnackmanifcheck.hh>
00029 
00030 namespace Dune {
00031 
00342 // Forward Declarations
00343 // --------------------
00344 
00345 template<int mydim, int cdim, class GridImp,template<int,int,class> class GeometryImp> class Geometry;
00346 template< int mydim, int cdim, class GridImp > class GlobalGeometryReference;
00347 template< int mydim, int cdim, class GridImp > class LocalGeometryReference;
00348 // dim is necessary because Entity will be specialized for codim==0 _and_ codim==dim
00349 // EntityImp gets GridImp as 3rd template parameter to distinguish between const and mutable grid
00350 template<int codim, int dim, class GridImp,template<int,int,class> class EntityImp> class Entity;
00351 template<class GridImp, class EntityPointerImp> class EntityPointer;
00352 template< int codim, class Grid, class IteratorImp > class EntityIterator;
00353 template<class GridImp, template<class> class IntersectionImp> class Intersection;
00354 template<class GridImp, template<class> class IntersectionIteratorImp, template<class> class IntersectionImp> class IntersectionIterator;
00355 template<class GridImp> class GenericLeafIterator;
00356 template<class GridImp, class IndexSetImp, class IndexTypeImp=unsigned int> class IndexSet;
00357 template<class GridImp, class IdSetImp, class IdTypeImp> class IdSet;
00358 
00359 
00360 //************************************************************************
00361 // G R I D
00362 //************************************************************************
00363 
00382 template< int dim, int dimworld, class ct, class GridFamily>  
00383 class Grid {
00384   typedef typename GridFamily::Traits::Grid GridImp;
00385   typedef Grid<dim,dimworld,ct,GridFamily> ThisType;
00386 public:
00387 
00388   //===========================================================
00392   //===========================================================
00393 
00395   enum { 
00397     dimension=dim 
00398   };
00399 
00401   enum { 
00403     dimensionworld=dimworld 
00404   };
00406 
00407   //===========================================================
00411   //===========================================================
00412 
00414   template <PartitionIteratorType pitype>
00415   struct Partition
00416   {
00417     typedef typename GridFamily::Traits::template Partition<pitype>::LevelGridView
00418        LevelGridView;
00419     typedef typename GridFamily::Traits::template Partition<pitype>::LeafGridView
00420        LeafGridView;
00421   };
00423   typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
00424   typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
00425   
00426 
00431   template <int cd>
00432   struct Codim
00433   {
00435     typedef typename GridFamily::Traits::template Codim<cd>::Geometry Geometry;
00436 
00438     typedef typename GridFamily::Traits::template Codim<cd>::LocalGeometry LocalGeometry;
00439 
00441     typedef typename GridFamily::Traits::template Codim<cd>::Entity Entity;
00442 
00444     typedef typename GridFamily::Traits::template Codim<cd>::EntityPointer EntityPointer;
00445 
00447     typedef typename GridFamily::Traits::template Codim<cd>::EntitySeed    EntitySeed;
00448 
00450     template <PartitionIteratorType pitype>
00451     struct Partition
00452     {
00459       typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LevelIterator LevelIterator;
00466       typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LeafIterator LeafIterator;
00467     };
00468   
00471     typedef typename GridFamily::Traits::template Codim<cd>::LevelIterator LevelIterator;
00472 
00475     typedef typename GridFamily::Traits::template Codim<cd>::LeafIterator LeafIterator;
00476   };
00477 
00481   typedef typename GridFamily::Traits::LeafIntersection LeafIntersection;
00482 
00486   typedef typename GridFamily::Traits::LevelIntersection LevelIntersection;
00487 
00493   typedef typename GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator;
00494 
00500   typedef typename GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator;
00501 
00507   typedef typename GridFamily::Traits::HierarchicIterator HierarchicIterator;
00508 
00513   typedef typename GridFamily::Traits::LevelIndexSet LevelIndexSet;
00514 
00519   typedef typename GridFamily::Traits::LeafIndexSet LeafIndexSet;
00520 
00527   typedef typename GridFamily::Traits::GlobalIdSet GlobalIdSet;
00528 
00534   typedef typename GridFamily::Traits::LocalIdSet LocalIdSet;
00535 
00540   typedef typename GridFamily::Traits::CollectiveCommunication CollectiveCommunication;
00541 
00543   typedef ct ctype;
00545 
00546 
00547   //===========================================================
00551   //===========================================================
00552 
00556   int maxLevel() const
00557   {
00558     CHECK_INTERFACE_IMPLEMENTATION(asImp().maxLevel());
00559     return asImp().maxLevel();
00560   }
00561 
00563   int size (int level, int codim) const
00564   {
00565     CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,codim));
00566     return asImp().size(level,codim);
00567   }
00568 
00570   int size (int codim) const
00571   {
00572     CHECK_INTERFACE_IMPLEMENTATION(asImp().size(codim));
00573     return asImp().size(codim);
00574   }
00575 
00577   int size (int level, GeometryType type) const
00578   {
00579     CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,type));
00580     return asImp().size(level,type);
00581   }
00582 
00584   int size (GeometryType type) const
00585   {
00586     CHECK_INTERFACE_IMPLEMENTATION(asImp().size(type));
00587     return asImp().size(type);
00588   }
00590 
00591 
00596   size_t numBoundarySegments () const
00597   {
00598     CHECK_INTERFACE_IMPLEMENTATION( asImp().numBoundarySegments());
00599     return asImp().numBoundarySegments();
00600   }
00601 
00602   //===========================================================
00606   //===========================================================
00607 
00609   template<PartitionIteratorType pitype>
00610   typename Partition<pitype>::LevelGridView levelView(int level) const {
00611     CHECK_INTERFACE_IMPLEMENTATION((asImp().template levelView<pitype>(level)));
00612     return asImp().template levelView<pitype>(level);
00613   }
00614 
00616   template<PartitionIteratorType pitype>
00617   typename Partition<pitype>::LeafGridView leafView() const {
00618     CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafView<pitype>()));
00619     return asImp().template leafView<pitype>();
00620   }
00621 
00623   LevelGridView levelView(int level) const {
00624     CHECK_INTERFACE_IMPLEMENTATION((asImp().levelView(level)));
00625     return asImp().levelView(level);
00626   }
00627 
00629   LeafGridView leafView() const {
00630     CHECK_INTERFACE_IMPLEMENTATION((asImp().leafView()));
00631     return asImp().leafView();
00632   }
00633 
00635 
00636 
00637   //===========================================================
00641   //===========================================================
00642 
00644   template<int cd, PartitionIteratorType pitype>
00645   typename Codim<cd>::template Partition<pitype>::LevelIterator lbegin (int level) const
00646   {
00647     CHECK_INTERFACE_IMPLEMENTATION((asImp().template lbegin<cd,pitype>(level)));
00648     return asImp().template lbegin<cd,pitype>(level);
00649   }
00650 
00652   template<int cd, PartitionIteratorType pitype>
00653   typename Codim<cd>::template Partition<pitype>::LevelIterator lend (int level) const
00654   {
00655     CHECK_INTERFACE_IMPLEMENTATION((asImp().template lend<cd,pitype>(level)));
00656     return asImp().template lend<cd,pitype>(level);
00657   }
00658 
00660   template<int cd>
00661   typename Codim<cd>::template Partition<All_Partition>::LevelIterator lbegin (int level) const
00662   {
00663     CHECK_INTERFACE_IMPLEMENTATION((asImp().template lbegin<cd>(level)));
00664     return asImp().template lbegin<cd>(level);
00665   }
00666 
00668   template<int cd>
00669   typename Codim<cd>::template Partition<All_Partition>::LevelIterator lend (int level) const
00670   {
00671     CHECK_INTERFACE_IMPLEMENTATION((asImp().template lend<cd>(level)));
00672     return asImp().template lend<cd>(level);
00673   }
00674 
00676   template<int cd, PartitionIteratorType pitype>
00677   typename Codim<cd>::template Partition<pitype>::LeafIterator leafbegin () const
00678   {
00679     CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafbegin<cd,pitype>()));
00680     return asImp().template leafbegin<cd,pitype>();
00681   }
00682 
00684   template<int cd, PartitionIteratorType pitype>
00685   typename Codim<cd>::template Partition<pitype>::LeafIterator leafend () const
00686   {
00687     CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafend<cd,pitype>()));
00688     return asImp().template leafend<cd,pitype>();
00689   }
00690 
00692   template<int cd>
00693   typename Codim<cd>::template Partition<All_Partition>::LeafIterator leafbegin () const
00694   {
00695     CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafbegin<cd,All_Partition>()));
00696     return asImp().template leafbegin<cd,All_Partition>();
00697   }
00698 
00700   template<int cd>
00701   typename Codim<cd>::template Partition<All_Partition>::LeafIterator leafend () const
00702   {
00703     CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafend<cd,All_Partition>()));
00704     return asImp().template leafend<cd,All_Partition>();
00705   }
00707 
00708 
00709   //===========================================================
00713   //===========================================================
00714 
00716   const GlobalIdSet &globalIdSet () const
00717   {
00718     CHECK_INTERFACE_IMPLEMENTATION(asImp().globalIdSet());
00719         return asImp().globalIdSet();
00720   }
00721   
00723   const LocalIdSet &localIdSet () const
00724   {
00725     CHECK_INTERFACE_IMPLEMENTATION(asImp().localIdSet());
00726           return asImp().localIdSet();
00727   }
00728 
00730   const LevelIndexSet &levelIndexSet ( int level ) const
00731   {
00732     CHECK_INTERFACE_IMPLEMENTATION(asImp().levelIndexSet(level));
00733           return asImp().levelIndexSet(level);
00734   }
00735 
00737   const LeafIndexSet &leafIndexSet () const
00738   {
00739     CHECK_INTERFACE_IMPLEMENTATION(asImp().leafIndexSet());
00740         return asImp().leafIndexSet();
00741   }
00743 
00744 
00745   //===========================================================
00749   //===========================================================
00750 
00756   void globalRefine (int refCount)
00757   {
00758     CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(asImp().globalRefine(refCount));
00759           return;
00760   }
00761 
00769   bool mark( int refCount, const typename Codim<0>::Entity & e )
00770   {
00771     return asImp().mark(refCount,e);
00772   }
00773 
00780   int getMark(const typename Codim<0>::Entity & e) const
00781   {
00782     return asImp().getMark(e);
00783   }
00784 
00791   bool preAdapt ()
00792   {
00793         return asImp().preAdapt();
00794   }
00795 
00810   bool adapt ()
00811   {
00812           return asImp().adapt();
00813   }
00814   
00819   void postAdapt()
00820   {
00821           return asImp().postAdapt();
00822   }
00824 
00825 
00826   //===========================================================
00830   //===========================================================
00831 
00833   int overlapSize (int level, int codim) const
00834   {
00835     CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(level,codim));
00836     return asImp().overlapSize(level,codim);
00837   }
00838   
00840   int overlapSize (int codim) const
00841   {
00842     CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(codim));
00843     return asImp().overlapSize(codim);
00844   }
00845   
00847   int ghostSize (int level, int codim) const
00848   {
00849     CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(level,codim));
00850     return asImp().ghostSize(level,codim);
00851   }
00852 
00854   int ghostSize (int codim) const
00855   {
00856     CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(codim));
00857     return asImp().ghostSize(codim);
00858   }
00859 
00863   template<class DataHandleImp, class DataTypeImp>
00864   void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir, int level) const
00865   {
00866     CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir,level)));
00867         return;
00868   }
00869 
00873   template<class DataHandleImp, class DataTypeImp>
00874   void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir) const
00875   {
00876     CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir)));
00877         return;
00878   }
00879 
00881   const CollectiveCommunication &comm () const
00882   {
00883     CHECK_INTERFACE_IMPLEMENTATION(asImp().comm());
00884         return asImp().comm();
00885   }
00887 
00891   bool loadBalance() 
00892   {
00893     CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance());
00894     return asImp().loadBalance(); 
00895   }
00896 
00901   template<class DataHandle>
00902   bool loadBalance (DataHandle& data)
00903   {
00904     CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance(data));
00905     return asImp().loadBalance(data); 
00906   }
00907 
00909   template < class EntitySeed >
00910   typename Codim< EntitySeed :: codimension > :: EntityPointer
00911   entityPointer( const EntitySeed& seed ) const 
00912   {
00913     CHECK_INTERFACE_IMPLEMENTATION( asImp().entityPointer( seed ) );
00914     return asImp().entityPointer( seed );
00915   }
00916 protected:
00918   GridImp& asImp () {return static_cast<GridImp &> (*this);}
00920   const GridImp& asImp () const {return static_cast<const GridImp &>(*this);}
00921 };
00922 
00923 #undef CHECK_INTERFACE_IMPLEMENTATION
00924 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
00925 
00926 
00965 template<int dim, 
00966          int dimworld, 
00967          class ct, 
00968          class GridFamily>  
00969 class GridDefaultImplementation : public Grid <dim,dimworld,ct,GridFamily> 
00970 {
00971   typedef typename GridFamily::Traits::Grid GridImp;
00972 
00973 public:
00979   typedef typename GridFamily::Traits Traits;
00980 
00982   template<PartitionIteratorType pitype>
00983   typename Traits::template Partition<pitype>::LevelGridView 
00984   levelView(int level) const {
00985     typedef typename Traits::template Partition<pitype>::LevelGridView View;
00986     typedef typename View::GridViewImp ViewImp;
00987     return View(ViewImp(asImp(),level));
00988   }
00989 
00991   template<PartitionIteratorType pitype>
00992   typename Traits::template Partition<pitype>::LeafGridView leafView() const {
00993     typedef typename Traits::template Partition<pitype>::LeafGridView View;
00994     typedef typename View::GridViewImp ViewImp;
00995     return View(ViewImp(asImp()));
00996   }
00997 
00999   typename Traits::template Partition<All_Partition>::LevelGridView 
01000   levelView(int level) const {
01001     typedef typename Traits::template Partition<All_Partition>::LevelGridView View;
01002     typedef typename View::GridViewImp ViewImp;
01003     return View(ViewImp(asImp(),level));
01004   }
01005 
01007   typename Traits::template Partition<All_Partition>::LeafGridView 
01008   leafView() const {
01009     typedef typename Traits::template Partition<All_Partition>::LeafGridView View;
01010     typedef typename View::GridViewImp ViewImp;
01011     return View(ViewImp(asImp()));
01012   }
01013 
01014   //***************************************************************
01015   //  Interface for Adaptation
01016   //***************************************************************
01017 
01040   bool mark( int refCount, const typename Traits :: template Codim<0>::Entity & e )
01041   {
01042     return false;
01043   }
01044 
01052   int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const
01053   {
01054     return 0; 
01055   }
01056 
01064   bool adapt ()    { return false; }
01065   
01067   bool preAdapt () { return false; }
01068 
01070   void postAdapt() {}
01071 
01073   int ghostSize (int level, int codim) const { return 0; } 
01074   
01076   int overlapSize (int level, int codim) const { return 0; } 
01077 
01079   int ghostSize (int codim) const { return 0; } 
01080   
01082   int overlapSize (int codim) const { return 0; }
01083 
01085   template<class DataHandleImp, class DataTypeImp>
01086   void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, 
01087                     InterfaceType iftype, CommunicationDirection dir, int level) const
01088   {
01089   }
01090 
01092   template<class DataHandleImp, class DataTypeImp>
01093   void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, 
01094                     InterfaceType iftype, CommunicationDirection dir) const
01095   {
01096   }
01097 
01099   bool loadBalance() 
01100   {
01101     return false; 
01102   }
01103 
01105   template<class DataHandle>
01106   bool loadBalance (DataHandle& data)
01107   {
01108     return false; 
01109   }
01110 
01111 protected:
01118   template<class T>
01119   class ReturnImplementationType
01120   : public T // implement friendship via subclassing
01121   {
01122   public:
01124     typedef typename T::Implementation ImplementationType;
01125   private:
01126     // constructor in only need to compile 
01127     ReturnImplementationType(const T& t) : T(t) {}
01128   };
01129   
01130   template<class T> 
01131   class ReturnImplementationType<const T>
01132   : public T // implement friendship via subclassing
01133   {
01134   public:
01135     typedef const typename T::Implementation ImplementationType;
01136   private:  
01137     // constructor in only need to compile 
01138     ReturnImplementationType(const T& t) : T(t) {}
01139   };
01140 
01142   template <class InterfaceType>
01143   static typename ReturnImplementationType<InterfaceType>::ImplementationType & 
01144   getRealImplementation (InterfaceType &i) { return i.impl(); }
01145 
01146 protected:
01147   using Grid< dim, dimworld, ct, GridFamily >::asImp;
01148 };
01149 
01163 template <int dim, int dimw, class GridImp,
01164           template<int,int,class> class GeometryImp,
01165           template<int,int,class> class EntityImp,
01166           template<int,class> class EntityPointerImp,
01167           template<int,PartitionIteratorType,class> class LevelIteratorImp,
01168           template<class> class LeafIntersectionImp,
01169           template<class> class LevelIntersectionImp,
01170           template<class> class LeafIntersectionIteratorImp,
01171           template<class> class LevelIntersectionIteratorImp,
01172           template<class> class HierarchicIteratorImp,
01173           template<int,PartitionIteratorType,class> class LeafIteratorImp,
01174                 class LevelIndexSetImp, class LeafIndexSetImp,
01175                 class GlobalIdSetImp, class GIDType, class LocalIdSetImp, class LIDType, class CCType,
01176                 template<class,PartitionIteratorType> class LevelGridViewTraits = DefaultLevelGridViewTraits,
01177           template<class,PartitionIteratorType> class LeafGridViewTraits = DefaultLeafGridViewTraits,
01178           template<int,class> class EntitySeedImp = EntityPointerImp,
01179           template<int,int,class> class LocalGeometryImp = GeometryImp
01180          >
01181 struct GridTraits
01182 {
01184   typedef GridImp Grid;
01185 
01187   typedef Dune::Intersection<const GridImp, LeafIntersectionImp>  LeafIntersection;
01189   typedef Dune::Intersection<const GridImp, LevelIntersectionImp> LevelIntersection;
01191   typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorImp, LeafIntersectionImp>   LeafIntersectionIterator;
01193   typedef Dune::IntersectionIterator<const GridImp, LevelIntersectionIteratorImp, LevelIntersectionImp> LevelIntersectionIterator;
01194 
01196   typedef Dune::EntityIterator< 0, const GridImp, HierarchicIteratorImp< const GridImp > > HierarchicIterator;
01197 
01202   template <int cd>
01203   struct Codim
01204   {
01205   protected:  
01206     // class to extract whether we are using the default seed type or not 
01207     template <class Seed, class EPImpl >
01208     struct SeedDefault
01209     {
01210       typedef Seed EntitySeed ;     
01211     };
01212 
01213     // the default seed type is entity pointer until its implemented 
01214     template <class EPImpl>
01215     struct SeedDefault< EPImpl, EPImpl >
01216     {
01217       typedef Dune::EntityPointer<const GridImp,EntityPointerImp<cd,const GridImp> > EntitySeed ;
01218     };
01219 
01220   public:
01221     typedef GeometryImp<dim-cd, dimw, const GridImp> GeometryImpl;
01222     typedef LocalGeometryImp<dim-cd, dim, const GridImp> LocalGeometryImpl;
01224 
01225     typedef Dune::Geometry<dim-cd, dimw, const GridImp, GeometryImp> Geometry;
01227     typedef Dune::Geometry<dim-cd, dim, const GridImp, LocalGeometryImp> LocalGeometry;
01229     // we could - if needed - introduce another struct for dimglobal of Geometry
01230     typedef Dune::Entity<cd, dim, const GridImp, EntityImp> Entity;
01231 
01233     typedef Dune::EntityPointer<const GridImp,EntityPointerImp<cd,const GridImp> > EntityPointer;
01234 
01236     typedef typename SeedDefault< EntitySeedImp<cd, const GridImp>, EntityPointerImp<cd,const GridImp> > :: EntitySeed  EntitySeed; 
01237     
01242     template <PartitionIteratorType pitype>
01243     struct Partition
01244     {
01246       typedef Dune::EntityIterator< cd, const GridImp, LevelIteratorImp< cd, pitype, const GridImp > > LevelIterator;
01248       typedef Dune::EntityIterator< cd, const GridImp, LeafIteratorImp< cd, pitype, const GridImp > > LeafIterator;
01249     };
01250 
01252     typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
01253 
01255     typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
01256     
01257   private:
01258     friend class Dune::Entity<cd, dim, const GridImp, EntityImp>;
01259     typedef EntityPointerImp<cd,const GridImp> EntityPointerImpl;
01260   };
01261 
01266   template <PartitionIteratorType pitype>
01267   struct Partition
01268   {
01270     typedef Dune::GridView<LevelGridViewTraits<const GridImp,pitype> > 
01271        LevelGridView;
01272     
01274     typedef Dune::GridView<LeafGridViewTraits<const GridImp,pitype> > 
01275        LeafGridView;
01276   };
01277 
01279   typedef IndexSet<const GridImp,LevelIndexSetImp> LevelIndexSet;
01281   typedef IndexSet<const GridImp,LeafIndexSetImp> LeafIndexSet;
01283   typedef IdSet<const GridImp,GlobalIdSetImp,GIDType> GlobalIdSet;
01285   typedef IdSet<const GridImp,LocalIdSetImp,LIDType> LocalIdSet;
01286 
01288   typedef CCType CollectiveCommunication;
01289 };
01290 
01291   // define of capabilties for the interface class 
01292   namespace Capabilities
01293   {
01294     // capabilities for the interface class depend on the implementation 
01295     template< int dim, int dimworld, typename ct, class GridFamily , int cdim >
01296     struct hasEntity< GridDefaultImplementation<dim,dimworld,ct,GridFamily>, cdim >
01297     {
01298       typedef GridDefaultImplementation<dim,dimworld,ct,GridFamily> GridType;
01299       typedef typename GridType::Traits::Grid GridImp;
01300       static const bool v = hasEntity<GridImp,cdim>::v;
01301     };
01302 
01303   } // end namespace Capabilities
01304 
01310   template <class InterfaceType>
01311   struct MakeableInterfaceObject : public InterfaceType
01312   {
01313     typedef typename InterfaceType::Implementation ImplementationType;
01315     explicit MakeableInterfaceObject ( const ImplementationType &realImp )
01316     : InterfaceType( realImp )
01317     {}
01318   };
01319 }
01320 
01321 #include "geometry.hh"
01322 #include "entity.hh"
01323 #include "entitypointer.hh"
01324 #include "intersection.hh"
01325 #include "intersectioniterator.hh"
01326 #include "entityiterator.hh"
01327 #include "indexidset.hh"
01328 
01329 #endif // #ifndef DUNE_GRID_HH