alugrid/2d/grid.hh

Go to the documentation of this file.
00001 #ifndef DUNE_ALU2DGRIDGRID_HH
00002 #define DUNE_ALU2DGRIDGRID_HH
00003 
00004 //- System includes
00005 #include "alu2dinclude.hh"
00006 #include <iostream>
00007 #include <vector>
00008 
00009 //- Dune includes
00010 #include <dune/grid/utility/grapedataioformattypes.hh>
00011 #include <dune/grid/common/capabilities.hh>
00012 #include <dune/grid/alugrid/common/interfaces.hh>
00013 #include <dune/common/deprecated.hh>
00014 #include <dune/common/static_assert.hh>
00015 
00016 #include <dune/grid/common/grid.hh>
00017 #include <dune/grid/alugrid/common/defaultindexsets.hh>
00018 #include <dune/grid/common/sizecache.hh>
00019 #include <dune/grid/common/defaultgridview.hh>
00020 #include <dune/common/mpihelper.hh>
00021 
00022 #include <dune/grid/alugrid/common/intersectioniteratorwrapper.hh>
00023 
00024 // bnd projection stuff 
00025 #include <dune/grid/common/boundaryprojection.hh>
00026 #include <dune/grid/alugrid/2d/bndprojection.hh>
00027 
00028 //- Local includes
00029 #include "indexsets.hh"
00030 #include <dune/grid/alugrid/common/objectfactory.hh>
00031 #include "datahandle.hh"
00032 
00033 namespace Dune {
00034 
00035   // Forward declarations
00036   template<int cd, int dim, class GridImp> 
00037   class ALU2dGridEntity;  
00038   template<int cd, PartitionIteratorType pitype, class GridImp > 
00039   class ALU2dGridLevelIterator;
00040   template<int cd, class GridImp >
00041   class ALU2dGridEntityPointer;  
00042   template<int mydim, int coorddim, class GridImp>  
00043   class ALU2dGridMakeableGeometry;
00044   template<int mydim, int cdim, class GridImp>  
00045   class ALU2dGridGeometry;
00046   template<class GridImp>
00047   class ALU2dGridHierarchicIterator;    
00048   template<class GridImp>
00049   class ALU2dGridIntersectionBase;
00050   template<class GridImp>
00051   class ALU2dGridLevelIntersectionIterator;
00052   template<class GridImp>
00053   class ALU2dGridLeafIntersectionIterator;  
00054   template<int codim, PartitionIteratorType pitype, class GridImp>  
00055   class ALU2dGridLeafIterator;
00056   template <int mydim, int coorddim, class GridImp>
00057   class ALU2dGridMakeableEntity;
00058   template <class GridImp>
00059   class ALU2dGridFaceGeometryInfo;
00060   template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
00061   class ALU2dGridLocalIdSet;
00062   template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
00063   class ALU2dGridHierarchicIndexSet;
00064   template <class EntityImp>
00065   class ALUMemoryProvider;
00066   template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
00067   class ALU2dGrid;
00068   template <class GridImp, class GeometryImp, int nChild>
00069   class ALULocalGeometryStorage;
00070   
00071   class ALU2dObjectStream;
00072   
00073   //**********************************************************************
00074   //
00075   // --ALU2dGrid
00076   // --Grid
00077   //
00078   //**********************************************************************
00079   template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
00080   struct ALU2dGridFamily   
00081   {
00082     typedef ALU2dGrid< dim, dimworld, eltype > GridImp;
00083 
00085     typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> GlobalIdSetImp;
00086 
00088     typedef ALU2dGridLocalIdSet<dim,dimworld,eltype> LocalIdSetImp;
00089            
00091     typedef DefaultLevelIndexSet< GridImp > LevelIndexSetImp;
00093     typedef DefaultLeafIndexSet< GridImp > LeafIndexSetImp;
00094 
00095     typedef int GlobalIdType;
00096     typedef int LocalIdType;
00097 
00098     struct Traits
00099     {
00100       typedef GridImp Grid;
00101 
00102       typedef Dune :: Intersection< const GridImp, LeafIntersectionWrapper > LeafIntersection;
00103       typedef Dune :: Intersection< const GridImp, LevelIntersectionWrapper > LevelIntersection;
00104 
00105       typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper, LeafIntersectionWrapper > IntersectionIterator;      
00106       typedef Dune::IntersectionIterator<const GridImp, LeafIntersectionIteratorWrapper, LeafIntersectionWrapper > LeafIntersectionIterator;      
00107       typedef Dune::IntersectionIterator<const GridImp, LevelIntersectionIteratorWrapper, LevelIntersectionWrapper > LevelIntersectionIterator;      
00108       
00109       typedef Dune::EntityIterator< 0, const GridImp, ALU2dGridHierarchicIterator< const GridImp > > HierarchicIterator;
00110 
00111       typedef DuneBoundaryProjection< dimworld > DuneBoundaryProjectionType;
00112       typedef std::vector< const DuneBoundaryProjectionType *> DuneBoundaryProjectionVector;
00113 
00114       template <int cd>
00115       struct Codim
00116       {
00117         // IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
00118         typedef Dune::Geometry<dim-cd, dimworld, const GridImp, ALU2dGridGeometry> Geometry;
00119         typedef Dune::Geometry<dim-cd, dim, const GridImp, ALU2dGridGeometry> LocalGeometry;
00120         // we could - if needed - introduce an other struct for dimglobal of Geometry
00121         typedef Dune::Entity<cd, dim, const GridImp, ALU2dGridEntity> Entity;
00122 
00123         typedef ALU2dGridEntityPointer< cd, const GridImp > EntityPointerImpl;
00124         typedef Dune::EntityPointer< const GridImp, EntityPointerImpl > EntityPointer;
00125         typedef EntityPointer EntitySeed;
00126 
00127         template <PartitionIteratorType pitype>
00128         struct Partition
00129         {
00130           typedef Dune::EntityIterator< cd, const GridImp, ALU2dGridLevelIterator< cd, pitype, const GridImp > > LevelIterator;
00131           typedef Dune::EntityIterator< cd, const GridImp, ALU2dGridLeafIterator< cd, pitype, const GridImp > > LeafIterator;
00132         };
00133 
00134         typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
00135         typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
00136 
00137       };
00138 
00139       template <PartitionIteratorType pitype>
00140       struct Partition
00141       {
00142         typedef Dune::GridView<DefaultLevelGridViewTraits<const GridImp,pitype> > 
00143         LevelGridView;
00144         typedef Dune::GridView<DefaultLeafGridViewTraits<const GridImp,pitype> > 
00145         LeafGridView;
00146       };
00147 
00148       typedef IndexSet<GridImp,LevelIndexSetImp> LevelIndexSet;
00149       typedef LeafIndexSetImp LeafIndexSet;
00150       typedef IdSet<GridImp,GlobalIdSetImp,GlobalIdType> GlobalIdSet;
00151       typedef IdSet<GridImp,LocalIdSetImp,LocalIdType> LocalIdSet;
00152 
00153 #if ALU2DGRID_PARALLEL
00154       typedef Dune :: CollectiveCommunication< MPI_Comm >
00155         CollectiveCommunication;
00156 #else 
00157       typedef Dune :: CollectiveCommunication< GridImp >
00158         CollectiveCommunication;
00159 #endif
00160     };
00161   }; // end of ALU2dGridFamily
00162 
00163 
00178   template< int dim, int dimworld, ALU2DSPACE ElementType eltype >
00179   class ALU2dGrid
00180   : public GridDefaultImplementation< dim, dimworld, alu2d_ctype, ALU2dGridFamily< dim, dimworld, eltype > >,
00181     public HasObjectStream, 
00182     public HasHierarchicIndexSet 
00183   {
00184     typedef ALU2dGrid< dim, dimworld, eltype > ThisType; 
00185     typedef GridDefaultImplementation< dim, dimworld, alu2d_ctype, ALU2dGridFamily< dim, dimworld, eltype > > BaseType;
00186 
00187     dune_static_assert( dim == 2, "ALU2dGrid only implemented for grid dim 2." );
00188 #ifdef ALUGRID_SURFACE_2D
00189     dune_static_assert( dimworld == 2 || dimworld == 3, "ALU2dGrid only implemented for world dim 2 or 3." );
00190 #else
00191     dune_static_assert( dimworld == 2, "ALU2dGrid only implemented for world dim 2." );
00192     dune_static_assert( eltype == ALU2DSPACE triangle, "ALU2dGrid only implemented for triangles." );
00193 #endif
00194 
00195   public:
00196     static const ALU2DSPACE ElementType elementType = eltype;
00197 
00198     typedef typename ALU2dGridFamily< dim, dimworld, elementType >::Traits Traits;
00199 
00200     // new intersection iterator is a wrapper which get itersectioniteratoimp as pointers
00201     typedef ALU2dGridLeafIntersectionIterator <const ThisType>  LeafIntersectionIteratorImp;
00202     typedef ALU2dGridLevelIntersectionIterator<const ThisType>  LevelIntersectionIteratorImp;
00203 
00204     typedef ALUGridObjectFactory< ThisType >  GridObjectFactoryType;
00205 
00206   private:
00207 
00208     typedef typename ALU2dImplTraits<dimworld, elementType >::HmeshType HmeshType ;
00209     typedef typename ALU2dImplTraits<dimworld, elementType >::HElementType HElementType ;
00210     typedef typename ALU2dImplTraits<dimworld, elementType >::ElementType ElementType ;
00211     
00212     template< class > friend class DGFBaseFactory;
00213 
00214     template< int, int, class > friend class ALU2dGridEntity;
00215    
00216     friend class ALU2dGridGeometry<0,dimworld,const ThisType>;
00217     friend class ALU2dGridGeometry<1,dimworld,const ThisType>;
00218     friend class ALU2dGridGeometry<dim,dimworld,const ThisType>;
00219     template< class, class, int > friend class ALULocalGeometryStorage;
00220  
00221     friend class ALU2dGridEntityPointer<0,const ThisType>;
00222     friend class ALU2dGridEntityPointer<1,const ThisType>;
00223     friend class ALU2dGridEntityPointer<dim,const ThisType>;
00224     
00225     friend class ALU2dGridHierarchicIndexSet<dim,dimworld,elementType>;
00226 
00227     friend class ALU2dGridIntersectionBase < const ThisType > ;
00228     friend class ALU2dGridLevelIntersectionIterator< const ThisType > ;
00229     friend class ALU2dGridLeafIntersectionIterator< const ThisType > ;
00230 
00231     //**********************************************************
00232     // The Interface Methods
00233     //**********************************************************
00234   protected:
00235     typedef MakeableInterfaceObject<typename Traits::template
00236             Codim<0>::Geometry> GeometryObject;
00237     friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 4 >;
00238     friend class ALULocalGeometryStorage<const ThisType, GeometryObject, 2 >;
00239     
00240   public:  
00241    
00243     typedef ALU2dGridObjectStream ObjectStreamType;
00244 
00246     typedef ALU2dGridFamily < dim, dimworld, eltype > GridFamily;
00247 
00249     typedef ALU2dGridHierarchicIndexSet<dim,dimworld,elementType> HierarchicIndexSet;
00250     
00252     typedef ALU2dGridLocalIdSet<dim,dimworld,elementType> LocalIdSetImp;
00253     typedef LocalIdSetImp GlobalIdSetImp;
00254 
00256     typedef typename Traits :: GlobalIdSet GlobalIdSet;
00257     
00259     typedef typename Traits :: LocalIdSet LocalIdSet;
00260    
00261 
00263     typedef typename GridFamily :: LevelIndexSetImp  LevelIndexSetImp;
00265     typedef typename GridFamily :: LeafIndexSetImp  LeafIndexSetImp;
00266     
00268     typedef ALU2dGridLeafIterator<0, All_Partition, const ThisType> LeafIteratorImp;
00269     typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
00270     typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
00271     
00273     typedef ALU2dGridLevelIterator<0, All_Partition, const ThisType> LevelIteratorImp;
00274     typedef typename Traits::template Codim<0>::LevelIterator LevelIteratorType;
00275     typedef typename Traits::template Codim<0>::LevelIterator LevelIterator;       
00276     
00277     typedef ALU2dGridHierarchicIterator<ThisType> HierarchicIteratorImp;
00278 
00279     typedef typename Traits::CollectiveCommunication CollectiveCommunicationType;
00280 
00281 
00283     enum { 
00285       MAXL = 64 };
00286 
00288     enum {
00290       newElementsChunk_ = 100 };
00291 
00293     enum {
00297       refineEstimate_ = 40 };
00298         
00300     typedef typename Traits :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
00302     typedef typename Traits :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
00303 
00304 #ifdef ALUGRID_VERTEX_PROJECTION
00305 
00306     typedef ALUGridSpace :: VertexProjection< dimworld > ALUGridVertexProjectionType;
00307 #endif
00308 
00309 
00310   protected:
00311 
00312     friend class ALUGridBoundaryProjection< ThisType >;
00313     friend class ALU2dGridBoundaryProjection< ThisType >;
00314     // type of ALUGrid boundary projection wrapper 
00315     typedef ALU2dGridBoundaryProjection< ThisType > ALUGridBoundaryProjectionType;
00316 
00319     //- --constructor
00320     ALU2dGrid(const std::string macroTriangFilename, 
00321               const int nrOfHangingNodes,
00322               const DuneBoundaryProjectionType*, 
00323               const DuneBoundaryProjectionVector*,
00324               std::istream* macroFile = 0); 
00325 
00326     // method creating mesh object  
00327     HmeshType* createGrid(const std::string&,
00328                           const int, 
00329                           std::istream* );
00330 
00332     ALU2dGrid( int );
00333     
00334   public: 
00336     ~ALU2dGrid();
00337 
00340     int maxLevel() const;
00341            
00344     template<int cd, PartitionIteratorType pitype>
00345     typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
00346     lbegin (int level) const; 
00347   
00349     template<int cd, PartitionIteratorType pitype>
00350     typename Traits::template Codim<cd>::template Partition<pitype>::LevelIterator
00351     lend (int level) const;
00352       
00354     template<int cd>
00355     typename Traits::template Codim<cd>::
00356     template Partition<All_Partition>::LevelIterator 
00357     lbegin (int level) const;
00358 
00360     template<int cd>
00361     typename Traits::template Codim<cd>::
00362     template Partition<All_Partition>::LevelIterator 
00363     lend (int level) const;
00364     
00366     LevelIteratorType lbegin (int level) const;
00367 
00369     LevelIteratorType lend (int level) const;
00370         
00372     template <int codim, PartitionIteratorType pitype>
00373     typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
00374     leafbegin() const;
00375 
00377     template <int codim, PartitionIteratorType pitype>
00378     typename Traits::template Codim<codim>::template Partition<pitype>::LeafIterator
00379     leafend() const;
00380 
00382     template <int codim>
00383     typename Traits::template Codim<codim>::LeafIterator
00384     leafbegin() const;
00385 
00387     template <int codim>
00388     typename Traits::template Codim<codim>::LeafIterator
00389     leafend() const;
00390   
00391   private:  
00393     LeafIteratorType leafbegin () const;
00394 
00396     LeafIteratorType leafend () const;    
00397   
00398   public:  
00400     int size (int level, int cd) const;
00401     
00403     int size (int codim) const;
00404     
00406     int size (int level, GeometryType type) const;
00407 
00409     int size (GeometryType type) const;
00410 
00412     const std::vector<GeometryType>& geomTypes (int codim) const { return geomTypes_[codim]; }
00413     
00414     //****************************************************************
00415     // index and id sets 
00416     //****************************************************************
00417 
00419     const GlobalIdSet & globalIdSet () const; 
00420 
00422     const LocalIdSet & localIdSet () const;
00423     
00425     int hierSetSize (int cd) const;
00426     
00428     const HierarchicIndexSet & hierarchicIndexSet () const ;
00429     
00431     const typename Traits :: LeafIndexSet & leafIndexSet () const;
00432     
00434     const typename Traits :: LevelIndexSet & levelIndexSet (int level) const;   
00435     
00436     
00437     //**********************************************************
00438     // End of Interface Methods
00439     //**********************************************************
00440     
00441     // return reference to org ALU2dGrid 
00442     // private method, but otherwise we have to friend class all possible
00443     // types of LevelIterator ==> later
00444     HmeshType & myGrid();
00445     HmeshType & myGrid() const;
00446 
00448     void globalRefine ( int refCount );
00449 
00450     template< class GridImp, class DataHandle >
00451     void globalRefine ( int refCount, AdaptDataHandleInterface< GridImp, DataHandle > &hamdle );
00452     
00454     bool preAdapt ( );
00455     
00457     void postAdapt ( );
00458     
00462     bool adapt ();
00463 
00464     template< class GridImp, class DataHandle >
00465     bool adapt ( AdaptDataHandleInterface< GridImp, DataHandle > &handle );
00466     
00467     // refine grid
00468     bool refineGrid();
00469    
00471     int getMark(const typename Traits::template Codim<0>::Entity & e) const;
00472 
00474     bool mark( int refCount , const typename Traits::template Codim<0>::Entity & e);                  
00475     
00477     const CollectiveCommunicationType & comm() const;
00478   private:
00479     CollectiveCommunicationType comm_;
00480     
00481     void updateStatus();
00482     
00483     void calcMaxlevel();
00484     
00485     void calcExtras();
00486    
00487     // clear refinement marker of element and all children 
00488     void hierarchicClear( HElementType *el );
00489   public:
00490     typedef MakeableInterfaceObject<typename Traits::template Codim<0>::Entity> EntityObject;
00491     typedef MakeableInterfaceObject<typename Traits::template Codim<1>::Entity> FaceObject;
00492     typedef MakeableInterfaceObject<typename Traits::template Codim<2>::Entity> VertexObject;
00493     
00494     // create GeomTypes
00495     void makeGeomTypes ();
00496     
00497     friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
00498     friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasObjectStream>;
00499 
00500     friend class Conversion<ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
00501     friend class Conversion<const ALU2dGrid<dim, dimworld,eltype>, HasHierarchicIndexSet>;
00502 
00504     ALU2dGrid( const ThisType & g );
00505   
00507     ThisType & operator = (const ThisType & g); 
00508 
00509     // check macro file and return const char * to filename 
00510     const char * checkMacroGridFile(const std::string & filename);
00511   
00513     mutable HmeshType* mygrid_;
00514 
00515     // return reference to grid 
00516     HmeshType& mesh() const {
00517       assert(mygrid_);
00518       return *mygrid_;
00519     }
00520 
00521 #ifdef USE_SMP_PARALLEL
00522     std::vector< GridObjectFactoryType > factoryVec_;
00523 #else
00524     GridObjectFactoryType factory_;
00525 #endif
00526 
00528     HierarchicIndexSet hIndexSet_;
00529 
00531     LocalIdSetImp localIdSet_;
00532  
00534     mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
00535         
00536     // at the moment the number of different geom types is 1
00537     enum { numberOfGeomTypes = 1 };
00538     std::vector< std::vector<GeometryType> > geomTypes_;
00539     
00541     mutable LeafIndexSetImp * leafIndexSet_;
00542 
00543     int maxLevel_;
00544     int refineMarked_ , coarsenMarked_;
00545     const int nrOfHangingNodes_;
00546     
00548     typedef SingleTypeSizeCache<ThisType> SizeCacheType;
00549     SizeCacheType * sizeCache_;
00550 
00551     // flag to make sure postAdapt is called after adapt 
00552     bool lockPostAdapt_;
00553 
00554     // pointer to Dune boundary projection 
00555     const DuneBoundaryProjectionType* bndPrj_;
00556 
00557     // pointer to Dune boundary projection 
00558     const DuneBoundaryProjectionVector* bndVec_;
00559  
00560     // boundary projection for vertices  
00561     ALUGridBoundaryProjectionType* vertexProjection_ ;
00562 
00563     const DuneBoundaryProjectionType *globalProjection () const
00564     {
00565       return bndPrj_;
00566     }
00567 
00569     const DuneBoundaryProjectionType* boundaryProjection(const int segmentIndex) const
00570     {
00571       if( bndPrj_ )
00572       {
00573         return bndPrj_;
00574       }
00575       else
00576       {
00577         // note pointer can be zero (identity mapping)
00578         assert( bndVec_ );
00579         assert( segmentIndex < (int) bndVec_->size() );
00580         return (*bndVec_)[ segmentIndex ];
00581       }
00582     }
00583 
00584   public:  
00586     size_t numBoundarySegments () const
00587     { 
00588 #ifdef ALUGRID_VERTEX_PROJECTION
00589       return myGrid().numMacroBndSegments();
00590 #else 
00591       derr << "Method available in any version of ALUGrid > 1.14 \n";
00592       return 0;
00593 #endif
00594     }
00595 
00597     bool hasBoundaryProjection() const
00598     {
00599       return (vertexProjection_ != 0);
00600     }
00601 
00602   protected:   
00603     using BaseType :: getRealImplementation ;
00604 
00605   public:
00606     template< class IntersectionInterfaceType >
00607     const typename BaseType
00608       :: template ReturnImplementationType< IntersectionInterfaceType>
00609       :: ImplementationType & DUNE_DEPRECATED
00610     getRealIntersectionIterator ( const IntersectionInterfaceType &it ) const
00611     {
00612       return this->getRealImplementation(it);
00613     }
00614     
00615     template< class IntersectionType >
00616     const typename BaseType
00617       :: template ReturnImplementationType< IntersectionType>
00618       :: ImplementationType &
00619     getRealIntersection ( const IntersectionType &intersection ) const
00620     {
00621       return this->getRealImplementation( intersection );
00622     }
00623 
00624     const GridObjectFactoryType& factory() const {
00625 #ifdef USE_SMP_PARALLEL
00626       assert( (int) factoryVec_.size() > GridObjectFactoryType :: threadNumber() );
00627       return factoryVec_[ GridObjectFactoryType :: threadNumber() ];
00628 #else
00629       return factory_;
00630 #endif
00631     }
00632 
00633   protected:
00634     // max level of grid
00635     int maxlevel_;
00636     friend class IntersectionIteratorWrapper < const ThisType, LeafIntersectionIteratorImp > ;
00637     friend class IntersectionIteratorWrapper < const ThisType, LevelIntersectionIteratorImp > ;
00638     friend class LeafIntersectionIteratorWrapper < const ThisType > ;
00639     friend class LevelIntersectionIteratorWrapper< const ThisType > ;
00640 
00641     mutable ALU2dGridMarkerVector marker_[MAXL];
00642   public: 
00643     typedef ALU2dGridLeafMarkerVector ALU2dGridLeafMarkerVectorType;
00644   private:  
00645     // always update this marker!!!
00646     mutable ALU2dGridLeafMarkerVectorType leafMarker_;
00647 
00648   public: 
00651     ALU2dGridMarkerVector & getMarkerVector(int level) const
00652     {
00653       assert( level >= 0);
00654       assert( level <= MAXL);
00655       return marker_[level];
00656     }
00657 
00660     ALU2dGridLeafMarkerVectorType & getLeafMarker() const
00661     {
00662       return leafMarker_;
00663     }
00664     
00667     template <GrapeIOFileFormatType ftype>
00668     bool writeGrid( const std::string filename, alu2d_ctype time ) const ;
00669 
00670     bool writeGrid_Xdr( const std::string filename, alu2d_ctype time ) const ;
00671     bool writeGrid_Ascii( const std::string filename, alu2d_ctype time ) const ;
00672   
00675     template <GrapeIOFileFormatType ftype>
00676     bool readGrid( const std::string filename, alu2d_ctype & time );
00677 
00678   protected:
00681     bool nonConform () const 
00682     { 
00683       return (nrOfHangingNodes_ > 0);
00684     }
00685 
00686 #if ALU2DGRID_PARALLEL
00687     typedef RankManager<ThisType> RankManagerType;
00688     RankManagerType rankManager_;
00689   public:    
00690     const RankManagerType& rankManager() const 
00691     {
00692       return rankManager_;
00693     }
00694 #endif
00695 
00696   public:
00698     template<class DataHandleImp,class DataTypeImp>
00699     void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, 
00700         InterfaceType iftype, CommunicationDirection dir, int level) const;
00701 
00705     template<class DataHandleImp,class DataTypeImp>
00706     void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, 
00707         InterfaceType iftype, CommunicationDirection dir) const;
00708 
00709     int ghostSize ( int level, int codim ) const
00710     {
00711       return ghostSize( codim );
00712     }
00713 
00714     int ghostSize ( int codim ) const
00715     {
00716 #if ALU2DGRID_PARALLEL
00717       return 1;
00718 #else
00719       return 0;
00720 #endif
00721     }
00722 
00724     bool loadBalance() ;
00725 
00727     template<class DataHandle>
00728     bool loadBalance(DataHandle& data) ;
00729 
00730     void checkManager() { 
00731 #if ALU2DGRID_PARALLEL
00732       rankManager_.notifyMarking () ; 
00733 #endif
00734     }
00735 
00736   }; // end class ALU2dGrid
00737 
00738   namespace Capabilities 
00739   {
00740     template<int dim, int dimw, ALU2DSPACE ElementType eltype, int cdim>
00741     struct hasEntity<ALU2dGrid<dim,dimw,eltype>, cdim >
00742     {
00743       static const bool v = true;
00744     };
00745 
00746     template<int dim, int dimw, ALU2DSPACE ElementType eltype>
00747     struct isLevelwiseConforming< ALU2dGrid<dim,dimw,eltype> >
00748     {
00749       static const bool v = false;
00750     };
00751 
00752   } // end namespace Capabilities
00753   
00754 } // end namespace Dune
00755 
00756 #include "entity.hh"
00757 #include "geometry.hh"
00758 #include <dune/grid/alugrid/2d/intersection.hh>
00759 #include <dune/grid/alugrid/2d/iterator.hh>
00760 
00761 #include "grid_imp.cc"
00762 
00763 #endif

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].