3#ifndef DUNE_GEOMETRY_GENERICGEOMETRY_MAPPING_HH
4#define DUNE_GEOMETRY_GENERICGEOMETRY_MAPPING_HH
6#include <dune/geometry/genericgeometry/topologytypes.hh>
8#include <dune/geometry/genericgeometry/matrixhelper.hh>
9#include <dune/geometry/genericgeometry/geometrytraits.hh>
14 namespace GenericGeometry
29 template<
class CoordTraits,
class Topo,
int dimW,
class Impl >
34 typedef Impl Implementation;
37 typedef Topo Topology;
40 static const unsigned int dimension = Traits :: dimension;
41 static const unsigned int dimWorld = Traits :: dimWorld;
43 typedef typename Traits :: FieldType FieldType;
44 typedef typename Traits :: LocalCoordinate LocalCoordinate;
45 typedef typename Traits :: GlobalCoordinate GlobalCoordinate;
46 typedef typename Traits :: JacobianType JacobianType;
47 typedef typename Traits :: JacobianTransposedType JacobianTransposedType;
49 typedef typename Traits :: MatrixHelper MatrixHelper;
51 typedef GenericGeometry :: ReferenceElement< Topology, FieldType > ReferenceElement;
53 template<
unsigned int codim,
unsigned int i >
56 typedef typename GenericGeometry :: SubTopology< Topo, codim, i > :: type Topology;
57 typedef typename Implementation :: template SubTopology< codim, i > :: Trace TraceImpl;
61 static const bool alwaysAffine = Implementation :: alwaysAffine;
67 template<
class CoordVector >
68 explicit Mapping (
const CoordVector &coords )
72 Mapping (
const Implementation &implementation )
73 : impl_( implementation )
76 const GlobalCoordinate &corner (
int i )
const
78 return implementation().corner( i );
81 void global (
const LocalCoordinate &x, GlobalCoordinate &y )
const
83 implementation().global( x, y );
86 void local (
const GlobalCoordinate &y, LocalCoordinate &x )
const
88 const FieldType epsilon = CoordTraits::epsilon();
89 x = ReferenceElement::baryCenter();
94 JacobianTransposedType JT;
95 jacobianTransposed( x, JT );
99 MatrixHelper::template xTRightInvA< dimension, dimWorld >( JT, z, dx );
101 }
while( dx.two_norm2() > epsilon*epsilon );
104 bool jacobianTransposed (
const LocalCoordinate &x,
105 JacobianTransposedType &JT )
const
107 return implementation().jacobianTransposed( x, JT );
111 jacobianInverseTransposed (
const LocalCoordinate &x, JacobianType &JTInv )
const
113 JacobianTransposedType JT;
114 jacobianTransposed( x, JT );
115 return MatrixHelper :: template rightInvA< dimension, dimWorld >( JT, JTInv );
118 FieldType integrationElement (
const LocalCoordinate &x )
const
120 JacobianTransposedType JT;
121 jacobianTransposed( x, JT );
122 return MatrixHelper :: template sqrtDetAAT< dimension, dimWorld >( JT );
125 const Implementation &implementation ()
const
130 template<
unsigned int codim,
unsigned int i >
131 typename SubTopology< codim, i > :: Trace trace ()
const
133 return impl_.template trace< codim, i >();
interface for a mapping
Definition: mapping.hh:31
Implements some reference element functionality needed by the generic geometries.
Dune namespace.
Definition: alignment.hh:14
Default mapping traits using Dune::FieldVector and Dune::FieldMatrix.
Definition: geometrytraits.hh:53