3 #ifndef DUNE_ALBERTA_GEOMETRY_HH
4 #define DUNE_ALBERTA_GEOMETRY_HH
18 template<
int dim,
int dimworld >
26 template<
int codim,
class Gr
idImp >
29 typedef typename remove_const< GridImp >::type
Grid;
45 elementInfo_( elementInfo ),
46 subEntity_( subEntity )
56 assert( !elementInfo_ ==
false );
59 const int k = mapVertices( subEntity_, i );
77 static int mapVertices (
int subEntity,
int i )
79 return Alberta::MapVertices< dimension, codimension >::apply( subEntity, i );
104 template<
int mydim,
int cdim,
class Gr
idImp >
110 typedef GridImp Grid;
113 static const int dimbary = mydim + 1;
133 typedef FieldMatrix< ctype, numCorners, coorddimension > CoordMatrix;
141 template<
class CoordReader >
144 build( coordReader );
150 typedef typename GenericGeometry::SimplexTopology< mydimension >::type Topology;
166 assert( (i >= 0) && (i <
corners()) );
180 DUNE_DEPRECATED_MSG(
"Use corner( int i) instead.")
182 assert( (i >= 0) && (i <
corners()) );
199 assert( calcedDet_ );
256 template<
class CoordReader >
257 void build (
const CoordReader &coordReader );
259 void print ( std::ostream &out )
const;
263 ctype elDeterminant ()
const
281 mutable bool builtJT_;
283 mutable bool builtJTInv_;
285 mutable bool calcedDet_;
286 mutable ctype elDet_;
294 template<
int mydim,
int cdim,
class Gr
idImp >
306 template<
class CoordReader >
308 :
Base( coordReader )
313 #if !DUNE_ALBERTA_CACHE_COORDINATES
314 template<
int dim,
int cdim >
323 static const int dimbary = dim + 1;
345 typedef FieldMatrix< ctype, numCorners, coorddimension > CoordMatrix;
353 template<
class CoordReader >
356 build( coordReader );
362 typedef typename GenericGeometry::SimplexTopology< mydimension >::type Topology;
375 assert( (i >= 0) && (i <
corners()) );
376 const Alberta::GlobalCoordinate &x = elementInfo_.coordinate( i );
387 DUNE_DEPRECATED_MSG(
"Use corner( int i) instead.")
389 return reinterpret_cast< const GlobalCoordinate &
>( elementInfo_.coordinate( i ) );
396 for(
int i = 1; i < numCorners; ++i )
398 centroid_ *=
ctype( 1 ) /
ctype( numCorners );
415 return elementInfo_.geometryCache().integrationElement();
437 return elementInfo_.geometryCache().jacobianTransposed();
454 return elementInfo_.geometryCache().jacobianInverseTransposed();
475 template<
class CoordReader >
476 void build (
const CoordReader &coordReader )
478 elementInfo_ = coordReader.elementInfo();
482 ElementInfo elementInfo_;
484 #endif // #if !DUNE_ALBERTA_CACHE_COORDINATES
491 template<
class Gr
id >
501 template<
int codim >
523 buildGeometryInFather();
531 delete geometryInFather_[ child ][ 0 ];
532 delete geometryInFather_[ child ][ 1 ];
538 delete faceGeometry_[ i ][ j ];
542 void buildGeometryInFather();
543 void buildFaceGeometry();
549 assert( (child >= 0) && (child < numChildren) );
550 assert( (orientation == 1) || (orientation == -1) );
551 return *geometryInFather_[ child ][ (orientation + 1) / 2 ];
557 assert( (face >= 0) && (face < numFaces) );
564 static This theInstance;
569 template<
int codim >
570 static int mapVertices (
int subEntity,
int i )
572 return Alberta::MapVertices< dimension, codim >::apply( subEntity, i );
584 namespace FacadeOptions
587 template<
int mydim,
int cdim,
class Gr
id >
590 static const bool v =
false;
597 #endif // #if HAVE_ALBERTA
599 #endif // #ifndef DUNE_ALBERTA_GEOMETRY_HH