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 )
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 )
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
Definition: albertagrid/geometry.hh:295
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Definition: albertagrid/geometry.hh:340
Alberta::Real ctype
Definition: albertagrid/geometry.hh:36
const JacobianTransposed & jacobianTransposed() const
transposed of the geometry mapping's Jacobian
Definition: geometry.cc:53
Codim< 0 >::LocalGeometry LocalElementGeometry
Definition: albertagrid/geometry.hh:507
AlbertaGridCoordinateReader(const GridImp &grid, const ElementInfo &elementInfo, int subEntity)
Definition: albertagrid/geometry.hh:41
GeometryType type() const
obtain the type of reference element
Definition: albertagrid/geometry.hh:148
Alberta::Real ctype
type of coordinates
Definition: albertagrid/geometry.hh:117
int corners() const
number of corner the geometry
Definition: albertagrid/geometry.hh:367
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Definition: albertagrid/geometry.hh:339
Definition: albertagrid/geometry.hh:27
GeometryType type() const
obtain the type of reference element
Definition: albertagrid/geometry.hh:360
const JacobianInverseTransposed & jacobianInverseTransposed() const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:452
static const int coorddimension
Definition: albertagrid/geometry.hh:122
static const int dimension
Definition: albertagrid/geometry.hh:31
GlobalCoordinate corner(const int i) const
obtain the i-th corner of this geometry
Definition: albertagrid/geometry.hh:373
AlbertaGridGeometry< dimension-codim, dimension, Grid > LocalGeometry
Definition: albertagrid/geometry.hh:504
ctype integrationElement(const LocalCoordinate &local) const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:204
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
static const int maxFaceTwist
Definition: albertagrid/geometry.hh:514
ctype volume() const
volume of geometry
Definition: albertagrid/geometry.hh:425
static const int mydimension
Definition: albertagrid/geometry.hh:33
static K determinant(const FieldMatrix< K, 0, m > &matrix)
Definition: algebra.hh:28
Definition: geometry.cc:213
AlbertaGridGlobalGeometry()
Definition: albertagrid/geometry.hh:348
const GlobalCoordinate & operator[](const int i) const
deprecated way of obtaining the i-th corner
Definition: albertagrid/geometry.hh:179
AlbertaGridGlobalGeometry()
Definition: albertagrid/geometry.hh:302
geometry implementation for AlbertaGrid
Definition: albertagrid/geometry.hh:105
FieldVector< ctype, coorddimension > GlobalCoordinate
Definition: albertagrid/geometry.hh:125
AlbertaGridGlobalGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:354
const JacobianInverseTransposed & jacobianInverseTransposed() const
transposed inverse of the geometry mapping's Jacobian
Definition: geometry.cc:71
static const int coorddimension
Definition: albertagrid/geometry.hh:34
GlobalCoordinate corner(const int i) const
obtain the i-th corner of this geometry
Definition: albertagrid/geometry.hh:164
remove_const< GridImp >::type Grid
Definition: albertagrid/geometry.hh:29
static const int numChildren
Definition: albertagrid/geometry.hh:510
ALBERTA REAL_D GlobalVector
Definition: misc.hh:47
GlobalCoordinate global(const LocalCoordinate &local) const
map a point from the refence element to the geometry
Definition: geometry.cc:32
Traits class determining whether the Dune::Geometry facade class stores the implementation object by ...
Definition: common/geometry.hh:46
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:238
The dimension of the world the grid lives in.
Definition: common/grid.hh:406
AlbertaGridGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:142
void invalidate()
invalidate the geometry
Definition: albertagrid/geometry.hh:248
GlobalCoordinate center() const
return center of geometry
Definition: albertagrid/geometry.hh:393
static const This & instance()
Definition: albertagrid/geometry.hh:562
Definition: albertagrid/geometry.hh:492
static const int dimension
Definition: albertagrid/geometry.hh:499
The dimension of the grid.
Definition: common/grid.hh:400
[ provides Dune::Grid ]
Definition: agrid.hh:137
Definition: geometry.cc:169
provides a wrapper for ALBERTA's el_info structure
ctype volume() const
volume of geometry
Definition: albertagrid/geometry.hh:210
static const bool v
Whether to store by reference.
Definition: common/geometry.hh:49
ctype integrationElement() const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:413
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:386
Codim< 1 >::LocalGeometry LocalFaceGeometry
Definition: albertagrid/geometry.hh:508
Wrapper and interface classes for element geometries.
void build(const CoordReader &coordReader)
build the geometry from a coordinate reader
Definition: geometry.cc:88
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:442
static const int numFaceTwists
Definition: albertagrid/geometry.hh:515
const LocalFaceGeometry & faceGeometry(int face, int twist=0) const
Definition: albertagrid/geometry.hh:555
AlbertaGridGeometry()
Definition: albertagrid/geometry.hh:136
Definition: albertagrid/geometry.hh:315
void print(std::ostream &out) const
Definition: geometry.cc:18
GlobalCoordinate center() const
return center of geometry
Definition: albertagrid/geometry.hh:171
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
transposed inverse of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:459
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:546
ctype integrationElement() const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:197
Alberta::ElementInfo< dimension > ElementInfo
Definition: albertagrid/geometry.hh:38
LocalCoordinate local(const GlobalCoordinate &global) const
map a point from the geometry to the reference element
Definition: geometry.cc:43
AlbertaGridGlobalGeometry(const CoordReader &coordReader)
Definition: albertagrid/geometry.hh:307
static const int codimension
Definition: albertagrid/geometry.hh:121
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Definition: albertagrid/geometry.hh:127
const JacobianTransposed & jacobianTransposed() const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:435
Alberta::Real ctype
type of coordinates
Definition: albertagrid/geometry.hh:329
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
transposed of the geometry mapping's Jacobian
Definition: albertagrid/geometry.hh:224
ctype determinant() const
Definition: albertagrid/geometry.hh:70
Grid::ctype ctype
Definition: albertagrid/geometry.hh:497
ctype integrationElement(const LocalCoordinate &local) const
integration element of the geometry mapping
Definition: albertagrid/geometry.hh:419
FieldVector< ctype, coorddimension > Coordinate
Definition: albertagrid/geometry.hh:39
const LocalElementGeometry & geometryInFather(int child, const int orientation=1) const
Definition: albertagrid/geometry.hh:547
bool affine() const
returns always true since we only have simplices
Definition: albertagrid/geometry.hh:155
static const int dimension
Definition: albertagrid/geometry.hh:119
FieldVector< ctype, mydimension > LocalCoordinate
Definition: albertagrid/geometry.hh:124
ALBERTA REAL Real
Definition: misc.hh:45
bool hasDeterminant() const
Definition: albertagrid/geometry.hh:65
static const int mydimension
Definition: albertagrid/geometry.hh:120
void build(const CoordReader &coordReader)
build the geometry from a coordinate reader
Definition: albertagrid/geometry.hh:476
const ElementInfo & elementInfo() const
Definition: albertagrid/geometry.hh:49
FieldVector< ctype, mydimension > LocalCoordinate
Definition: albertagrid/geometry.hh:336
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Definition: albertagrid/geometry.hh:128
static const int minFaceTwist
Definition: albertagrid/geometry.hh:513
static const int codimension
Definition: albertagrid/geometry.hh:32
FieldVector< ctype, coorddimension > GlobalCoordinate
Definition: albertagrid/geometry.hh:337
void invalidate()
invalidate the geometry
Definition: albertagrid/geometry.hh:469
int corners() const
number of corner the geometry
Definition: albertagrid/geometry.hh:158
void coordinate(int i, Coordinate &x) const
Definition: albertagrid/geometry.hh:54
void abs(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:332
static const int numFaces
Definition: albertagrid/geometry.hh:511
Definition: albertagrid/geometry.hh:502