1#ifndef DUNE_ALU3DGRIDMAPPINGS_HH
2#define DUNE_ALU3DGRIDMAPPINGS_HH
14#include "alu3dinclude.hh"
18 static const alu3d_ctype ALUnumericEpsilon = 10.0 * std::numeric_limits< alu3d_ctype >::epsilon();
20 template<
int mydim,
int coorddim,
class Gr
idImp>
21 class ALU3dGridGeometry;
23 template<
int dim,
int dimworld, ALU3dGr
idElementType,
class >
31 typedef alu3d_ctype double_t[3];
35 static const double _epsilon ;
38 alu3d_ctype a [8][3] ;
49 void linear (
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype) ;
64 alu3d_ctype det (
const coord_t&) ;
68 void map2world (
const alu3d_ctype ,
const alu3d_ctype ,
const alu3d_ctype ,
72 template <
class vector_t>
73 void buildMapping(
const vector_t&,
const vector_t&,
74 const vector_t&,
const vector_t&,
75 const vector_t&,
const vector_t&,
76 const vector_t&,
const vector_t&);
79 inline bool affine ()
const {
return affine_; }
95 typedef alu3d_ctype double3_t[3];
98 alu3d_ctype _n [3][3] ;
100 static const double _epsilon ;
112 inline bool affine ()
const {
return _affine ; }
116 void normal(
const alu3d_ctype,
const alu3d_ctype,
coord3_t&)
const;
119 void negativeNormal(
const alu3d_ctype,
const alu3d_ctype,
coord3_t&)
const;
124 template <
class vector_t>
125 void buildMapping (
const vector_t & ,
const vector_t & ,
126 const vector_t & ,
const vector_t & );
130 template <
class vector_t>
131 void buildMapping (
const vector_t & ,
const vector_t & ,
132 const vector_t & ,
const vector_t & ,
133 alu3d_ctype (&_b)[4][3] );
148 static const double _epsilon;
155 typedef alu3d_ctype double3_t[3];
166 alu3d_ctype _b [4][3] ;
169 mutable inv_t invTransposed_;
171 mutable alu3d_ctype DetDf;
176 mutable bool _calcedInv;
177 mutable bool _calcedTransposed;
178 mutable bool _calcedMatrix;
189 const double3_t &,
const double3_t &) ;
193 void inverse (
const coord3_t&)
const;
194 const inv_t& jacobianInverseTransposed(
const coord2_t&)
const ;
199 alu3d_ctype det(
const coord2_t&)
const;
207 void map2world(
const alu3d_ctype ,
const alu3d_ctype ,
coord3_t&)
const ;
210 void map2worldnormal(
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype ,
coord3_t&)
const;
211 void map2worldlinear(
const alu3d_ctype,
const alu3d_ctype,
const alu3d_ctype )
const;
216 template <
class vector_t>
217 void buildMapping (
const vector_t & ,
const vector_t & ,
218 const vector_t & ,
const vector_t & );
228 typedef alu3d_ctype ctype;
241 mutable inv_t invTransposed_;
243 mutable bool affine_;
244 mutable bool calcedMatrix_;
245 mutable bool calcedDet_;
246 mutable bool calcedInv_;
252 BilinearMapping (
const ctype (&p0)[ cdim ],
const ctype (&p1)[ cdim ],
253 const ctype (&p2)[ cdim ],
const ctype (&p3)[ cdim ] );
255 bool affine ()
const;
258 void map2world (
const ctype x,
const ctype y,
world_t &w )
const;
261 ctype det (
const map_t & )
const;
264 const inv_t &jacobianInverseTransposed (
const map_t & )
const;
266 template<
class vector_t >
267 void buildMapping (
const vector_t &,
const vector_t &,
268 const vector_t &,
const vector_t & );
274 void map2worldlinear (
const ctype,
const ctype )
const;
275 void inverse (
const map_t & )
const;
281 template<
int cdim,
int mydim >
285 typedef alu3d_ctype ctype;
287 typedef ctype double_t[ cdim ];
317 inline bool affine ()
const {
return true ; }
320 const matrix_t& jacobianTransposed(
const map_t &)
const ;
323 const inv_t& jacobianInverseTransposed(
const map_t &)
const ;
326 ctype det(
const map_t&)
const;
329 void world2map(
const world_t &, map_t &)
const;
333 void map2world(
const map_t &, world_t &)
const ;
337 void inverse (
const map_t&)
const;
340 void inverseCodimOne (
const map_t&)
const;
343 void calculateDeterminant (
const map_t&)
const;
345 void multTransposedMatrix(
const matrix_t& matrix,
355 template <
class vector_t>
356 void buildMapping (
const vector_t & ,
const vector_t & ,
357 const vector_t & ,
const vector_t & );
361 template <
class vector_t>
362 void buildMapping (
const vector_t & ,
const vector_t & ,
367 template <
class vector_t>
368 void buildMapping (
const vector_t & ,
const vector_t & );
370 template <
class vector_t>
371 void buildMapping (
const vector_t & );
384 template<
int dim,
int dimworld, ALU3dGr
idElementType type,
class Comm >
388 template<
int dim,
int dimworld,
class Comm >
393 typedef typename ALU3dImplTraits< tetra, Comm >::HfaceRuleType RefinementRuleType;
396 : rule_( rule ), nChild_( nChild )
416 RefinementRuleType rule_;
421 template<
int dim,
int dimworld,
class Comm >
426 typedef typename ALU3dImplTraits< hexa, Comm >::HfaceRuleType RefinementRuleType;
429 : rule_( rule ), nChild_( nChild )
443 RefinementRuleType rule_;
449#if COMPILE_ALUGRID_INLINE
450 #include "mappings_imp.cc"
A bilinear mapping.
Definition: mappings.hh:226
A bilinear surface mapping.
Definition: mappings.hh:143
BilinearSurfaceMapping()
Constructor creating empty mapping with double , i.e. zero.
Definition: mappings_imp.cc:369
A linear mapping.
Definition: mappings.hh:283
inv_t _invTransposed
storage for inverse of jacobian (transposed)
Definition: mappings.hh:297
void multMatrix(const matrix_t &A, const FieldMatrix< ctype, mydim, mydim > &B, inv_t &ret) const
Definition: mappings_imp.cc:1192
LinearMapping()
Constructor creating empty mapping with double , i.e. zero.
Definition: mappings_imp.cc:853
bool _calcedInv
true if inverse has been calculated
Definition: mappings.hh:304
bool _calcedDet
true if determinant has been calculated
Definition: mappings.hh:307
matrix_t _matrix
transformation matrix (transposed)
Definition: mappings.hh:296
ctype _det
P[0].
Definition: mappings.hh:301
A bilinear surface mapping.
Definition: mappings.hh:88
SurfaceNormalCalculator()
Constructor creating empty mapping with double , i.e. zero.
Definition: mappings_imp.cc:253
Definition: mappings.hh:29
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: alignedallocator.hh:13