Go to the documentation of this file.
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 std::remove_const< GridImp >::type
Grid;
46 subEntity_( subEntity )
56 assert( !elementInfo_ ==
false );
59 const int k = mapVertices( subEntity_, i );
77 static int mapVertices (
int subEntity,
int 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()) );
189 assert( calcedDet_ );
246 template<
class CoordReader >
247 void build (
const CoordReader &coordReader );
249 void print ( std::ostream &out )
const;
253 ctype elDeterminant ()
const
271 mutable bool builtJT_;
273 mutable bool builtJTInv_;
275 mutable bool calcedDet_;
276 mutable ctype elDet_;
284 template<
int mydim,
int cdim,
class Gr
idImp >
296 template<
class CoordReader >
298 :
Base( coordReader )
303 #if !DUNE_ALBERTA_CACHE_COORDINATES
304 template<
int dim,
int cdim >
313 static const int dimbary = dim + 1;
335 typedef FieldMatrix< ctype, numCorners, coorddimension > CoordMatrix;
343 template<
class CoordReader >
346 build( coordReader );
352 typedef typename GenericGeometry::SimplexTopology< mydimension >::type Topology;
365 assert( (i >= 0) && (i <
corners()) );
366 const Alberta::GlobalCoordinate &x = elementInfo_.coordinate( i );
377 for(
int i = 1; i < numCorners; ++i )
379 centroid_ *=
ctype( 1 ) /
ctype( numCorners );
396 return elementInfo_.geometryCache().integrationElement();
418 return elementInfo_.geometryCache().jacobianTransposed();
435 return elementInfo_.geometryCache().jacobianInverseTransposed();
456 template<
class CoordReader >
457 void build (
const CoordReader &coordReader )
459 elementInfo_ = coordReader.elementInfo();
463 ElementInfo elementInfo_;
465 #endif // #if !DUNE_ALBERTA_CACHE_COORDINATES
472 template<
class Gr
id >
482 template<
int codim >
504 buildGeometryInFather();
512 delete geometryInFather_[ child ][ 0 ];
513 delete geometryInFather_[ child ][ 1 ];
519 delete faceGeometry_[ i ][ j ];
523 void buildGeometryInFather();
524 void buildFaceGeometry();
531 assert( (orientation == 1) || (orientation == -1) );
532 return *geometryInFather_[ child ][ (orientation + 1) / 2 ];
538 assert( (face >= 0) && (face <
numFaces) );
545 static This theInstance;
550 template<
int codim >
551 static int mapVertices (
int subEntity,
int i )
562 #endif // #if HAVE_ALBERTA
564 #endif // #ifndef DUNE_ALBERTA_GEOMETRY_HH
void build(const CoordReader &coordReader)
build the geometry from a coordinate reader
Definition: geometry.cc:88
provides a wrapper for ALBERTA's el_info structure
GlobalCoordinate center() const
return center of geometry
Definition: albertagrid/geometry.hh:171
AlbertaGridGlobalGeometry()
Definition: albertagrid/geometry.hh:338
Definition: albertagrid/geometry.hh:483
AlbertaGridGeometry< dimension-codim, dimension, Grid > LocalGeometry
Definition: albertagrid/geometry.hh:485
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Definition: albertagrid/geometry.hh:127
static const int dimension
Definition: albertagrid/geometry.hh:119
Include standard header files.
Definition: agrid.hh:59
static const int mydimension
Definition: albertagrid/geometry.hh:33
AlbertaGridGlobalGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:344
GeometryType type() const
obtain the type of reference element
Definition: albertagrid/geometry.hh:148
AlbertaGridCoordinateReader(const GridImp &grid, const ElementInfo &elementInfo, int subEntity)
Definition: albertagrid/geometry.hh:41
Definition: albertagrid/geometry.hh:27
static const int dimension
Definition: albertagrid/geometry.hh:480
[ provides Dune::Grid ]
Definition: agrid.hh:137
FieldVector< ctype, mydimension > LocalCoordinate
Definition: albertagrid/geometry.hh:124
static const int numFaceTwists
Definition: albertagrid/geometry.hh:496
Alberta::ElementInfo< dimension > ElementInfo
Definition: albertagrid/geometry.hh:38
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:214
static const This & instance()
Definition: albertagrid/geometry.hh:543
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Alberta::Real ctype
type of coordinates
Definition: albertagrid/geometry.hh:117
const JacobianTransposed & jacobianTransposed() const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:416
AlbertaGridGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:142
static const int codimension
Definition: albertagrid/geometry.hh:121
ctype determinant() const
Definition: albertagrid/geometry.hh:70
static const int minFaceTwist
Definition: albertagrid/geometry.hh:494
bool affine() const
returns always true since we only have simplices
Definition: albertagrid/geometry.hh:155
AlbertaGridGlobalGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:297
Definition: albertagrid/geometry.hh:473
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:440
AlbertaGridGeometry()
Definition: albertagrid/geometry.hh:136
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:423
FieldVector< ctype, coorddimension > GlobalCoordinate
Definition: albertagrid/geometry.hh:125
const LocalElementGeometry & geometryInFather(int child, const int orientation=1) const
Definition: albertagrid/geometry.hh:528
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:522
bool hasDeterminant() const
Definition: albertagrid/geometry.hh:65
void abs(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:326
const JacobianInverseTransposed & jacobianInverseTransposed() const
transposed inverse of the geometry mapping's Jacobian
Definition: geometry.cc:71
Definition: albertagrid/geometry.hh:285
static const int coorddimension
Definition: albertagrid/geometry.hh:34
Alberta::Real ctype
type of coordinates
Definition: albertagrid/geometry.hh:319
AlbertaGridGlobalGeometry()
Definition: albertagrid/geometry.hh:292
GlobalCoordinate center() const
return center of geometry
Definition: albertagrid/geometry.hh:374
Definition: albertagrid/geometry.hh:305
Wrapper and interface classes for element geometries.
Grid abstract base class.
Definition: common/grid.hh:373
const ElementInfo & elementInfo() const
Definition: albertagrid/geometry.hh:49
GlobalCoordinate corner(const int i) const
obtain the i-th corner of this geometry
Definition: albertagrid/geometry.hh:363
static const int maxFaceTwist
Definition: albertagrid/geometry.hh:495
static const int numFaces
Definition: albertagrid/geometry.hh:492
Grid::ctype ctype
Definition: albertagrid/geometry.hh:478
Codim< 1 >::LocalGeometry LocalFaceGeometry
Definition: albertagrid/geometry.hh:489
void print(std::ostream &out) const
Definition: geometry.cc:18
geometry implementation for AlbertaGrid
Definition: albertagrid/geometry.hh:105
void build(const CoordReader &coordReader)
build the geometry from a coordinate reader
Definition: albertagrid/geometry.hh:457
int corners() const
number of corner the geometry
Definition: albertagrid/geometry.hh:158
ctype integrationElement(const LocalCoordinate &local) const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:194
FieldVector< ctype, coorddimension > Coordinate
Definition: albertagrid/geometry.hh:39
const JacobianTransposed & jacobianTransposed() const
transposed of the geometry mapping's Jacobian
Definition: geometry.cc:53
static const int dimension
Definition: albertagrid/geometry.hh:31
FieldVector< ctype, coorddimension > GlobalCoordinate
Definition: albertagrid/geometry.hh:327
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:228
static const int mydimension
Definition: albertagrid/geometry.hh:120
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Definition: albertagrid/geometry.hh:128
The dimension of the grid.
Definition: common/grid.hh:387
GlobalCoordinate corner(const int i) const
obtain the i-th corner of this geometry
Definition: albertagrid/geometry.hh:164
static const int numChildren
Definition: albertagrid/geometry.hh:491
Alberta::Real ctype
Definition: albertagrid/geometry.hh:36
GeometryType type() const
obtain the type of reference element
Definition: albertagrid/geometry.hh:350
ctype integrationElement(const LocalCoordinate &local) const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:400
ctype volume() const
volume of geometry
Definition: albertagrid/geometry.hh:406
void coordinate(int i, Coordinate &x) const
Definition: albertagrid/geometry.hh:54
Definition: geometry.cc:213
int corners() const
number of corner the geometry
Definition: albertagrid/geometry.hh:357
The dimension of the world the grid lives in.
Definition: common/grid.hh:393
ctype integrationElement() const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:187
static const int coorddimension
Definition: albertagrid/geometry.hh:122
void invalidate()
invalidate the geometry
Definition: albertagrid/geometry.hh:450
ALBERTA REAL_D GlobalVector
Definition: misc.hh:47
FieldVector< ctype, mydimension > LocalCoordinate
Definition: albertagrid/geometry.hh:326
ALBERTA REAL Real
Definition: misc.hh:45
GlobalCoordinate global(const LocalCoordinate &local) const
map a point from the refence element to the geometry
Definition: geometry.cc:32
std::remove_const< GridImp >::type Grid
Definition: albertagrid/geometry.hh:29
ctype volume() const
volume of geometry
Definition: albertagrid/geometry.hh:200
ctype integrationElement() const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:394
Definition: geometry.cc:169
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Definition: albertagrid/geometry.hh:329
Codim< 0 >::LocalGeometry LocalElementGeometry
Definition: albertagrid/geometry.hh:488
static K determinant(const FieldMatrix< K, 0, m > &matrix)
Definition: algebra.hh:28
void invalidate()
invalidate the geometry
Definition: albertagrid/geometry.hh:238
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Definition: albertagrid/geometry.hh:330
const LocalFaceGeometry & faceGeometry(int face, int twist=0) const
Definition: albertagrid/geometry.hh:536
const JacobianInverseTransposed & jacobianInverseTransposed() const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:433
static const int codimension
Definition: albertagrid/geometry.hh:32