3 #ifndef DUNE_ALU3DGRIDGEOMETRY_HH
4 #define DUNE_ALU3DGRIDGEOMETRY_HH
9 #include <dune/common/power.hh>
22 template<
int cd,
int dim,
class Gr
idImp>
23 class ALU3dGridEntity;
24 template<
int cd,
class Gr
idImp >
25 class ALU3dGridEntityPointer;
26 template<
int mydim,
int coorddim,
class Gr
idImp>
27 class ALU3dGridGeometry;
28 template< ALU3dGr
idElementType,
class >
30 class BilinearSurfaceMapping;
31 class TrilinearMapping;
33 template<
class Gr
idImp >
34 class ALU3dGridIntersectionIterator;
46 template <
int dim,
int corners,
class Mapping>
60 template <
int dummy,
int dimused>
123 template <
class CoordPtrType>
124 static inline void copy(
const CoordPtrType& p,
133 template <
class CoordPtrType>
141 const CoordPtrType& )
const
143 DUNE_THROW(InvalidStateException,
"This method should not be called!");
146 template <
class CoordPtrType>
150 const CoordPtrType& )
const
152 DUNE_THROW(InvalidStateException,
"This method should not be called!");
155 template <
class CoordPtrType>
158 const CoordPtrType& )
const
160 DUNE_THROW(InvalidStateException,
"This method should not be called!");
177 template <
int dummy,
int dim,
181 template <
int dummy,
int dim, ALU3dGr
idElementType eltype>
216 template <
class CoordPtrType>
217 inline void update(
const CoordPtrType& p0)
227 template <
int dummy, ALU3dGr
idElementType eltype>
264 template <
class CoordPtrType>
265 inline void update(
const CoordPtrType& p0,
266 const CoordPtrType& p1)
303 template <
class CoordPtrType>
304 inline void update(
const CoordPtrType& p0,
305 const CoordPtrType& p1,
306 const CoordPtrType& p2)
360 template <
class CoordPtrType>
361 inline void update(
const CoordPtrType& p0,
362 const CoordPtrType& p1,
363 const CoordPtrType& p2,
364 const CoordPtrType& p3)
428 assert( coordPtr_[i] );
429 return coordPtr_[ i ];
436 copy( point( i ), coord );
441 inline void update(
const CoordPtrType& p0,
442 const CoordPtrType& p1,
443 const CoordPtrType& p2,
444 const CoordPtrType& p3,
445 const CoordPtrType& p4,
446 const CoordPtrType& p5,
447 const CoordPtrType& p6,
448 const CoordPtrType& p7)
450 coordPtr_[0] = &p0[ 0 ];
451 coordPtr_[1] = &p1[ 0 ];
452 coordPtr_[2] = &p2[ 0 ];
453 coordPtr_[3] = &p3[ 0 ];
454 coordPtr_[4] = &p4[ 0 ];
455 coordPtr_[5] = &p5[ 0 ];
456 coordPtr_[6] = &p6[ 0 ];
457 coordPtr_[7] = &p7[ 0 ];
462 template <
class GeometryImp>
463 inline void updateInFather(
const GeometryImp &fatherGeom ,
464 const GeometryImp &myGeom)
471 CoordinateMatrixType& coord = *
coord_;
473 for(
int i=0; i < myGeom.corners() ; ++i)
476 coord[i] = fatherGeom.local( myGeom.corner( i ) );
479 coordPtr_[i] = (&(coord[i][0]));
482 for(
int j=0; j<cdim; ++j)
484 if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
498 point( 4 ), point( 5 ), point( 6 ), point( 7 ) );
555 assert( coordPtr_[ i ] );
556 return coordPtr_[ i ];
563 copy( point( i ), coord );
568 inline void update(
const CoordPtrType& p0,
569 const CoordPtrType& p1,
570 const CoordPtrType& p2,
571 const CoordPtrType& p3)
573 coordPtr_[0] = &p0[ 0 ];
574 coordPtr_[1] = &p1[ 0 ];
575 coordPtr_[2] = &p2[ 0 ];
576 coordPtr_[3] = &p3[ 0 ];
581 template <
class GeometryImp>
582 inline void updateInFather(
const GeometryImp &fatherGeom ,
583 const GeometryImp & myGeom)
590 CoordinateMatrixType& coord = *
coord_;
592 for(
int i=0; i < myGeom.corners() ; ++i)
595 coord[i] = fatherGeom.local( myGeom.corner( i ) );
598 coordPtr_[i] = (&(coord[i][0]));
601 for(
int j=0; j<cdim; ++j)
603 if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
624 template <
int mydim,
int cdim,
class Gr
idImp>
630 typedef typename GridImp::MPICommunicatorType Comm;
634 typedef typename ALU3dImplTraits< elementType, Comm >::IMPLElementType IMPLElementType;
635 typedef typename ALU3dImplTraits< elementType, Comm >::GEOFaceType GEOFaceType;
636 typedef typename ALU3dImplTraits< elementType, Comm >::GEOEdgeType GEOEdgeType;
637 typedef typename ALU3dImplTraits< elementType, Comm >::GEOVertexType GEOVertexType;
640 typedef typename ALU3dImplTraits< elementType, Comm >::HFaceType HFaceType;
641 typedef typename ALU3dImplTraits< elementType, Comm >::HEdgeType HEdgeType;
642 typedef typename ALU3dImplTraits< elementType, Comm >::VertexType VertexType;
647 enum { corners_ = (elementType ==
hexa) ? StaticPower<2,mydim>::power : mydim+1 };
651 template GeometryImpl<0, mydim, elementType > GeometryImplType;
654 typedef typename GridImp :: ctype
ctype;
669 typedef FieldMatrix<
ctype,
693 GlobalCoordinate
corner (
int i)
const;
697 GlobalCoordinate
global (
const LocalCoordinate&
local)
const;
701 LocalCoordinate
local (
const GlobalCoordinate&
global)
const;
714 inline bool affine ()
const;
723 bool buildGeom(
const IMPLElementType & item);
724 bool buildGeom(
const HFaceType & item,
int twist,
int faceNum);
725 bool buildGeom(
const HEdgeType & item,
int twist,
int);
726 bool buildGeom(
const VertexType & item,
int twist,
int);
729 bool buildGeom(
const FaceCoordinatesType& coords);
732 template <
class coord_t>
739 template <
class coord_t>
745 template <
class GeometryType>
750 void print (std::ostream& ss)
const;
756 bool valid ()
const ;
772 #ifdef USE_SMP_PARALLEL
774 static std::vector< GeometryProviderType > storage( GridObjectFactoryType :: maxThreads() );
775 return storage[ GridObjectFactoryType :: threadNumber () ];
777 static GeometryProviderType storage;
793 namespace FacadeOptions
796 template<
int mydim,
int cdim,
class Gr
idImp >
800 static const bool v =
false;
806 #include "geometry_imp.cc"