3 #ifndef DUNE_GRID_GEOMETRY_HH
4 #define DUNE_GRID_GEOMETRY_HH
12 #include <dune/common/fmatrix.hh>
13 #include <dune/common/typetraits.hh>
15 #include <dune/geometry/referenceelements.hh>
23 template<
int dim,
int dimworld,
class ct,
class Gr
idFamily >
24 class GridDefaultImplementation;
28 namespace FacadeOptions
45 template<
int mydim,
int cdim,
class Gr
idImp,
template<
int,
int,
class >
class GeometryImp >
49 static const bool v =
true;
100 template<
int mydim,
int cdim,
class Gr
idImp,
template<
int,
int,
class >
class GeometryImp >
103 #if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
109 GridImp::
dimension, GridImp::dimensionworld,
110 typename GridImp::ctype,
111 typename GridImp::GridFamily> ;
130 typedef typename GridImp::ctype
ctype;
178 return impl().corner( i );
187 return impl().global( local );
196 return impl().local( global );
224 return impl().integrationElement( local );
230 return impl().volume();
245 return impl().center();
260 return impl().jacobianTransposed( local );
285 return impl().jacobianInverseTransposed(local);
292 deprecationWarning ( integral_constant< bool, storeReference >() );
299 void DUNE_DEPRECATED_MSG(
"This Dune::Geometry is still a reference to its implementation." )
300 deprecationWarning ( integral_constant<
bool, true > ) {}
303 deprecationWarning ( integral_constant< bool, false > ) {}
308 typename conditional< storeReference, const Implementation &, Implementation >::type
realGeometry;
320 template<
int mydim,
int cdim,
class Gr
idImp,
template<
int,
int,
class>
class GeometryImp>
328 typedef typename GridImp::ctype
ctype;
345 const ReferenceElement< ctype , mydim > & refElement =
346 ReferenceElements< ctype, mydim >::general(type);
350 const int corners = refElement.size(0,0,mydim);
351 for(
int i=0; i<corners; ++i) localBaryCenter += refElement.position(i,mydim);
352 localBaryCenter *= (
ctype) (1.0/corners);
355 return refElement.volume() * asImp().integrationElement(localBaryCenter);
364 const ReferenceElement< ctype , mydim > & refElement =
365 ReferenceElements< ctype, mydim >::general(type);
369 return asImp().global(refElement.position(0,0));
374 GeometryImp<mydim,cdim,GridImp>& asImp () {
return static_cast<GeometryImp<mydim,cdim,GridImp>&
>(*this);}
375 const GeometryImp<mydim,cdim,GridImp>& asImp ()
const {
return static_cast<const GeometryImp<mydim,cdim,GridImp>&
>(*this);}
378 template<
int cdim,
class Gr
idImp,
template<
int,
int,
class>
class GeometryImp>
389 typedef typename GridImp::ctype
ctype;
401 FieldVector<ctype, cdim> global (
const FieldVector<ctype, mydim>& local)
const
403 return asImp().corner(0);
407 FieldVector<ctype, mydim> local (
const FieldVector<ctype, cdim>& )
const
409 return FieldVector<ctype, mydim>();
413 bool checkInside (
const FieldVector<ctype, mydim>& )
const
427 return asImp().corner(0);
432 GeometryImp<mydim,cdim,GridImp>& asImp () {
return static_cast<GeometryImp<mydim,cdim,GridImp>&
>(*this);}
433 const GeometryImp<mydim,cdim,GridImp>& asImp ()
const {
return static_cast<const GeometryImp<mydim,cdim,GridImp>&
>(*this);}
438 #endif // DUNE_GRID_GEOMETRY_HH