1 #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH
2 #define DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH
14 namespace GenericGeometry
20 template<
unsigned int,
class >
23 template<
unsigned int,
class >
31 template<
unsigned int dim,
class GeometryTraits >
42 typedef typename GeometryTraits::Caching
Caching;
67 template<
unsigned int dim,
class GeometryTraits >
85 operator bool ()
const
95 template<
class X,
class Y >
96 void mv (
const X &x, Y &y )
const
98 static_cast< const FieldMatrix &
>( *this ).mv( x, y );
101 template<
class X,
class Y >
102 void mtv (
const X &x, Y &y )
const
104 static_cast< const FieldMatrix &
>( *this ).mtv( x, y );
107 template<
class X,
class Y >
108 void umv (
const X &x, Y &y )
const
110 static_cast< const FieldMatrix &
>( *this ).umv( x, y );
113 template<
class X,
class Y >
114 void umtv (
const X &x, Y &y )
const
116 static_cast< const FieldMatrix &
>( *this ).umtv( x, y );
119 template<
class X,
class Y >
120 void mmv (
const X &x, Y &y )
const
122 static_cast< const FieldMatrix &
>( *this ).mmv( x, y );
125 template<
class X,
class Y >
126 void mmtv (
const X &x, Y &y )
const
128 static_cast< const FieldMatrix &
>( *this ).mmtv( x, y );
133 if( !storage().integrationElementComputed )
142 Storage &storage ()
const {
return storage_; }
144 mutable Storage storage_;
152 template<
unsigned int dim,
class GeometryTraits >
171 operator bool ()
const
181 template<
class X,
class Y >
182 void mv (
const X &x, Y &y )
const
184 static_cast< const FieldMatrix &
>( *this ).mv( x, y );
187 template<
class X,
class Y >
188 void mtv (
const X &x, Y &y )
const
190 static_cast< const FieldMatrix &
>( *this ).mtv( x, y );
193 template<
class X,
class Y >
194 void umv (
const X &x, Y &y )
const
196 static_cast< const FieldMatrix &
>( *this ).umv( x, y );
199 template<
class X,
class Y >
200 void umtv (
const X &x, Y &y )
const
202 static_cast< const FieldMatrix &
>( *this ).umtv( x, y );
205 template<
class X,
class Y >
206 void mmv (
const X &x, Y &y )
const
208 static_cast< const FieldMatrix &
>( *this ).mmv( x, y );
211 template<
class X,
class Y >
212 void mmtv (
const X &x, Y &y )
const
214 static_cast< const FieldMatrix &
>( *this ).mmtv( x, y );
224 JacobianTransposed &jacobianTransposed () {
return jacobianTransposed_; }
225 const JacobianTransposed &jacobianTransposed ()
const {
return jacobianTransposed_; }
227 Storage &storage ()
const {
return jacobianTransposed().storage(); }
229 JacobianTransposed jacobianTransposed_;
237 template<
class Topology,
class GeometryTraits >
266 template<
unsigned int codim >
273 typedef typename GeometryTraits::Caching
Caching;
279 template<
class CoordVector >
286 computeJacobianTransposed( baryCenter() );
290 template<
class CoordVector >
291 explicit CachedMapping (
const std::pair< const CoordVector &, bool > &coords )
292 : mapping_( coords.first )
294 storage().
affine = coords.second;
339 MatrixHelper::template xTRightInvA< dimension, dimWorld >( JT, z, x );
348 const EvaluationType evaluateI = Caching::evaluateIntegrationElement;
349 const EvaluationType evaluateJ = Caching::evaluateJacobianInverseTransposed;
365 const EvaluationType evaluate = Caching::evaluateJacobianTransposed;
370 computeJacobianTransposed( x );
377 const EvaluationType evaluate = Caching::evaluateJacobianInverseTransposed;
382 computeJacobianInverseTransposed( x );
389 return new This( *
this );
392 This* clone (
char *mappingStorage )
const
394 return new( mappingStorage ) This( *
this );
397 template<
unsigned int codim,
bool hybr
id >
398 typename TraceProvider< Topology, GeometryTraits, codim, hybrid >::Trace*
399 trace (
unsigned int i,
char *mappingStorage )
const
401 return TraceProvider< Topology, GeometryTraits, codim, hybrid >::construct(
mapping(), i, mappingStorage );
410 return ReferenceElement::template baryCenter< 0 >( 0 );
415 return jacobianInverseTransposed().storage();
420 return jacobianInverseTransposed().jacobianTransposed();
425 return jacobianInverseTransposed_;
435 computeJacobianTransposed( baryCenter() );
437 if( Caching::evaluateJacobianInverseTransposed ==
PreCompute )
438 computeJacobianInverseTransposed( baryCenter() );
439 else if( Caching::evaluateIntegrationElement ==
PreCompute )
449 void computeJacobianInverseTransposed (
const LocalCoordinate &x )
const
466 #endif // #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH