Dune Core Modules (2.4.2)

multilineargeometry.hh
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
4 #define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
5 
6 #include <cassert>
7 #include <limits>
8 #include <vector>
9 
10 #include <dune/common/fmatrix.hh>
11 #include <dune/common/fvector.hh>
13 
14 #include <dune/geometry/referenceelements.hh>
15 #include <dune/geometry/type.hh>
16 #include <dune/geometry/genericgeometry/geometrytraits.hh>
17 #include <dune/geometry/genericgeometry/matrixhelper.hh>
18 
19 namespace Dune
20 {
21 
22  // External Forward Declarations
23  // -----------------------------
24 
25  template< class ctype, int dim >
26  class ReferenceElement;
27 
28  template< class ctype, int dim >
29  struct ReferenceElements;
30 
31 
32 
33  // MultiLinearGeometryTraits
34  // -------------------------
35 
45  template< class ct >
47  {
66  typedef GenericGeometry::MatrixHelper< GenericGeometry::DuneCoordTraits< ct > > MatrixHelper;
67 
69  static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::epsilon(); }
70 
94  template< int mydim, int cdim >
96  {
97  typedef std::vector< FieldVector< ct, cdim > > Type;
98  };
99 
113  template< int dim >
115  {
116  static const bool v = false;
117  static const unsigned int topologyId = ~0u;
118  };
119  };
120 
121 
122 
123  // MultiLinearGeometry
124  // -------------------
125 
146  template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
148  {
150 
151  public:
153  typedef ct ctype;
154 
156  static const int mydimension= mydim;
158  static const int coorddimension = cdim;
159 
164 
167 
169  class JacobianInverseTransposed;
170 
173 
174  private:
175  static const bool hasSingleGeometryType = Traits::template hasSingleGeometryType< mydimension >::v;
176 
177  protected:
178  typedef typename Traits::MatrixHelper MatrixHelper;
179  typedef typename conditional< hasSingleGeometryType, integral_constant< unsigned int, Traits::template hasSingleGeometryType< mydimension >::topologyId >, unsigned int >::type TopologyId;
180 
182 
183  private:
184  typedef typename Traits::template CornerStorage< mydimension, coorddimension >::Type::const_iterator CornerIterator;
185 
186  public:
196  template< class Corners >
198  const Corners &corners )
199  : refElement_( &refElement ),
200  corners_( corners )
201  {}
202 
212  template< class Corners >
214  const Corners &corners )
215  : refElement_( &ReferenceElements::general( gt ) ),
216  corners_( corners )
217  {}
218 
220  bool affine () const
221  {
223  return affine( jt );
224  }
225 
227  Dune::GeometryType type () const { return GeometryType( toUnsignedInt(topologyId()), mydimension ); }
228 
230  int corners () const { return refElement().size( mydimension ); }
231 
233  GlobalCoordinate corner ( int i ) const
234  {
235  assert( (i >= 0) && (i < corners()) );
236  return corners_[ i ];
237  }
238 
240  GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
241 
248  GlobalCoordinate global ( const LocalCoordinate &local ) const
249  {
250  CornerIterator cit = corners_.begin();
252  global< false >( topologyId(), integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), y );
253  return y;
254  }
255 
268  LocalCoordinate local ( const GlobalCoordinate &global ) const
269  {
270  const ctype tolerance = Traits::tolerance();
271  LocalCoordinate x = refElement().position( 0, 0 );
272  LocalCoordinate dx;
273  do
274  {
275  // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n
276  const GlobalCoordinate dglobal = (*this).global( x ) - global;
277  MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed( x ), dglobal, dx );
278  x -= dx;
279  } while( dx.two_norm2() > tolerance );
280  return x;
281  }
282 
297  ctype integrationElement ( const LocalCoordinate &local ) const
298  {
299  return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jacobianTransposed( local ) );
300  }
301 
310  ctype volume () const
311  {
312  return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
313  }
314 
325  {
327  CornerIterator cit = corners_.begin();
328  jacobianTransposed< false >( topologyId(), integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );
329  return jt;
330  }
331 
338  JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const;
339 
340  protected:
341  const ReferenceElement &refElement () const { return *refElement_; }
342 
343  TopologyId topologyId () const
344  {
345  return topologyId( integral_constant< bool, hasSingleGeometryType >() );
346  }
347 
348  template< bool add, int dim >
349  static void global ( TopologyId topologyId, integral_constant< int, dim >,
350  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
351  const ctype &rf, GlobalCoordinate &y );
352  template< bool add >
353  static void global ( TopologyId topologyId, integral_constant< int, 0 >,
354  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
355  const ctype &rf, GlobalCoordinate &y );
356 
357  template< bool add, int rows, int dim >
358  static void jacobianTransposed ( TopologyId topologyId, integral_constant< int, dim >,
359  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
360  const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
361  template< bool add, int rows >
362  static void jacobianTransposed ( TopologyId topologyId, integral_constant< int, 0 >,
363  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
364  const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
365 
366  template< int dim >
367  static bool affine ( TopologyId topologyId, integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt );
368  static bool affine ( TopologyId topologyId, integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt );
369 
371  {
372  CornerIterator cit = corners_.begin();
373  return affine( topologyId(), integral_constant< int, mydimension >(), cit, jacobianTransposed );
374  }
375 
376  private:
377  // The following methods are needed to convert the return type of topologyId to
378  // unsigned int with g++-4.4. It has problems casting integral_constant to the
379  // integral type.
380  static unsigned int toUnsignedInt(unsigned int i) { return i; }
381  template<unsigned int v>
382  static unsigned int toUnsignedInt(std::integral_constant<unsigned int,v> i) { return v; }
383  TopologyId topologyId ( integral_constant< bool, true > ) const { return TopologyId(); }
384  unsigned int topologyId ( integral_constant< bool, false > ) const { return refElement().type().id(); }
385 
386  const ReferenceElement *refElement_;
387  typename Traits::template CornerStorage< mydimension, coorddimension >::Type corners_;
388  };
389 
390 
391 
392  // MultiLinearGeometry::JacobianInverseTransposed
393  // ----------------------------------------------
394 
395  template< class ct, int mydim, int cdim, class Traits >
396  class MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
397  : public FieldMatrix< ctype, coorddimension, mydimension >
398  {
400 
401  public:
402  void setup ( const JacobianTransposed &jt )
403  {
404  detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jt, static_cast< Base & >( *this ) );
405  }
406 
407  void setupDeterminant ( const JacobianTransposed &jt )
408  {
409  detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jt );
410  }
411 
412  ctype det () const { return ctype( 1 ) / detInv_; }
413  ctype detInv () const { return detInv_; }
414 
415  private:
416  ctype detInv_;
417  };
418 
419 
420 
433  template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
435  : public MultiLinearGeometry< ct, mydim, cdim, Traits >
436  {
439 
440  protected:
441  typedef typename Base::MatrixHelper MatrixHelper;
442 
443  public:
444  typedef typename Base::ReferenceElement ReferenceElement;
445 
446  typedef typename Base::ctype ctype;
447 
448  using Base::mydimension;
449  using Base::coorddimension;
450 
451  typedef typename Base::LocalCoordinate LocalCoordinate;
452  typedef typename Base::GlobalCoordinate GlobalCoordinate;
453 
455  typedef typename Base::JacobianInverseTransposed JacobianInverseTransposed;
456 
457  template< class CornerStorage >
458  CachedMultiLinearGeometry ( const ReferenceElement &refElement, const CornerStorage &cornerStorage )
459  : Base( refElement, cornerStorage ),
460  affine_( Base::affine( jacobianTransposed_ ) ),
461  jacobianInverseTransposedComputed_( false ),
462  integrationElementComputed_( false )
463  {}
464 
465  template< class CornerStorage >
466  CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage &cornerStorage )
467  : Base( gt, cornerStorage ),
468  affine_( Base::affine( jacobianTransposed_ ) ),
469  jacobianInverseTransposedComputed_( false ),
470  integrationElementComputed_( false )
471  {}
472 
474  bool affine () const { return affine_; }
475 
476  using Base::corner;
477 
479  GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
480 
487  GlobalCoordinate global ( const LocalCoordinate &local ) const
488  {
489  if( affine() )
490  {
492  jacobianTransposed_.umtv( local, global );
493  return global;
494  }
495  else
496  return Base::global( local );
497  }
498 
511  LocalCoordinate local ( const GlobalCoordinate &global ) const
512  {
513  if( affine() )
514  {
515  LocalCoordinate local;
516  if( jacobianInverseTransposedComputed_ )
517  jacobianInverseTransposed_.mtv( global - corner( 0 ), local );
518  else
519  MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed_, global - corner( 0 ), local );
520  return local;
521  }
522  else
523  return Base::local( global );
524  }
525 
540  ctype integrationElement ( const LocalCoordinate &local ) const
541  {
542  if( affine() )
543  {
544  if( !integrationElementComputed_ )
545  {
546  jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );
547  integrationElementComputed_ = true;
548  }
549  return jacobianInverseTransposed_.detInv();
550  }
551  else
552  return Base::integrationElement( local );
553  }
554 
556  ctype volume () const
557  {
558  if( affine() )
559  return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
560  else
561  return Base::volume();
562  }
563 
574  {
575  if( affine() )
576  return jacobianTransposed_;
577  else
578  return Base::jacobianTransposed( local );
579  }
580 
587  JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const
588  {
589  if( affine() )
590  {
591  if( !jacobianInverseTransposedComputed_ )
592  {
593  jacobianInverseTransposed_.setup( jacobianTransposed_ );
594  jacobianInverseTransposedComputed_ = true;
595  integrationElementComputed_ = true;
596  }
597  return jacobianInverseTransposed_;
598  }
599  else
600  return Base::jacobianInverseTransposed( local );
601  }
602 
603  protected:
604  using Base::refElement;
605 
606  private:
607  mutable JacobianTransposed jacobianTransposed_;
608  mutable JacobianInverseTransposed jacobianInverseTransposed_;
609 
610  mutable bool affine_ : 1;
611 
612  mutable bool jacobianInverseTransposedComputed_ : 1;
613  mutable bool integrationElementComputed_ : 1;
614  };
615 
616 
617 
618  // Implementation of MultiLinearGeometry
619  // -------------------------------------
620 
621  template< class ct, int mydim, int cdim, class Traits >
622  inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
624  {
625  JacobianInverseTransposed jit;
626  jit.setup( jacobianTransposed( local ) );
627  return jit;
628  }
629 
630 
631  template< class ct, int mydim, int cdim, class Traits >
632  template< bool add, int dim >
634  ::global ( TopologyId topologyId, integral_constant< int, dim >,
635  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
636  const ctype &rf, GlobalCoordinate &y )
637  {
638  const ctype xn = df*x[ dim-1 ];
639  const ctype cxn = ctype( 1 ) - xn;
640 
641  if( GenericGeometry::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
642  {
643  // apply (1-xn) times mapping for bottom
644  global< add >( topologyId, integral_constant< int, dim-1 >(), cit, df, x, rf*cxn, y );
645  // apply xn times mapping for top
646  global< true >( topologyId, integral_constant< int, dim-1 >(), cit, df, x, rf*xn, y );
647  }
648  else
649  {
650  assert( GenericGeometry::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
651  // apply (1-xn) times mapping for bottom (with argument x/(1-xn))
652  if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() )
653  global< add >( topologyId, integral_constant< int, dim-1 >(), cit, df/cxn, x, rf*cxn, y );
654  else
655  global< add >( topologyId, integral_constant< int, dim-1 >(), cit, df, x, ctype( 0 ), y );
656  // apply xn times the tip
657  y.axpy( rf*xn, *cit );
658  ++cit;
659  }
660  }
661 
662  template< class ct, int mydim, int cdim, class Traits >
663  template< bool add >
665  ::global ( TopologyId topologyId, integral_constant< int, 0 >,
666  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
667  const ctype &rf, GlobalCoordinate &y )
668  {
669  const GlobalCoordinate &origin = *cit;
670  ++cit;
671  for( int i = 0; i < coorddimension; ++i )
672  y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);
673  }
674 
675 
676  template< class ct, int mydim, int cdim, class Traits >
677  template< bool add, int rows, int dim >
679  ::jacobianTransposed ( TopologyId topologyId, integral_constant< int, dim >,
680  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
681  const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )
682  {
683  assert( rows >= dim );
684 
685  const ctype xn = df*x[ dim-1 ];
686  const ctype cxn = ctype( 1 ) - xn;
687 
688  CornerIterator cit2( cit );
689  if( GenericGeometry::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
690  {
691  // apply (1-xn) times Jacobian for bottom
692  jacobianTransposed< add >( topologyId, integral_constant< int, dim-1 >(), cit2, df, x, rf*cxn, jt );
693  // apply xn times Jacobian for top
694  jacobianTransposed< true >( topologyId, integral_constant< int, dim-1 >(), cit2, df, x, rf*xn, jt );
695  // compute last row as difference between top value and bottom value
696  global< add >( topologyId, integral_constant< int, dim-1 >(), cit, df, x, -rf, jt[ dim-1 ] );
697  global< true >( topologyId, integral_constant< int, dim-1 >(), cit, df, x, rf, jt[ dim-1 ] );
698  }
699  else
700  {
701  assert( GenericGeometry::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
702  /*
703  * In the pyramid case, we need a transformation Tb: B -> R^n for the
704  * base B \subset R^{n-1}. The pyramid transformation is then defined as
705  * T: P \subset R^n -> R^n
706  * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \in R^{n-1}, xn \in R)
707  * with the tip of the pyramid mapped to t and x* = x/(1-xn)
708  * the projection of (x,xn) onto the base.
709  *
710  * For the Jacobi matrix DT we get
711  * DT = ( A | b )
712  * with A = DTb(x*) (n x n-1 matrix)
713  * and b = dT/dxn (n-dim column vector).
714  * Furthermore
715  * b = -Tb(x*) + t + \sum_i dTb/dx_i(x^*) x_i/(1-xn)
716  *
717  * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!
718  * Indeed for B the unit square, Tb mapping B to the quadrilateral given
719  * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get
720  *
721  * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )
722  * / 2-y/(1-xn) -x 0 \
723  * DT(x,y,xn) = | 0 1 0 |
724  * \ 0 0 1 /
725  * which is not continuous for xn -> 1, choose for example
726  * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)
727  * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)
728  *
729  * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:
730  * A = M
731  * b = -M x* - y0 + t + \sum_i M_i x_i/(1-xn)
732  * = -M x* - y0 + t + M x*
733  * = -y0 + t
734  * which is continuous for xn -> 1. Note that this b is also given by
735  * b = -Tb(0) + t + \sum_i dTb/dx_i(0) x_i/1
736  * that is replacing x* by 1 and 1-xn by 1 in the formular above.
737  *
738  * For xn -> 1, we can thus set x*=0, "1-xn"=1 (or anything != 0) and get
739  * the right result in case Tb is affine-linear.
740  */
741 
742  /* The second case effectively results in x* = 0 */
743  ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? ctype(df / cxn) : ctype(0);
744 
745  // initialize last row
746  // b = -Tb(x*)
747  // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)
748  global< add >( topologyId, integral_constant< int, dim-1 >(), cit, dfcxn, x, -rf, jt[ dim-1 ] );
749  // b += t
750  jt[ dim-1 ].axpy( rf, *cit );
751  ++cit;
752  // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row
753  if( add )
754  {
755  FieldMatrix< ctype, dim-1, coorddimension > jt2;
756  // jt2 = dTb/dx_i(x*)
757  jacobianTransposed< false >( topologyId, integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt2 );
758  // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)
759  // b += \sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])
760  // (b += 0 in case xn -> 1)
761  for( int j = 0; j < dim-1; ++j )
762  {
763  jt[ j ] += jt2[ j ];
764  jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );
765  }
766  }
767  else
768  {
769  // jt = dTb/dx_i(x*)
770  jacobianTransposed< false >( topologyId, integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt );
771  // b += \sum_i dTb/dx_i(x*) x_i/(1-xn)
772  for( int j = 0; j < dim-1; ++j )
773  jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );
774  }
775  }
776  }
777 
778  template< class ct, int mydim, int cdim, class Traits >
779  template< bool add, int rows >
781  ::jacobianTransposed ( TopologyId topologyId, integral_constant< int, 0 >,
782  CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
783  const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )
784  {
785  ++cit;
786  }
787 
788 
789 
790  template< class ct, int mydim, int cdim, class Traits >
791  template< int dim >
793  ::affine ( TopologyId topologyId, integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt )
794  {
795  const GlobalCoordinate &orgBottom = *cit;
796  if( !affine( topologyId, integral_constant< int, dim-1 >(), cit, jt ) )
797  return false;
798  const GlobalCoordinate &orgTop = *cit;
799 
800  if( GenericGeometry::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
801  {
802  JacobianTransposed jtTop;
803  if( !affine( topologyId, integral_constant< int, dim-1 >(), cit, jtTop ) )
804  return false;
805 
806  // check whether both jacobians are identical
807  ctype norm( 0 );
808  for( int i = 0; i < dim-1; ++i )
809  norm += (jtTop[ i ] - jt[ i ]).two_norm2();
810  if( norm >= Traits::tolerance() )
811  return false;
812  }
813  else
814  ++cit;
815  jt[ dim-1 ] = orgTop - orgBottom;
816  return true;
817  }
818 
819  template< class ct, int mydim, int cdim, class Traits >
821  ::affine ( TopologyId topologyId, integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt )
822  {
823  ++cit;
824  return true;
825  }
826 
827 } // namespace Dune
828 
829 #endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
Implement a MultiLinearGeometry with additional caching.
Definition: multilineargeometry.hh:436
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition: multilineargeometry.hh:487
bool affine() const
is this mapping affine?
Definition: multilineargeometry.hh:474
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition: multilineargeometry.hh:573
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition: multilineargeometry.hh:233
ctype volume() const
obtain the volume of the mapping's image
Definition: multilineargeometry.hh:556
ctype integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition: multilineargeometry.hh:540
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition: multilineargeometry.hh:479
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition: multilineargeometry.hh:587
void umtv(const X &x, Y &y) const
y += A^T x
Definition: densematrix.hh:441
FieldTraits< value_type >::real_type two_norm2() const
square of two norm (sum over squared values of entries), need for block recursion
Definition: densevector.hh:598
vector space out of a tensor product of fields.
Definition: fvector.hh:94
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
unsigned int id() const
Return the topology id the type.
Definition: type.hh:326
generic geometry implementation based on corner coordinates
Definition: multilineargeometry.hh:148
static const int mydimension
geometry dimension
Definition: multilineargeometry.hh:156
Dune::ReferenceElement< ctype, mydimension > ReferenceElement
type of reference element
Definition: multilineargeometry.hh:169
Dune::GeometryType type() const
obtain the name of the reference element
Definition: multilineargeometry.hh:227
FieldVector< ctype, coorddimension > GlobalCoordinate
type of global coordinates
Definition: multilineargeometry.hh:163
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition: multilineargeometry.hh:324
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition: multilineargeometry.hh:248
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition: multilineargeometry.hh:240
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition: multilineargeometry.hh:233
ct ctype
coordinate type
Definition: multilineargeometry.hh:153
static const int coorddimension
coordinate dimension
Definition: multilineargeometry.hh:158
int corners() const
obtain number of corners of the corresponding reference element
Definition: multilineargeometry.hh:230
FieldVector< ctype, mydimension > LocalCoordinate
type of local coordinates
Definition: multilineargeometry.hh:161
ctype volume() const
obtain the volume of the mapping's image
Definition: multilineargeometry.hh:310
MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)
constructor
Definition: multilineargeometry.hh:197
MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)
constructor
Definition: multilineargeometry.hh:213
ctype integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition: multilineargeometry.hh:297
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
type of jacobian transposed
Definition: multilineargeometry.hh:166
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition: multilineargeometry.hh:623
bool affine() const
is this mapping affine?
Definition: multilineargeometry.hh:220
This class provides access to geometric and topological properties of a reference element.
Definition: referenceelements.hh:31
int size(int c) const
number of subentities of codimension c
Definition: referenceelements.hh:82
ctype volume() const
obtain the volume of the reference element
Definition: referenceelements.hh:210
const FieldVector< ctype, dim > & position(int i, int c) const
position of the barycenter of entity (i,c)
Definition: referenceelements.hh:150
const GeometryType & type(int i, int c) const
obtain the type of subentity (i,c)
Definition: referenceelements.hh:132
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.
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:132
Dune namespace.
Definition: alignment.hh:10
template specifying the storage for the corners
Definition: multilineargeometry.hh:96
will there be only one geometry type for a dimension?
Definition: multilineargeometry.hh:115
default traits class for MultiLinearGeometry
Definition: multilineargeometry.hh:47
static ct tolerance()
tolerance to numerical algorithms
Definition: multilineargeometry.hh:69
GenericGeometry::MatrixHelper< GenericGeometry::DuneCoordTraits< ct > > MatrixHelper
helper structure containing some matrix routines
Definition: multilineargeometry.hh:66
Class providing access to the singletons of the reference elements.
Definition: referenceelements.hh:479
A unique label for each type of element that can occur in a grid.
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 16, 22:29, 2024)