dune-grid  2.2.0
alugrid/2d/alugrid.hh
Go to the documentation of this file.
00001 #ifndef DUNE_ALU2D_ALUGRID_HH
00002 #define DUNE_ALU2D_ALUGRID_HH
00003 
00004 // only include this code, if ENABLE_ALUGRID is defined
00005 #ifdef ENABLE_ALUGRID
00006 
00007 #include <dune/grid/alugrid/common/declaration.hh>
00008 #include <dune/grid/alugrid/common/capabilities.hh>
00009 #include <dune/grid/alugrid/2d/capabilities.hh>
00010 #include <dune/grid/alugrid/2d/grid.hh>
00011 
00012 namespace Dune
00013 {
00014 
00020 template<int dimw>
00021 class ALUCubeGrid< 2, dimw >
00022 : public Dune::ALU2dGrid< 2, dimw, ALU2DSPACE quadrilateral >
00023 {
00024   typedef ALUCubeGrid< 2, dimw > This;
00025 
00026   typedef Dune::ALU2dGrid< 2, dimw, ALU2DSPACE quadrilateral > BaseType;
00027   enum { dim      = 2 };
00028   enum { dimworld = dimw };
00029 
00030 public:
00032   typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
00033 
00035   typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
00036 
00045   ALUCubeGrid(const std::string macroName, 
00046               const DuneBoundaryProjectionType* bndProject  = 0,
00047               const DuneBoundaryProjectionVector* bndVector = 0,
00048               const bool verbose = true )
00049     : BaseType(macroName,1, bndProject, bndVector) 
00050   {
00051     if( verbose ) 
00052     {
00053       std::cout << "\nCreated serial ALUCubeGrid<"<<dim<<","<<dimworld;
00054       std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00055     }
00056   }
00057 
00067   ALUCubeGrid(const std::string macroName,
00068               std::istream& macroFile,
00069               const DuneBoundaryProjectionType* bndProject  = 0,
00070               const DuneBoundaryProjectionVector* bndVector = 0, 
00071               const bool verbose = true )
00072     : BaseType("",1, bndProject, bndVector, &macroFile) 
00073   {
00074     if( verbose ) 
00075     {
00076       std::cout << "\nCreated serial ALUCubeGrid<"<<dim<<","<<dimworld;
00077       if( macroName == "" ) 
00078         std::cout <<">. \n\n";     
00079       else 
00080         std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00081     }
00082   }
00083 
00085   ALUCubeGrid( ) : BaseType(1) 
00086   {
00087     std::cout << "\nCreated empty ALUCubeGrid<"<<dim<<","<<dimworld <<">. \n\n";
00088   }
00089 
00090   enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
00091   enum { refineStepsForHalf = 1 };
00092   typedef typename BaseType::ctype ctype;
00093   typedef typename BaseType::GridFamily GridFamily;
00094   typedef typename GridFamily::Traits Traits;
00095   typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
00096   typedef typename Traits :: GlobalIdSet GlobalIdSet;
00097   typedef typename Traits :: LocalIdSet LocalIdSet;
00098   typedef typename GridFamily :: LevelIndexSetImp  LevelIndexSetImp;
00099   typedef typename GridFamily :: LeafIndexSetImp  LeafIndexSetImp;
00100   typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
00101   typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
00102   typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
00103   typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
00104 
00105   template< PartitionIteratorType pitype >
00106   struct Partition
00107   {
00108     typedef typename Dune::GridView< DefaultLevelGridViewTraits< const This, pitype > >
00109       LevelGridView;
00110     typedef typename Dune::GridView< DefaultLeafGridViewTraits< const This, pitype > >
00111       LeafGridView;
00112   };
00113 
00114   typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
00115   typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
00116 
00117   template< PartitionIteratorType pitype >
00118   typename Partition< pitype >::LevelGridView levelView ( int level ) const
00119   {
00120     typedef typename Partition< pitype >::LevelGridView LevelGridView;
00121     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00122     return LevelGridView( LevelGridViewImp( *this, level ) );
00123   }
00124 
00125   template< PartitionIteratorType pitype >
00126   typename Partition< pitype >::LeafGridView leafView () const
00127   {
00128     typedef typename Partition< pitype >::LeafGridView LeafGridView;
00129     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00130     return LeafGridView( LeafGridViewImp( *this ) );
00131   }
00132 
00133   LevelGridView levelView ( int level ) const
00134   {
00135     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00136     return LevelGridView( LevelGridViewImp( *this, level ) );
00137   }
00138 
00139   LeafGridView leafView () const
00140   {
00141     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00142     return LeafGridView( LeafGridViewImp( *this ) );
00143   }
00144 
00145 private:
00146   friend class Conversion< ALUCubeGrid<dimension,dimensionworld> , HasObjectStream > ;
00147   friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> , HasObjectStream > ;
00148 
00149   friend class Conversion< ALUCubeGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00150   friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00151 
00152   template< class >
00153   friend class ALU2dGridFactory;
00154   
00156   ALUCubeGrid( const ALUCubeGrid & g ) ; // : BaseType(g) {}
00157   
00159   ALUCubeGrid<dim,dimworld>& 
00160   operator = (const ALUCubeGrid& g); 
00161 };
00162 
00168 template<int dimw>
00169 class ALUSimplexGrid< 2, dimw >
00170 : public Dune::ALU2dGrid< 2, dimw, ALU2DSPACE triangle >
00171 {
00172   typedef ALUSimplexGrid< 2, dimw > This;
00173 
00174   typedef Dune::ALU2dGrid< 2, dimw, ALU2DSPACE triangle > BaseType;
00175   enum { dim      = 2 };
00176   enum { dimworld = dimw };
00177 
00178 public:
00180   typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
00181 
00183   typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
00184 
00193   ALUSimplexGrid(const std::string macroName,
00194                  const DuneBoundaryProjectionType* bndProject  = 0,
00195                  const DuneBoundaryProjectionVector* bndVector = 0,
00196                  const bool verbose = true )
00197     : BaseType(macroName,1, bndProject, bndVector) 
00198   {
00199     if( verbose )
00200     {
00201       std::cout << "\nCreated serial ALUSimplexGrid<"<<dim<<","<<dimworld;
00202       std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00203     }
00204   }
00205 
00215   ALUSimplexGrid(const std::string macroName,
00216                  std::istream& macroFile,
00217                  const DuneBoundaryProjectionType* bndProject  = 0,
00218                  const DuneBoundaryProjectionVector* bndVector = 0,
00219                  const bool verbose = true )
00220     : BaseType("",1, bndProject, bndVector, &macroFile) 
00221   {
00222     if( verbose ) 
00223     {
00224       std::cout << "\nCreated serial ALUSimplexGrid<"<<dim<<","<<dimworld;
00225       if( macroName == "" ) 
00226         std::cout <<">. \n\n";     
00227       else 
00228         std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00229     }
00230   }
00231 
00233   ALUSimplexGrid( ) : BaseType(1) 
00234   {
00235     std::cout << "\nCreated empty ALUSimplexGrid<"<<dim<<","<<dimworld <<">. \n\n";
00236   }
00237 
00238   enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
00239   enum { refineStepsForHalf = 1 };
00240   typedef typename BaseType::ctype ctype;
00241   typedef typename BaseType::GridFamily GridFamily;
00242   typedef typename GridFamily::Traits Traits;
00243   typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
00244   typedef typename Traits :: GlobalIdSet GlobalIdSet;
00245   typedef typename Traits :: LocalIdSet LocalIdSet;
00246   typedef typename GridFamily :: LevelIndexSetImp  LevelIndexSetImp;
00247   typedef typename GridFamily :: LeafIndexSetImp  LeafIndexSetImp;
00248   typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
00249   typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
00250   typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
00251   typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
00252 
00253   template< PartitionIteratorType pitype >
00254   struct Partition
00255   {
00256     typedef typename Dune::GridView< DefaultLevelGridViewTraits< const This, pitype > >
00257       LevelGridView;
00258     typedef typename Dune::GridView< DefaultLeafGridViewTraits< const This, pitype > >
00259       LeafGridView;
00260   };
00261 
00262   typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
00263   typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
00264 
00265   template< PartitionIteratorType pitype >
00266   typename Partition< pitype >::LevelGridView levelView ( int level ) const
00267   {
00268     typedef typename Partition< pitype >::LevelGridView LevelGridView;
00269     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00270     return LevelGridView( LevelGridViewImp( *this, level ) );
00271   }
00272 
00273   template< PartitionIteratorType pitype >
00274   typename Partition< pitype >::LeafGridView leafView () const
00275   {
00276     typedef typename Partition< pitype >::LeafGridView LeafGridView;
00277     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00278     return LeafGridView( LeafGridViewImp( *this ) );
00279   }
00280 
00281   LevelGridView levelView ( int level ) const
00282   {
00283     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00284     return LevelGridView( LevelGridViewImp( *this, level ) );
00285   }
00286 
00287   LeafGridView leafView () const
00288   {
00289     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00290     return LeafGridView( LeafGridViewImp( *this ) );
00291   }
00292 
00293 private:
00294   friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> , HasObjectStream > ;
00295   friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> , HasObjectStream > ;
00296 
00297   friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00298   friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00299 
00300   template< class >
00301   friend class ALU2dGridFactory;
00302   
00304   ALUSimplexGrid( const ALUSimplexGrid & g ) ; // : BaseType(g) {}
00305   
00307   ALUSimplexGrid<dim,dimworld>& 
00308   operator = (const ALUSimplexGrid& g); 
00309 };
00310 
00338 template <int dim, int dimworld>
00339 class ALUConformGrid {
00340   dune_static_assert((AlwaysFalse<integral_constant<int,dim> >::value),
00341                      "The unspecialized version of ALUConformGrid is defined "
00342                      "for documentation purposes only, only the "
00343                      "specializations can actually be used.");
00344 };
00345 
00346 namespace Capabilities {
00358   template<int dim,int dimw, int cdim >
00359   struct hasEntity<Dune::ALUConformGrid<dim, dimw>, cdim >
00360   {
00361     static const bool v = true;
00362   };
00363 
00367   template<int dim,int dimw>
00368   struct isParallel<const ALUConformGrid<dim, dimw> > {
00369     static const bool v = false;
00370   };
00371 
00375   template<int dim,int dimw>
00376   struct isLevelwiseConforming< ALUConformGrid<dim,dimw> >
00377   {
00378     static const bool v = false;
00379   };
00380 
00384   template<int dim,int dimw>
00385   struct isLeafwiseConforming< ALUConformGrid<dim,dimw> >
00386   {
00387     static const bool v = true;
00388   };
00389 
00393   template<int dim,int dimw>
00394   struct hasBackupRestoreFacilities< ALUConformGrid<dim,dimw> >
00395   {
00396     static const bool v = true;
00397   };
00398 
00399 } // end namespace Capabilities
00400 
00401 
00402 
00408 template<int dimw>
00409 class ALUConformGrid< 2, dimw >
00410 : public Dune::ALU2dGrid< 2, dimw, ALU2DSPACE triangle >
00411 {
00412   typedef ALUConformGrid< 2, dimw > This;
00413 
00414   typedef Dune::ALU2dGrid<2,dimw, ALU2DSPACE triangle> BaseType;
00415   enum { dim      = 2 };
00416   enum { dimworld = dimw };
00417  public:
00419   typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
00420 
00422   typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
00423 
00432   ALUConformGrid(const std::string macroName, 
00433                  const DuneBoundaryProjectionType* bndProject  = 0,
00434                  const DuneBoundaryProjectionVector* bndVector = 0, 
00435                  const bool verbose = true)
00436     : BaseType(macroName, 0, bndProject, bndVector) 
00437   {
00438     if( verbose ) 
00439     {
00440       std::cout << "\nCreated serial ALUConformGrid<"<<dim<<","<<dimworld;
00441       std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00442     }
00443   }
00444 
00454   ALUConformGrid(const std::string macroName,
00455                  std::istream& macroFile, 
00456                  const DuneBoundaryProjectionType* bndProject  = 0,
00457                  const DuneBoundaryProjectionVector* bndVector = 0,
00458                  const bool verbose = true )
00459     : BaseType("", 0, bndProject, bndVector, &macroFile) 
00460   {
00461     if( verbose ) 
00462     {
00463       std::cout << "\nCreated serial ALUConformGrid<"<<dim<<","<<dimworld;
00464       if( macroName == "" ) 
00465         std::cout <<">. \n\n";     
00466       else 
00467         std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
00468     }
00469   }
00470 
00472   ALUConformGrid( ) : BaseType(0)
00473   {
00474     std::cout << "\nCreated empty ALUConformGrid<"<<dim<<","<<dimworld <<">. \n\n";
00475   }
00476 
00478   static inline std::string name () { return "ALUConformGrid"; }
00479 
00480   enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
00481   enum { refineStepsForHalf = 2 };
00482   typedef typename BaseType::ctype ctype;
00483   typedef typename BaseType::GridFamily GridFamily;
00484   typedef typename GridFamily::Traits Traits;
00485   typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
00486   typedef typename Traits :: GlobalIdSet GlobalIdSet;
00487   typedef typename Traits :: LocalIdSet LocalIdSet;
00488   typedef typename GridFamily :: LevelIndexSetImp  LevelIndexSetImp;
00489   typedef typename GridFamily :: LeafIndexSetImp  LeafIndexSetImp;
00490   typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
00491   typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
00492   typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
00493   typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
00494 
00495   template< PartitionIteratorType pitype >
00496   struct Partition
00497   {
00498     typedef typename Dune::GridView< DefaultLevelGridViewTraits< const This, pitype > >
00499       LevelGridView;
00500     typedef typename Dune::GridView< DefaultLeafGridViewTraits< const This, pitype > >
00501       LeafGridView;
00502   };
00503 
00504   typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
00505   typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
00506 
00507   template< PartitionIteratorType pitype >
00508   typename Partition< pitype >::LevelGridView levelView ( int level ) const
00509   {
00510     typedef typename Partition< pitype >::LevelGridView LevelGridView;
00511     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00512     return LevelGridView( LevelGridViewImp( *this, level ) );
00513   }
00514 
00515   template< PartitionIteratorType pitype >
00516   typename Partition< pitype >::LeafGridView leafView () const
00517   {
00518     typedef typename Partition< pitype >::LeafGridView LeafGridView;
00519     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00520     return LeafGridView( LeafGridViewImp( *this ) );
00521   }
00522 
00523   LevelGridView levelView ( int level ) const
00524   {
00525     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00526     return LevelGridView( LevelGridViewImp( *this, level ) );
00527   }
00528 
00529   LeafGridView leafView () const
00530   {
00531     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00532     return LeafGridView( LeafGridViewImp( *this ) );
00533   }
00534  
00535 private:
00536   friend class Conversion< ALUConformGrid<dimension,dimensionworld> , HasObjectStream > ;
00537   friend class Conversion< const ALUConformGrid<dimension,dimensionworld> , HasObjectStream > ;
00538 
00539   friend class Conversion< ALUConformGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00540   friend class Conversion< const ALUConformGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
00541   
00542   template< class >
00543   friend class ALU2dGridFactory;
00544   
00546   ALUConformGrid( const ALUConformGrid & g ) ; // : BaseType(g) {}
00547   
00549   ALUConformGrid<dim,dimworld>& 
00550   operator = (const ALUConformGrid& g); 
00551 };
00552 
00553 /*- 
00554    (see ALUGrid homepage: http://www.mathematik.uni-freiburg.de/IAM/Research/alugrid/)
00555 
00556    \li Available Implementations 
00557         - quadrilateral and hexahedral elements only nonconforming refinement
00558           - Dune::ALUGrid< 2, 2, cube, nonconforming >  
00559           - Dune::ALUGrid< 2, 3, cube, nonconforming >
00560           - Dune::ALUGrid< 3, 3, cube, nonconforming >
00561         - simplicial elements and nonconforming refinement  
00562           - Dune::ALUGrid< 2, 2, simplex, nonconforming >  
00563           - Dune::ALUGrid< 2, 3, simplex, nonconforming >
00564           - Dune::ALUGrid< 3, 3, simplex, nonconforming >
00565         - simplicial elements and bisection refinement  
00566           - Dune::ALUGrid< 2, 2, simplex, conforming >  
00567           - Dune::ALUGrid< 2, 3, simplex, conforming >
00568           - Dune::ALUGrid< 3, 3, simplex, conforming > (work in progress)
00569 
00570    \note template parameter Comm defaults to MPI_Comm, if MPI is available, No_Comm  otherwise.
00571 */
00572 template<int dimw, ALUGridElementType elType, ALUGridRefinementType refinementType, class Comm >
00573 class ALUGrid< 2, dimw, elType, refinementType, Comm >
00574  : public ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid
00575 {
00576   typedef ALUGrid< 2, dimw, elType, refinementType, Comm > This;
00577   typedef typename ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid BaseType;
00578 
00579   enum { dim      = 2 };
00580   enum { dimworld = dimw };
00581 
00582 public:
00584   typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
00585 
00587   typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
00588 
00597   ALUGrid(const std::string macroName,
00598           const DuneBoundaryProjectionType* bndProject  = 0,
00599           const DuneBoundaryProjectionVector* bndVector = 0,
00600           const bool verbose = true )
00601     : BaseType(macroName, hangingNodes(), bndProject, bndVector) 
00602   {
00603     if( verbose )
00604     {
00605       std::cout << "\nCreated serial " << name() << nameSuffix()
00606                 << " from macro grid file '" << macroName << "'." << std::endl << std::endl;
00607     }
00608   }
00609 
00619   ALUGrid(const std::string macroName,
00620           std::istream& macroFile,
00621           const DuneBoundaryProjectionType* bndProject  = 0,
00622           const DuneBoundaryProjectionVector* bndVector = 0,
00623           const bool verbose = true )
00624     : BaseType("", hangingNodes(), bndProject, bndVector, &macroFile) 
00625   {
00626     if( verbose ) 
00627     {
00628       std::cout << "\nCreated serial " << name() << nameSuffix();
00629       if( macroName != "" ) 
00630         std::cout <<" from macro grid file '" << macroName;
00631       std::cout << "." << std::endl << std::endl;
00632     }
00633   }
00634 
00635   static std::string name () { return std::string("ALUGrid"); }
00636 
00638   ALUGrid( ) : BaseType( hangingNodes() ) 
00639   {
00640     std::cout << "\nCreated serial " << name() << nameSuffix() << "." << std::endl << std::endl;
00641   }
00642 
00643   enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
00644   enum { refineStepsForHalf = 1 };
00645   typedef typename BaseType::ctype ctype;
00646   typedef typename BaseType::GridFamily GridFamily;
00647   typedef typename GridFamily::Traits Traits;
00648   typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
00649   typedef typename Traits :: GlobalIdSet GlobalIdSet;
00650   typedef typename Traits :: LocalIdSet LocalIdSet;
00651   typedef typename GridFamily :: LevelIndexSetImp  LevelIndexSetImp;
00652   typedef typename GridFamily :: LeafIndexSetImp  LeafIndexSetImp;
00653   typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
00654   typedef typename Traits::template Codim<0>::LeafIterator LeafIteratorType;
00655   typedef typename Traits::template Codim<0>::LeafIterator LeafIterator;
00656   typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
00657 
00658   template< PartitionIteratorType pitype >
00659   struct Partition
00660   {
00661     typedef typename Dune::GridView< DefaultLevelGridViewTraits< const This, pitype > >
00662       LevelGridView;
00663     typedef typename Dune::GridView< DefaultLeafGridViewTraits< const This, pitype > >
00664       LeafGridView;
00665   };
00666 
00667   typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
00668   typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
00669 
00670   template< PartitionIteratorType pitype >
00671   typename Partition< pitype >::LevelGridView levelView ( int level ) const
00672   {
00673     typedef typename Partition< pitype >::LevelGridView LevelGridView;
00674     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00675     return LevelGridView( LevelGridViewImp( *this, level ) );
00676   }
00677 
00678   template< PartitionIteratorType pitype >
00679   typename Partition< pitype >::LeafGridView leafView () const
00680   {
00681     typedef typename Partition< pitype >::LeafGridView LeafGridView;
00682     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00683     return LeafGridView( LeafGridViewImp( *this ) );
00684   }
00685 
00686   LevelGridView levelView ( int level ) const
00687   {
00688     typedef typename LevelGridView::GridViewImp LevelGridViewImp;
00689     return LevelGridView( LevelGridViewImp( *this, level ) );
00690   }
00691 
00692   LeafGridView leafView () const
00693   {
00694     typedef typename LeafGridView::GridViewImp LeafGridViewImp;
00695     return LeafGridView( LeafGridViewImp( *this ) );
00696   }
00697 
00698 private:
00699   static std::string nameSuffix()
00700   {
00701     std::string elt ( elType == cube ? "cube," : "simplex," );
00702     std::string ref ( refinementType == nonconforming ? "nonconforming>" : "conforming>" );
00703     std::stringstream suffix;
00704     suffix << "<"<<dim<<","<<dimworld<<"," << elt << ref;
00705     return suffix.str();
00706   }
00707 
00708   // returns number of hanging nodes allowed (0 or 1)
00709   int hangingNodes() const 
00710   { 
00711     return ((elType == simplex) && (refinementType == conforming)) ? 0 : 1;
00712   }
00713 
00714   friend class Conversion< This, HasObjectStream > ;
00715   friend class Conversion< const This, HasObjectStream > ;
00716 
00717   friend class Conversion< This, HasHierarchicIndexSet > ;
00718   friend class Conversion< const This, HasHierarchicIndexSet > ;
00719 
00720   template< class >
00721   friend class ALU2dGridFactory;
00722   
00724   ALUGrid( const ALUGrid & g ) ; // : BaseType(g) {}
00725   
00727   This& operator = (const ALUGrid& g); 
00728 };
00729 
00730 } //end  namespace Dune 
00731 
00732 #else
00733 #error "Trying to use <dune/grid/alugrid.hh> without ALUGRID_CPPFLAGS."
00734 #endif // #ifdef ENABLE_ALUGRID
00735 
00736 #endif