1 #ifndef DUNE_GRID_GEOMETRY_HH
2 #define DUNE_GRID_GEOMETRY_HH
10 #include <dune/common/fmatrix.hh>
11 #include <dune/common/exceptions.hh>
12 #include <dune/common/typetraits.hh>
14 #include <dune/geometry/referenceelements.hh>
15 #include <dune/geometry/genericgeometry/conversion.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> ;
134 typedef typename GridImp::ctype
ctype;
180 return impl().corner( i );
189 return impl().global( local );
198 return impl().local( global );
226 return impl().integrationElement( local );
232 return impl().volume();
247 return impl().center();
262 return impl().jacobianTransposed( local );
286 return impl().jacobianInverseTransposed(local);
293 deprecationWarning ( integral_constant< bool, storeReference >() );
300 void DUNE_DEPRECATED_MSG(
"This Dune::Geometry is still a reference to its implementation." )
301 deprecationWarning ( integral_constant<
bool, true > ) {}
304 deprecationWarning ( integral_constant< bool, false > ) {}
309 typename SelectType< storeReference, const Implementation &, Implementation >::Type
realGeometry;
321 template<
int mydim,
int cdim,
class Gr
idImp,
template<
int,
int,
class>
class GeometryImp>
329 typedef typename GridImp::ctype
ctype;
346 const GenericReferenceElement< ctype , mydim > & refElement =
347 GenericReferenceElements< ctype, mydim >::general(type);
351 const int corners = refElement.size(0,0,mydim);
352 for(
int i=0; i<corners; ++i) localBaryCenter += refElement.position(i,mydim);
353 localBaryCenter *= (
ctype) (1.0/corners);
356 return refElement.volume() * asImp().integrationElement(localBaryCenter);
365 const GenericReferenceElement< ctype , mydim > & refElement =
366 GenericReferenceElements< ctype, mydim >::general(type);
370 return asImp().global(refElement.position(0,0));
375 GeometryImp<mydim,cdim,GridImp>& asImp () {
return static_cast<GeometryImp<mydim,cdim,GridImp>&
>(*this);}
376 const GeometryImp<mydim,cdim,GridImp>& asImp ()
const {
return static_cast<const GeometryImp<mydim,cdim,GridImp>&
>(*this);}
379 template<
int cdim,
class Gr
idImp,
template<
int,
int,
class>
class GeometryImp>
390 typedef typename GridImp::ctype
ctype;
402 FieldVector<ctype, cdim> global (
const FieldVector<ctype, mydim>& local)
const
404 return asImp().corner(0);
408 FieldVector<ctype, mydim> local (
const FieldVector<ctype, cdim>& )
const
410 return FieldVector<ctype, mydim>();
414 bool checkInside (
const FieldVector<ctype, mydim>& )
const
428 return asImp().corner(0);
433 GeometryImp<mydim,cdim,GridImp>& asImp () {
return static_cast<GeometryImp<mydim,cdim,GridImp>&
>(*this);}
434 const GeometryImp<mydim,cdim,GridImp>& asImp ()
const {
return static_cast<const GeometryImp<mydim,cdim,GridImp>&
>(*this);}
439 #endif // DUNE_GRID_GEOMETRY_HH