dune-grid  2.2.0
alugrid/3d/geometry.hh
Go to the documentation of this file.
00001 #ifndef DUNE_ALU3DGRIDGEOMETRY_HH
00002 #define DUNE_ALU3DGRIDGEOMETRY_HH
00003 
00004 // System includes
00005 
00006 // Dune includes
00007 #include <dune/common/misc.hh>
00008 #include <dune/grid/common/grid.hh>
00009 
00010 // Local includes
00011 #include "alu3dinclude.hh"
00012 #include "topology.hh"
00013 #include "mappings.hh"
00014 
00015 namespace Dune
00016 {
00017 
00018   // Forward declarations
00019   template<int cd, int dim, class GridImp> 
00020   class ALU3dGridEntity;
00021   template<int cd, class GridImp >
00022   class ALU3dGridEntityPointer;
00023   template<int mydim, int coorddim, class GridImp>
00024   class ALU3dGridGeometry;
00025   template< ALU3dGridElementType, class >
00026   class ALU3dGrid;
00027   class BilinearSurfaceMapping;
00028   class TrilinearMapping;
00029 
00030   template< class GridImp >
00031   class ALU3dGridIntersectionIterator;
00032 
00033   template <int cdim>
00034   class MyALUGridGeometryImplementation 
00035   {
00036   public:  
00037     typedef FieldVector<alu3d_ctype, cdim> CoordinateVectorType;
00038 
00039     static const signed char invalid      = -1; // means geometry is not meaningfull 
00040     static const signed char updated      =  0; // means the point values have been set
00041     static const signed char buildmapping =  1; // means updated and mapping was build 
00042 
00043     struct CoordVecCopy
00044     {
00045 
00046       // copy coordinate vector from field vector or alu3d_ctype[cdim] 
00047       template <class CoordPtrType>
00048       static inline void copy(const CoordPtrType& p,
00049                               CoordinateVectorType& c)
00050       { 
00051         assert( cdim == 3 );
00052         c[0] = p[0];
00053         c[1] = p[1];
00054         c[2] = p[2];
00055       }
00056 
00057       template <class CoordPtrType>
00058       void update(const CoordPtrType&, 
00059                   const CoordPtrType&, 
00060                   const CoordPtrType&, 
00061                   const CoordPtrType&, 
00062                   const CoordPtrType&, 
00063                   const CoordPtrType&, 
00064                   const CoordPtrType&, 
00065                   const CoordPtrType& ) const 
00066       {
00067         DUNE_THROW(InvalidStateException,"This method should not be called!");
00068       } 
00069 
00070       template <class CoordPtrType>
00071       void update(const CoordPtrType&, 
00072                   const CoordPtrType&, 
00073                   const CoordPtrType&, 
00074                   const CoordPtrType& ) const 
00075       {
00076         DUNE_THROW(InvalidStateException,"This method should not be called!");
00077       } 
00078 
00079       template <class CoordPtrType>
00080       void update(const CoordPtrType&, 
00081                   const CoordPtrType&, 
00082                   const CoordPtrType& ) const 
00083       {
00084         DUNE_THROW(InvalidStateException,"This method should not be called!");
00085       } 
00086     };
00087 
00089     template <int dummy, int dim, 
00090               ALU3dGridElementType eltype> class GeometryImpl;
00091   public:  
00092     // geometry implementation for edges and vertices 
00093     template <int dummy, int dim, ALU3dGridElementType eltype> 
00094     class GeometryImpl : public CoordVecCopy
00095     {
00096       using CoordVecCopy :: copy ;
00097 
00098       enum { corners_ = dim+1 };
00100       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00101 
00102       typedef LinearMapping<cdim, dim> MappingType;
00103 
00104       CoordinateMatrixType coord_;
00105       MappingType liMap_;
00106       signed char status_;
00107 
00108     public:
00109       using CoordVecCopy :: update ;
00110 
00111       GeometryImpl() : coord_() , liMap_() , status_( invalid ) {}
00112       GeometryImpl(const GeometryImpl& other) 
00113         : coord_(other.coord_), 
00114           liMap_(other.liMap_), 
00115           status_(other.status_)
00116       {}
00117 
00118       // return coordinate vector 
00119       inline const CoordinateVectorType& operator [] (const int i) const
00120       {
00121         assert( valid() );
00122         assert( i>=0 && i<corners_ );
00123         return coord_[i];
00124       }
00125 
00126       inline MappingType& mapping() 
00127       { 
00128         assert( valid() );
00129         if( status_ == buildmapping ) return liMap_;
00130 
00131         liMap_.buildMapping( coord_[0] );
00132         status_ = buildmapping ;
00133         return liMap_;
00134       }
00135 
00136       // update vertex 
00137       template <class CoordPtrType>
00138       inline void update(const CoordPtrType& p0)
00139       {
00140         assert( corners_ == 1 );
00141         copy( p0, coord_[0] );
00142         // we need to update the mapping 
00143         status_ = updated ;
00144       }
00145 
00146       // set status to invalid 
00147       void invalidate () { status_ = invalid ; }
00148 
00149       // return true if geometry is valid 
00150       bool valid () const { return status_ != invalid ; }
00151     };
00152 
00153     // geometry implementation for edges and vertices 
00154     template <int dummy, ALU3dGridElementType eltype> 
00155     class GeometryImpl<dummy,1,eltype> : public CoordVecCopy
00156     {
00157       using CoordVecCopy :: copy ;
00158 
00159       enum { dim = 1 };
00160       enum { corners_ = dim+1 };
00162       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00163 
00164       typedef LinearMapping<cdim, dim> MappingType;
00165 
00166       // for edges use LinearMapping<cdim, 1> here that has all features
00167       // implemented 
00168 
00169       CoordinateMatrixType coord_;
00170       MappingType liMap_;
00171       signed char status_;
00172 
00173     public:
00174       using CoordVecCopy :: update ;
00175 
00176       GeometryImpl() : coord_() , liMap_() , status_( invalid ) {}
00177       GeometryImpl(const GeometryImpl& other) 
00178         : coord_(other.coord_), 
00179           liMap_(other.liMap_), 
00180           status_(other.status_)
00181       {}
00182 
00183       // return coordinate vector 
00184       inline const CoordinateVectorType& operator [] (const int i) const
00185       {
00186         assert( valid() );
00187         assert( i>=0 && i<corners_ );
00188         return coord_[i];
00189       }
00190 
00191       inline MappingType& mapping() 
00192       { 
00193         assert( valid() );
00194         if( status_ == buildmapping ) return liMap_;
00195 
00196         liMap_.buildMapping( coord_[0], coord_[1] );
00197         status_ = buildmapping ;
00198         return liMap_;
00199       }
00200 
00201       // update edge  
00202       template <class CoordPtrType>
00203       inline void update(const CoordPtrType& p0,
00204                          const CoordPtrType& p1)
00205       {
00206         assert( corners_ == 2 );
00207         copy( p0, coord_[0] );
00208         copy( p1, coord_[1] );
00209         status_ = updated;
00210       }
00211 
00212       // set status to invalid 
00213       void invalidate () { status_ = invalid ; }
00214 
00215       // return true if geometry is valid 
00216       bool valid () const { return status_ != invalid ; }
00217     };
00218 
00219     // geom impl for simplex faces (triangles)
00220     template <int dummy>
00221     class GeometryImpl<dummy,2, tetra> : public CoordVecCopy
00222     {
00223       using CoordVecCopy :: copy ;
00224 
00225       enum { corners_ = 3 };
00226 
00228       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00229       typedef LinearMapping<cdim, 2>   MappingType;
00230 
00232       CoordinateMatrixType coord_;
00233 
00234       MappingType liMap_;
00235       signed char status_;
00236 
00237     public:
00238       using CoordVecCopy :: update ;
00239 
00240       // constructor 
00241       GeometryImpl() : coord_(), liMap_(), status_( invalid ) {}
00242       // copy constructor 
00243       GeometryImpl(const GeometryImpl& other) :
00244         coord_(other.coord_),
00245         liMap_(other.liMap_),
00246         status_(other.status_)
00247       {}
00248 
00249       // return coordinate vector 
00250       inline const CoordinateVectorType& operator [] (const int i) const
00251       {
00252         assert( valid() );
00253         assert( i>=0 && i<corners_ );
00254         return coord_[i];
00255       }
00256 
00257       // update geometry coordinates 
00258       template <class CoordPtrType>
00259       inline void update(const CoordPtrType& p0,
00260                          const CoordPtrType& p1,
00261                          const CoordPtrType& p2)
00262       {
00263         copy(p0, coord_[0] );
00264         copy(p1, coord_[1] );
00265         copy(p2, coord_[2] );
00266         status_ = updated;
00267       }
00268 
00269       // return mapping (always up2date)
00270       inline MappingType& mapping()
00271       {
00272         assert( valid() );
00273         if( status_ == buildmapping ) return liMap_;
00274 
00275         liMap_.buildMapping( coord_[0], coord_[1], coord_[2] );
00276         status_ = buildmapping ;
00277         return liMap_;
00278       }
00279 
00280       // set status to invalid 
00281       void invalidate () { status_ = invalid ; }
00282 
00283       // return true if geometry is valid 
00284       bool valid () const { return status_ != invalid ; }
00285     };
00286 
00288     //
00289     //  hexa specializations 
00290     //
00292 
00293     // geom impl for cube faces (quadrilaterals)
00294     template <int dummy>
00295     class GeometryImpl<dummy,2, hexa> : public CoordVecCopy 
00296     {
00297       using CoordVecCopy :: copy ;
00298 
00299       enum { corners_ = 4 };
00300 
00302       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00303       typedef BilinearSurfaceMapping  MappingType;
00304 
00306       CoordinateMatrixType coord_;
00307 
00308       MappingType biMap_;
00309       signed char status_;
00310 
00311     public:
00312       using CoordVecCopy :: update ;
00313 
00314       // constructor 
00315       GeometryImpl() : coord_(), biMap_(), status_( invalid ) {}
00316       // copy constructor 
00317       GeometryImpl(const GeometryImpl& other) :
00318         coord_(other.coord_),
00319         biMap_(other.biMap_),
00320         status_(other.status_)
00321       {}
00322 
00323       // return coordinate vector 
00324       inline const CoordinateVectorType& operator [] (const int i) const
00325       {
00326         assert( valid() );
00327         assert( i>=0 && i<corners_ );
00328         return coord_[i];
00329       }
00330 
00331       // update geometry coordinates 
00332       template <class CoordPtrType>
00333       inline void update(const CoordPtrType& p0,
00334                   const CoordPtrType& p1,
00335                   const CoordPtrType& p2,
00336                   const CoordPtrType& p3)
00337       {
00338         copy(p0, coord_[0] );
00339         copy(p1, coord_[1] );
00340         copy(p2, coord_[2] );
00341         copy(p3, coord_[3] );
00342         status_ = updated;
00343       }
00344 
00345       // return mapping (always up2date)
00346       inline MappingType& mapping()
00347       {
00348         assert( valid() );
00349         if( status_ == buildmapping ) return biMap_;
00350 
00351         biMap_.buildMapping( coord_[0], coord_[1], coord_[2], coord_[3] );
00352         status_ = buildmapping ;
00353         return biMap_;
00354       }
00355 
00356       // set status to invalid 
00357       void invalidate () { status_ = invalid ; }
00358 
00359       // return true if geometry is valid 
00360       bool valid () const { return status_ != invalid ; }
00361     };
00362 
00363     // geometry impl for hexahedrons 
00364     template <int dummy>
00365     class GeometryImpl<dummy,3, hexa> : public CoordVecCopy
00366     {
00367       enum { corners_ = 8 };
00368 
00370       typedef alu3d_ctype CoordPtrType[cdim];
00371 
00373       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00374 
00375       typedef TrilinearMapping MappingType;
00376 
00377       // coordinate pointer vector  
00378       const alu3d_ctype* coordPtr_[ corners_ ];
00379       MappingType triMap_;
00380       CoordinateMatrixType* fatherCoord_;
00381       signed char status_;
00382 
00383     public:
00384       using CoordVecCopy :: update ;
00385       using CoordVecCopy :: copy ;
00386 
00388       GeometryImpl() : triMap_(),
00389                        fatherCoord_(0),
00390                        status_( invalid )
00391       {
00392         // set initialize coord pointers
00393         for( int i=0; i<corners_; ++i )
00394           coordPtr_[ i ] = 0;
00395       }
00396 
00397       
00399       GeometryImpl(const GeometryImpl& other) :
00400         triMap_(other.triMap_),
00401         fatherCoord_(0),
00402         status_(other.status_)
00403       {
00404         // copy coord pointers 
00405         for( int i=0; i<corners_; ++i )
00406           coordPtr_[ i ] = other.coordPtr_[ i ];
00407 
00408         // if father coords are set, then reset coordPtr
00409         if( other.fatherCoord_ )
00410         {
00411           fatherCoord_ = new CoordinateMatrixType(*other.fatherCoord_);
00412           CoordinateMatrixType& coord = *fatherCoord_;
00413           for(int i=0; i<corners_; ++i) 
00414           {
00415             coordPtr_[i] = (&(coord[i][0]));
00416           }
00417         }
00418       }                
00419                        
00420       // desctructor 
00421       ~GeometryImpl()
00422       {
00423         if( fatherCoord_ ) delete fatherCoord_;
00424       } 
00425 
00426       const alu3d_ctype* point( const int i ) const 
00427       {
00428         assert( valid() );
00429         assert( i>=0 && i<corners_ );
00430         assert( coordPtr_[i] );
00431         return coordPtr_[ i ];
00432       }
00433         
00434       // return coordinates 
00435       inline CoordinateVectorType operator [] (const int i) const
00436       { 
00437         CoordinateVectorType coord ;
00438         copy( point( i ), coord );
00439         return coord ;
00440       }
00441 
00442       // update geometry coordinates 
00443       inline void update(const CoordPtrType& p0,
00444                          const CoordPtrType& p1,
00445                          const CoordPtrType& p2,
00446                          const CoordPtrType& p3,
00447                          const CoordPtrType& p4,
00448                          const CoordPtrType& p5,
00449                          const CoordPtrType& p6,
00450                          const CoordPtrType& p7)
00451       {
00452         coordPtr_[0] = &p0[ 0 ];
00453         coordPtr_[1] = &p1[ 0 ];
00454         coordPtr_[2] = &p2[ 0 ];
00455         coordPtr_[3] = &p3[ 0 ];
00456         coordPtr_[4] = &p4[ 0 ];
00457         coordPtr_[5] = &p5[ 0 ];
00458         coordPtr_[6] = &p6[ 0 ];
00459         coordPtr_[7] = &p7[ 0 ];
00460         status_ = updated;
00461       }
00462 
00463       // update geometry in father coordinates 
00464       template <class GeometryImp>
00465       inline void updateInFather(const GeometryImp &fatherGeom ,
00466                                  const GeometryImp &myGeom)
00467       {
00468         if( fatherCoord_ == 0 )
00469         {
00470           fatherCoord_ = new CoordinateMatrixType();
00471         }
00472 
00473         CoordinateMatrixType& coord = *fatherCoord_;
00474         // compute the local coordinates in father refelem
00475         for(int i=0; i < myGeom.corners() ; ++i)
00476         {
00477           // calculate coordinate 
00478           coord[i] = fatherGeom.local( myGeom.corner( i ) );
00479 
00480           // set pointer 
00481           coordPtr_[i] = (&(coord[i][0]));
00482 
00483           // to avoid rounding errors
00484           for(int j=0; j<cdim; ++j)
00485           {
00486             if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
00487           }
00488         }
00489 
00490         status_ = updated ;
00491       }
00492 
00493       // return mapping (always up2date)
00494       inline MappingType& mapping()
00495       {
00496         assert( valid() );
00497         if( status_ == buildmapping ) return triMap_;
00498 
00499         triMap_.buildMapping( point( 0 ), point( 1 ), point( 2 ), point( 3 ),
00500                               point( 4 ), point( 5 ), point( 6 ), point( 7 ) );
00501 
00502         status_ = buildmapping;
00503         return triMap_;
00504       }
00505 
00506       // set status to invalid 
00507       void invalidate () { status_ = invalid ; }
00508 
00509       // return true if geometry is valid 
00510       bool valid () const { return status_ != invalid ; }
00511     };
00512 
00513 
00514     // geometry impl for hexahedrons 
00515     template <int dummy>
00516     class GeometryImpl<dummy,3, tetra> : public CoordVecCopy 
00517     {
00518       enum { corners_ = 4 };
00519 
00521       typedef alu3d_ctype CoordPtrType[cdim];
00522 
00524       typedef FieldMatrix<alu3d_ctype, corners_ , cdim>  CoordinateMatrixType;
00525 
00526       typedef LinearMapping<cdim, cdim> MappingType;
00527 
00528       // coordinate pointer vector  
00529       const alu3d_ctype* coordPtr_[ corners_ ];
00530       MappingType liMap_;
00531       CoordinateMatrixType* fatherCoord_;
00532       signed char status_;
00533 
00534     public:
00535       using CoordVecCopy :: update ;
00536       using CoordVecCopy :: copy ;
00537 
00538       // default constructor 
00539       GeometryImpl() : liMap_(),
00540                        fatherCoord_(0),
00541                        status_( invalid )
00542       {
00543         // set initialize coord pointers
00544         for( int i=0; i<corners_; ++i )
00545           coordPtr_[ i ] = 0;
00546       }
00547 
00548       // copy constructor 
00549       GeometryImpl(const GeometryImpl& other) :
00550         liMap_(other.liMap_),
00551         fatherCoord_(0),
00552         status_(other.status_)
00553       {
00554         // copy coord pointers 
00555         for( int i=0; i<corners_; ++i )
00556           coordPtr_[ i ] = other.coordPtr_[ i ];
00557 
00558         // if father coords are set, then reset coordPtr
00559         if( other.fatherCoord_ )
00560         {
00561           fatherCoord_ = new CoordinateMatrixType(*other.fatherCoord_);
00562           CoordinateMatrixType& coord = *fatherCoord_;
00563           for(int i=0; i<corners_; ++i) 
00564           {
00565             coordPtr_[i] = (&(coord[i][0]));
00566           }
00567         }
00568       }                
00569                        
00570       // destructor  
00571       ~GeometryImpl()
00572       {
00573         if( fatherCoord_ ) delete fatherCoord_;
00574       } 
00575 
00576       const alu3d_ctype* point( const int i ) const
00577       {
00578         assert( valid() );
00579         assert( i>=0 && i<corners_ );
00580         assert( coordPtr_[ i ] );
00581         return coordPtr_[ i ];
00582       }
00583         
00584       // return coordinate vector 
00585       inline CoordinateVectorType operator [] (const int i) const
00586       { 
00587         CoordinateVectorType coord ;
00588         copy( point( i ), coord );
00589         return coord ;
00590       }
00591 
00592       // update geometry coordinates 
00593       inline void update(const CoordPtrType& p0,
00594                          const CoordPtrType& p1,
00595                          const CoordPtrType& p2,
00596                          const CoordPtrType& p3)
00597       {
00598         coordPtr_[0] = &p0[ 0 ];
00599         coordPtr_[1] = &p1[ 0 ];
00600         coordPtr_[2] = &p2[ 0 ];
00601         coordPtr_[3] = &p3[ 0 ];
00602         status_ = updated;
00603       }
00604 
00605       // update geometry in father coordinates 
00606       template <class GeometryImp>
00607       inline void updateInFather(const GeometryImp &fatherGeom ,
00608                           const GeometryImp & myGeom)
00609       {
00610         if( fatherCoord_ == 0 )
00611         {
00612           fatherCoord_ = new CoordinateMatrixType();
00613         }
00614 
00615         CoordinateMatrixType& coord = *fatherCoord_;
00616         // compute the local coordinates in father refelem
00617         for(int i=0; i < myGeom.corners() ; ++i)
00618         {
00619           // calculate coordinate 
00620           coord[i] = fatherGeom.local( myGeom.corner( i ) );
00621 
00622           // set pointer 
00623           coordPtr_[i] = (&(coord[i][0]));
00624 
00625           // to avoid rounding errors
00626           for(int j=0; j<cdim; ++j)
00627           {
00628             if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
00629           }
00630         }
00631 
00632         status_ = updated;
00633       }
00634 
00635       // return mapping (always up2date)
00636       inline MappingType& mapping()
00637       {
00638         assert( valid() );
00639         if( status_ == buildmapping ) return liMap_;
00640 
00641         liMap_.buildMapping( point( 0 ), point( 1 ), point( 2 ), point( 3 ) );
00642 
00643         status_ = buildmapping;
00644         return liMap_;
00645       }
00646 
00647       // set status to invalid 
00648       void invalidate () { status_ = invalid ; }
00649 
00650       // return true if geometry is valid 
00651       bool valid () const { return status_ != invalid ; }
00652     };
00653   }; // end of class ALUGridGeometryImplementation
00654 
00655   template <int mydim, int cdim, class GridImp>
00656   class ALU3dGridGeometry : 
00657     public GeometryDefaultImplementation<mydim, cdim, GridImp, ALU3dGridGeometry> 
00658   {
00659     static const ALU3dGridElementType elementType = GridImp::elementType;
00660 
00661     typedef typename GridImp::MPICommunicatorType Comm;
00662 
00663     friend class ALU3dGridIntersectionIterator<GridImp>;
00664 
00665     typedef typename ALU3dImplTraits< elementType, Comm >::IMPLElementType IMPLElementType;
00666     typedef typename ALU3dImplTraits< elementType, Comm >::GEOFaceType     GEOFaceType;
00667     typedef typename ALU3dImplTraits< elementType, Comm >::GEOEdgeType     GEOEdgeType;
00668     typedef typename ALU3dImplTraits< elementType, Comm >::GEOVertexType   GEOVertexType;
00669 
00670     // interface types 
00671     typedef typename ALU3dImplTraits< elementType, Comm >::HFaceType   HFaceType;
00672     typedef typename ALU3dImplTraits< elementType, Comm >::HEdgeType   HEdgeType; 
00673     typedef typename ALU3dImplTraits< elementType, Comm >::VertexType  VertexType; 
00674 
00675     typedef ElementTopologyMapping<elementType> ElementTopo;
00676     typedef FaceTopologyMapping<elementType> FaceTopo;
00677 
00678     enum { corners_      = (elementType == hexa) ? Power_m_p<2,mydim>::power : mydim+1 };
00679       
00680     // type of specialized geometry implementation 
00681     typedef typename MyALUGridGeometryImplementation<cdim> ::
00682       template GeometryImpl<0, mydim, elementType > GeometryImplType;
00683 
00684   public:
00685     typedef typename GridImp :: ctype ctype;
00686 
00688     typedef FieldVector<ctype, mydim> LocalCoordinate;
00689 
00691     typedef FieldVector<ctype, cdim > GlobalCoordinate;
00692 
00694     typedef FieldMatrix<ctype,cdim,mydim> Jacobian;
00695 
00697     typedef FieldMatrix< ctype, mydim, cdim > JacobianTransposed;
00698 
00699     // type of coordinate matrix for faces 
00700     typedef FieldMatrix<ctype, 
00701             EntityCount< elementType > :: numVerticesPerFace , 3> FaceCoordinatesType;
00702 
00705     ALU3dGridGeometry();
00706 
00709     GeometryType type () const;
00710 
00712     int corners () const;
00713   
00715     const GlobalCoordinate& operator[] (int i) const;
00716 
00718     GlobalCoordinate corner (int i) const;
00719 
00722     GlobalCoordinate global (const LocalCoordinate& local) const;
00723   
00726     LocalCoordinate local (const GlobalCoordinate& global) const;
00727 
00729     ctype integrationElement (const LocalCoordinate& local) const;
00730 
00733     const Jacobian& jacobianInverseTransposed (const LocalCoordinate& local) const;
00734 
00736     const JacobianTransposed& jacobianTransposed (const LocalCoordinate& local) const;
00737 
00739     inline bool affine () const;
00740 
00742     ctype volume () const;
00743 
00744     //***********************************************************************
00746     //***********************************************************************
00748     bool buildGeom(const IMPLElementType & item);
00749     bool buildGeom(const HFaceType & item, int twist, int faceNum);
00750     bool buildGeom(const HEdgeType & item, int twist, int);
00751     bool buildGeom(const VertexType & item, int twist, int);
00752  
00753     // this method is used by the intersection iterator 
00754     bool buildGeom(const FaceCoordinatesType& coords);
00755 
00756     // this method is used by the intersection iterator 
00757     template <class coord_t>
00758     bool buildGeom(const coord_t& p0,
00759                    const coord_t& p1,
00760                    const coord_t& p2,
00761                    const coord_t& p3);
00762 
00763     // this method is used by the intersection iterator 
00764     template <class coord_t>
00765     bool buildGeom(const coord_t& p0,
00766                    const coord_t& p1,
00767                    const coord_t& p2);
00768 
00770     template <class GeometryType>
00771     bool buildGeomInFather(const GeometryType &fatherGeom , const GeometryType & myGeom);
00772         
00775     void print (std::ostream& ss) const;
00776 
00778     void invalidate () ;
00779 
00781     bool valid () const ;
00782 
00783   private:
00784     // implementation of coord and mapping 
00785     mutable GeometryImplType geoImpl_;
00786     // volume 
00787     mutable ctype volume_;
00788   };
00789 
00790 } // end namespace Dune
00791 
00792 #include "geometry_imp.cc"
00793 
00794 #endif