3#ifndef DUNE_ALU3DGRIDMAPPINGS_HH
4#define DUNE_ALU3DGRIDMAPPINGS_HH
16#include "alu3dinclude.hh"
20 static const alu3d_ctype ALUnumericEpsilon = 10.0 * std::numeric_limits< alu3d_ctype >::epsilon();
22 template<
int mydim,
int coorddim,
class Gr
idImp>
23 class ALU3dGridGeometry;
25 template< ALU3dGr
idElementType,
class >
33 typedef alu3d_ctype double_t[3];
37 static const double _epsilon ;
40 alu3d_ctype a [8][3] ;
51 void linear (
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype) ;
66 alu3d_ctype det (
const coord_t&) ;
70 void map2world (
const alu3d_ctype ,
const alu3d_ctype ,
const alu3d_ctype ,
74 template <
class vector_t>
75 void buildMapping(
const vector_t&,
const vector_t&,
76 const vector_t&,
const vector_t&,
77 const vector_t&,
const vector_t&,
78 const vector_t&,
const vector_t&);
81 inline bool affine ()
const {
return affine_; }
97 typedef alu3d_ctype double3_t[3];
100 alu3d_ctype _n [3][3] ;
102 static const double _epsilon ;
114 inline bool affine ()
const {
return _affine ; }
117 void normal(
const coord2_t&, coord3_t&)
const ;
118 void normal(
const alu3d_ctype,
const alu3d_ctype, coord3_t&)
const;
120 void negativeNormal(
const coord2_t&, coord3_t&)
const ;
121 void negativeNormal(
const alu3d_ctype,
const alu3d_ctype, coord3_t&)
const;
126 template <
class vector_t>
127 void buildMapping (
const vector_t & ,
const vector_t & ,
128 const vector_t & ,
const vector_t & );
132 template <
class vector_t>
133 void buildMapping (
const vector_t & ,
const vector_t & ,
134 const vector_t & ,
const vector_t & ,
135 alu3d_ctype (&_b)[4][3] );
150 static const double _epsilon;
157 typedef alu3d_ctype double3_t[3];
168 alu3d_ctype _b [4][3] ;
171 mutable inv_t invTransposed_;
173 mutable alu3d_ctype DetDf;
178 mutable bool _calcedInv;
179 mutable bool _calcedTransposed;
180 mutable bool _calcedMatrix;
191 const double3_t &,
const double3_t &) ;
195 void inverse (
const coord3_t&)
const;
196 const inv_t& jacobianInverseTransposed(
const coord2_t&)
const ;
198 const matrix_t& jacobianTransposed(
const coord2_t&)
const ;
201 alu3d_ctype det(
const coord2_t&)
const;
204 void world2map(
const coord3_t &, coord2_t & )
const;
208 void map2world(
const coord2_t&, coord3_t&)
const ;
209 void map2world(
const alu3d_ctype ,
const alu3d_ctype , coord3_t&)
const ;
212 void map2worldnormal(
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype , coord3_t&)
const;
213 void map2worldlinear(
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype )
const;
218 template <
class vector_t>
219 void buildMapping (
const vector_t & ,
const vector_t & ,
220 const vector_t & ,
const vector_t & );
230 typedef alu3d_ctype ctype;
243 mutable inv_t invTransposed_;
245 mutable bool affine_;
246 mutable bool calcedMatrix_;
247 mutable bool calcedDet_;
248 mutable bool calcedInv_;
254 BilinearMapping (
const ctype (&p0)[ cdim ],
const ctype (&p1)[ cdim ],
255 const ctype (&p2)[ cdim ],
const ctype (&p3)[ cdim ] );
257 bool affine ()
const;
260 void map2world (
const ctype x,
const ctype y,
world_t &w )
const;
263 ctype det (
const map_t & )
const;
266 const inv_t &jacobianInverseTransposed (
const map_t & )
const;
268 template<
class vector_t >
269 void buildMapping (
const vector_t &,
const vector_t &,
270 const vector_t &,
const vector_t & );
276 void map2worldlinear (
const ctype,
const ctype )
const;
277 void inverse (
const map_t & )
const;
283 template<
int cdim,
int mydim >
287 typedef alu3d_ctype ctype;
289 typedef ctype double_t[ cdim ];
319 inline bool affine ()
const {
return true ; }
322 const matrix_t& jacobianTransposed(
const map_t &)
const ;
325 const inv_t& jacobianInverseTransposed(
const map_t &)
const ;
328 ctype det(
const map_t&)
const;
331 void world2map(
const world_t &, map_t &)
const;
335 void map2world(
const map_t &, world_t &)
const ;
339 void inverse (
const map_t&)
const;
342 void inverseCodimOne (
const map_t&)
const;
345 void calculateDeterminant (
const map_t&)
const;
347 void multTransposedMatrix(
const matrix_t& matrix,
350 void multMatrix (
const matrix_t& A,
357 template <
class vector_t>
358 void buildMapping (
const vector_t & ,
const vector_t & ,
359 const vector_t & ,
const vector_t & );
363 template <
class vector_t>
364 void buildMapping (
const vector_t & ,
const vector_t & ,
369 template <
class vector_t>
370 void buildMapping (
const vector_t & ,
const vector_t & );
372 template <
class vector_t>
373 void buildMapping (
const vector_t & );
386 template< ALU3dGr
idElementType type,
class Comm >
390 template<
class Comm >
395 typedef typename ALU3dImplTraits< tetra, Comm >::HfaceRuleType RefinementRuleType;
398 : rule_( rule ), nChild_( nChild )
418 RefinementRuleType rule_;
423 template<
class Comm >
428 typedef typename ALU3dImplTraits< hexa, Comm >::HfaceRuleType RefinementRuleType;
431 : rule_( rule ), nChild_( nChild )
445 RefinementRuleType rule_;
451#if COMPILE_ALUGRID_INLINE
452 #include "mappings_imp.cc"
A bilinear mapping.
Definition: mappings.hh:228
A bilinear surface mapping.
Definition: mappings.hh:145
BilinearSurfaceMapping(const coord3_t &, const coord3_t &, const coord3_t &, const coord3_t &)
Constructor getting FieldVectors.
BilinearSurfaceMapping()
Constructor creating empty mapping with double , i.e. zero.
BilinearSurfaceMapping(const double3_t &, const double3_t &, const double3_t &, const double3_t &)
Constructor for double[3].
A linear mapping.
Definition: mappings.hh:285
inv_t _invTransposed
storage for inverse of jacobian (transposed)
Definition: mappings.hh:299
LinearMapping(const LinearMapping &)
copy constructor
LinearMapping()
Constructor creating empty mapping with double , i.e. zero.
bool _calcedInv
true if inverse has been calculated
Definition: mappings.hh:306
bool _calcedDet
true if determinant has been calculated
Definition: mappings.hh:309
matrix_t _matrix
transformation matrix (transposed)
Definition: mappings.hh:298
ctype _det
P[0].
Definition: mappings.hh:303
A bilinear surface mapping.
Definition: mappings.hh:90
SurfaceNormalCalculator()
Constructor creating empty mapping with double , i.e. zero.
Definition: mappings.hh:31
A few common exception classes.
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignment.hh:10