3 #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH
4 #define DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH
15 namespace GenericGeometry
21 template<
unsigned int,
class >
24 template<
unsigned int,
class >
32 template<
unsigned int dim,
class GeometryTraits >
43 typedef typename GeometryTraits::Caching
Caching;
68 template<
unsigned int dim,
class GeometryTraits >
86 operator bool ()
const
96 template<
class X,
class Y >
97 void mv (
const X &x, Y &y )
const
99 static_cast< const FieldMatrix &
>( *this ).mv( x, y );
102 template<
class X,
class Y >
103 void mtv (
const X &x, Y &y )
const
105 static_cast< const FieldMatrix &
>( *this ).mtv( x, y );
108 template<
class X,
class Y >
109 void umv (
const X &x, Y &y )
const
111 static_cast< const FieldMatrix &
>( *this ).umv( x, y );
114 template<
class X,
class Y >
115 void umtv (
const X &x, Y &y )
const
117 static_cast< const FieldMatrix &
>( *this ).umtv( x, y );
120 template<
class X,
class Y >
121 void mmv (
const X &x, Y &y )
const
123 static_cast< const FieldMatrix &
>( *this ).mmv( x, y );
126 template<
class X,
class Y >
127 void mmtv (
const X &x, Y &y )
const
129 static_cast< const FieldMatrix &
>( *this ).mmtv( x, y );
134 if( !storage().integrationElementComputed )
143 Storage &storage ()
const {
return storage_; }
145 mutable Storage storage_;
153 template<
unsigned int dim,
class GeometryTraits >
172 operator bool ()
const
182 template<
class X,
class Y >
183 void mv (
const X &x, Y &y )
const
185 static_cast< const FieldMatrix &
>( *this ).mv( x, y );
188 template<
class X,
class Y >
189 void mtv (
const X &x, Y &y )
const
191 static_cast< const FieldMatrix &
>( *this ).mtv( x, y );
194 template<
class X,
class Y >
195 void umv (
const X &x, Y &y )
const
197 static_cast< const FieldMatrix &
>( *this ).umv( x, y );
200 template<
class X,
class Y >
201 void umtv (
const X &x, Y &y )
const
203 static_cast< const FieldMatrix &
>( *this ).umtv( x, y );
206 template<
class X,
class Y >
207 void mmv (
const X &x, Y &y )
const
209 static_cast< const FieldMatrix &
>( *this ).mmv( x, y );
212 template<
class X,
class Y >
213 void mmtv (
const X &x, Y &y )
const
215 static_cast< const FieldMatrix &
>( *this ).mmtv( x, y );
225 JacobianTransposed &jacobianTransposed () {
return jacobianTransposed_; }
226 const JacobianTransposed &jacobianTransposed ()
const {
return jacobianTransposed_; }
228 Storage &storage ()
const {
return jacobianTransposed().storage(); }
230 JacobianTransposed jacobianTransposed_;
238 template<
class Topology,
class GeometryTraits >
266 typedef typename GeometryTraits::Caching
Caching;
272 template<
class CoordVector >
279 computeJacobianTransposed( baryCenter() );
283 template<
class CoordVector >
284 explicit CachedMapping (
const std::pair< const CoordVector &, bool > &coords )
285 : mapping_( coords.first )
287 storage().
affine = coords.second;
328 MatrixHelper::template xTRightInvA< dimension, dimWorld >( JT, z, x );
337 const EvaluationType evaluateI = Caching::evaluateIntegrationElement;
338 const EvaluationType evaluateJ = Caching::evaluateJacobianInverseTransposed;
354 const EvaluationType evaluate = Caching::evaluateJacobianTransposed;
359 computeJacobianTransposed( x );
366 const EvaluationType evaluate = Caching::evaluateJacobianInverseTransposed;
371 computeJacobianInverseTransposed( x );
385 return jacobianInverseTransposed().storage();
390 return jacobianInverseTransposed().jacobianTransposed();
395 return jacobianInverseTransposed_;
405 computeJacobianTransposed( baryCenter() );
407 if( Caching::evaluateJacobianInverseTransposed ==
PreCompute )
408 computeJacobianInverseTransposed( baryCenter() );
409 else if( Caching::evaluateIntegrationElement ==
PreCompute )
419 void computeJacobianInverseTransposed (
const LocalCoordinate &x )
const
436 #endif // #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CACHED_MAPPING_HH