dune-grid  2.4
alugrid/3d/geometry.hh
Go to the documentation of this file.
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_ALU3DGRIDGEOMETRY_HH
4 #define DUNE_ALU3DGRIDGEOMETRY_HH
5 
6 // System includes
7 
8 // Dune includes
9 #include <dune/common/power.hh>
10 #include <dune/grid/common/grid.hh>
11 
12 // Local includes
13 #include "alu3dinclude.hh"
14 #include "topology.hh"
15 #include "mappings.hh"
17 
18 namespace Dune
19 {
20 
21  // Forward declarations
22  template<int cd, int dim, class GridImp>
23  class ALU3dGridEntity;
24  template<int cd, class GridImp >
25  class ALU3dGridEntityPointer;
26  template<int mydim, int coorddim, class GridImp>
27  class ALU3dGridGeometry;
28  template< ALU3dGridElementType, class >
29  class ALU3dGrid;
30  class BilinearSurfaceMapping;
31  class TrilinearMapping;
32 
33  template< class GridImp >
34  class ALU3dGridIntersectionIterator;
35 
36  template <int cdim>
38  {
39  public:
40  typedef FieldVector<alu3d_ctype, cdim> CoordinateVectorType;
41 
42  static const signed char invalid = -1; // means geometry is not meaningful
43  static const signed char updated = 0; // means the point values have been set
44  static const signed char buildmapping = 1; // means updated and mapping was build
45 
46  template <int dim, int corners, class Mapping>
48  {
49  private:
50  // prohibited due to reference counting
52 
53  protected:
55  static const int corners_ = corners ;
56 
58  typedef FieldMatrix<alu3d_ctype, corners , cdim> CoordinateMatrixType;
59 
60  template <int dummy, int dimused>
62  {
63  typedef CoordinateMatrixType Type;
64  };
65 
66  template <int dummy>
67  struct CoordTypeExtractorType< dummy, 3 >
68  {
69  typedef CoordinateMatrixType* Type;
70  };
71 
73 
75  typedef Mapping MappingType;
76 
78  CoordinateStorageType coord_ ;
79 
81  MappingType map_;
82 
84  double volume_ ;
85 
87  mutable unsigned int refCount_;
88 
90  signed char status_ ;
91  public:
94  : coord_( 0 ),
95  map_(),
96  volume_( 1.0 )
97  {
98  reset();
99  }
100 
102  void reset()
103  {
104  // reset reference counter
105  refCount_ = 1;
106  // reset status
107  status_ = invalid ;
108  }
109 
111  void operator ++ () { ++ refCount_; }
112 
114  void operator -- () { assert( refCount_ > 0 ); --refCount_; }
115 
117  bool operator ! () const { return refCount_ == 0; }
118 
120  bool stillUsed () const { return refCount_ > 1 ; }
121 
122  // copy coordinate vector from field vector or alu3d_ctype[cdim]
123  template <class CoordPtrType>
124  static inline void copy(const CoordPtrType& p,
125  CoordinateVectorType& c)
126  {
127  assert( cdim == 3 );
128  c[0] = p[0];
129  c[1] = p[1];
130  c[2] = p[2];
131  }
132 
133  template <class CoordPtrType>
134  void update(const CoordPtrType&,
135  const CoordPtrType&,
136  const CoordPtrType&,
137  const CoordPtrType&,
138  const CoordPtrType&,
139  const CoordPtrType&,
140  const CoordPtrType&,
141  const CoordPtrType& ) const
142  {
143  DUNE_THROW(InvalidStateException,"This method should not be called!");
144  }
145 
146  template <class CoordPtrType>
147  void update(const CoordPtrType&,
148  const CoordPtrType&,
149  const CoordPtrType&,
150  const CoordPtrType& ) const
151  {
152  DUNE_THROW(InvalidStateException,"This method should not be called!");
153  }
154 
155  template <class CoordPtrType>
156  void update(const CoordPtrType&,
157  const CoordPtrType&,
158  const CoordPtrType& ) const
159  {
160  DUNE_THROW(InvalidStateException,"This method should not be called!");
161  }
162 
163  // set status to invalid
164  void invalidate () { status_ = invalid ; }
165 
166  // return true if geometry is valid
167  bool valid () const { return status_ != invalid ; }
168 
169  // set volume
170  void setVolume( const double volume ) { volume_ = volume ; }
171 
172  // return volume
173  double volume() const { return volume_; }
174  };
175 
177  template <int dummy, int dim,
179  public:
180  // geometry implementation for edges and vertices
181  template <int dummy, int dim, ALU3dGridElementType eltype>
182  class GeometryImpl : public GeometryImplBase< dim, dim+1, LinearMapping<cdim, dim> >
183  {
185 
186  using BaseType :: corners_ ;
187  using BaseType :: copy ;
188  using BaseType :: coord_ ;
189  using BaseType :: map_ ;
190  using BaseType :: status_ ;
191 
192  typedef typename BaseType :: MappingType MappingType ;
193  public:
194  using BaseType :: update ;
195  using BaseType :: valid ;
196 
197  // return coordinate vector
198  inline const CoordinateVectorType& operator [] (const int i) const
199  {
200  assert( valid() );
201  assert( i>=0 && i<corners_ );
202  return coord_[i];
203  }
204 
205  inline MappingType& mapping()
206  {
207  assert( valid() );
208  if( status_ == buildmapping ) return map_;
209 
210  map_.buildMapping( coord_[0] );
212  return map_;
213  }
214 
215  // update vertex
216  template <class CoordPtrType>
217  inline void update(const CoordPtrType& p0)
218  {
219  assert( corners_ == 1 );
220  copy( p0, coord_[0] );
221  // we need to update the mapping
222  status_ = updated ;
223  }
224  };
225 
226  // geometry implementation for edges and vertices
227  template <int dummy, ALU3dGridElementType eltype>
228  class GeometryImpl<dummy,1,eltype>
229  : public GeometryImplBase< 1, 2, LinearMapping<cdim, 1> >
230  {
231  enum { dim = 1 };
233 
234  using BaseType :: corners_ ;
235  using BaseType :: copy ;
236  using BaseType :: coord_ ;
237  using BaseType :: map_ ;
238  using BaseType :: status_ ;
239 
240  typedef typename BaseType :: MappingType MappingType;
241  public:
242  using BaseType :: update ;
243  using BaseType :: valid ;
244 
245  // return coordinate vector
246  inline const CoordinateVectorType& operator [] (const int i) const
247  {
248  assert( valid() );
249  assert( i>=0 && i<corners_ );
250  return coord_[i];
251  }
252 
253  inline MappingType& mapping()
254  {
255  assert( valid() );
256  if( status_ == buildmapping ) return map_;
257 
258  map_.buildMapping( coord_[0], coord_[1] );
260  return map_;
261  }
262 
263  // update edge
264  template <class CoordPtrType>
265  inline void update(const CoordPtrType& p0,
266  const CoordPtrType& p1)
267  {
268  assert( corners_ == 2 );
269  copy( p0, coord_[0] );
270  copy( p1, coord_[1] );
271  status_ = updated;
272  }
273  };
274 
275  // geom impl for simplex faces (triangles)
276  template <int dummy>
277  class GeometryImpl<dummy, 2, tetra>
278  : public GeometryImplBase< 2, 3, LinearMapping<cdim, 2> >
279  {
280  // dim = 2, corners = 3
282 
283  using BaseType :: corners_ ;
284  using BaseType :: copy ;
285  using BaseType :: coord_ ;
286  using BaseType :: map_ ;
287  using BaseType :: status_ ;
288 
289  typedef typename BaseType :: MappingType MappingType ;
290  public:
291  using BaseType :: update ;
292  using BaseType :: valid ;
293 
294  // return coordinate vector
295  inline const CoordinateVectorType& operator [] (const int i) const
296  {
297  assert( valid() );
298  assert( i>=0 && i<corners_ );
299  return coord_[i];
300  }
301 
302  // update geometry coordinates
303  template <class CoordPtrType>
304  inline void update(const CoordPtrType& p0,
305  const CoordPtrType& p1,
306  const CoordPtrType& p2)
307  {
308  copy(p0, coord_[0] );
309  copy(p1, coord_[1] );
310  copy(p2, coord_[2] );
311  status_ = updated;
312  }
313 
314  // return mapping (always up2date)
315  inline MappingType& mapping()
316  {
317  assert( valid() );
318  if( status_ == buildmapping ) return map_;
319 
320  map_.buildMapping( coord_[0], coord_[1], coord_[2] );
322  return map_;
323  }
324  };
325 
327  //
328  // hexa specializations
329  //
331 
332  // geom impl for cube faces (quadrilaterals)
333  template <int dummy>
334  class GeometryImpl<dummy, 2, hexa>
335  : public GeometryImplBase< 2, 4, BilinearSurfaceMapping >
336  {
337  // dim = 2, corners = 4
339 
340  using BaseType :: corners_ ;
341  using BaseType :: copy ;
342  using BaseType :: coord_ ;
343  using BaseType :: map_ ;
344  using BaseType :: status_ ;
345 
346  typedef typename BaseType :: MappingType MappingType ;
347  public:
348  using BaseType :: update ;
349  using BaseType :: valid ;
350 
351  // return coordinate vector
352  inline const CoordinateVectorType& operator [] (const int i) const
353  {
354  assert( valid() );
355  assert( i>=0 && i<corners_ );
356  return coord_[i];
357  }
358 
359  // update geometry coordinates
360  template <class CoordPtrType>
361  inline void update(const CoordPtrType& p0,
362  const CoordPtrType& p1,
363  const CoordPtrType& p2,
364  const CoordPtrType& p3)
365  {
366  copy(p0, coord_[0] );
367  copy(p1, coord_[1] );
368  copy(p2, coord_[2] );
369  copy(p3, coord_[3] );
370  status_ = updated;
371  }
372 
373  // return mapping (always up2date)
374  inline MappingType& mapping()
375  {
376  assert( valid() );
377  if( status_ == buildmapping ) return map_;
378 
379  map_.buildMapping( coord_[0], coord_[1], coord_[2], coord_[3] );
381  return map_;
382  }
383  };
384 
385  // geometry impl for hexahedrons
386  template <int dummy>
387  class GeometryImpl<dummy,3, hexa>
388  : public GeometryImplBase< 3, 8, TrilinearMapping >
389  {
390  // dim = 3, corners = 8
392 
393  using BaseType :: corners_ ;
394  using BaseType :: copy ;
395  using BaseType :: coord_ ;
396  using BaseType :: map_ ;
397  using BaseType :: status_ ;
398 
399  typedef typename BaseType :: MappingType MappingType ;
401 
402  typedef alu3d_ctype CoordPtrType[cdim];
403 
404  // coordinate pointer vector
405  const alu3d_ctype* coordPtr_[ corners_ ];
406  public:
407  using BaseType :: update ;
408  using BaseType :: valid ;
409 
411  GeometryImpl() : BaseType()
412  {
413  // set initialize coord pointers
414  for( int i=0; i<corners_; ++i )
415  coordPtr_[ i ] = 0;
416  }
417 
418  // desctructor
420  {
421  if( coord_ ) delete coord_;
422  }
423 
424  const alu3d_ctype* point( const int i ) const
425  {
426  assert( valid() );
427  assert( i>=0 && i<corners_ );
428  assert( coordPtr_[i] );
429  return coordPtr_[ i ];
430  }
431 
432  // return coordinates
433  inline CoordinateVectorType operator [] (const int i) const
434  {
435  CoordinateVectorType coord ;
436  copy( point( i ), coord );
437  return coord ;
438  }
439 
440  // update geometry coordinates
441  inline void update(const CoordPtrType& p0,
442  const CoordPtrType& p1,
443  const CoordPtrType& p2,
444  const CoordPtrType& p3,
445  const CoordPtrType& p4,
446  const CoordPtrType& p5,
447  const CoordPtrType& p6,
448  const CoordPtrType& p7)
449  {
450  coordPtr_[0] = &p0[ 0 ];
451  coordPtr_[1] = &p1[ 0 ];
452  coordPtr_[2] = &p2[ 0 ];
453  coordPtr_[3] = &p3[ 0 ];
454  coordPtr_[4] = &p4[ 0 ];
455  coordPtr_[5] = &p5[ 0 ];
456  coordPtr_[6] = &p6[ 0 ];
457  coordPtr_[7] = &p7[ 0 ];
458  status_ = updated;
459  }
460 
461  // update geometry in father coordinates
462  template <class GeometryImp>
463  inline void updateInFather(const GeometryImp &fatherGeom ,
464  const GeometryImp &myGeom)
465  {
466  if( coord_ == 0 )
467  {
469  }
470 
471  CoordinateMatrixType& coord = *coord_;
472  // compute the local coordinates in father refelem
473  for(int i=0; i < myGeom.corners() ; ++i)
474  {
475  // calculate coordinate
476  coord[i] = fatherGeom.local( myGeom.corner( i ) );
477 
478  // set pointer
479  coordPtr_[i] = (&(coord[i][0]));
480 
481  // to avoid rounding errors
482  for(int j=0; j<cdim; ++j)
483  {
484  if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
485  }
486  }
487 
488  status_ = updated ;
489  }
490 
491  // return mapping (always up2date)
492  inline MappingType& mapping()
493  {
494  assert( valid() );
495  if( status_ == buildmapping ) return map_;
496 
497  map_.buildMapping( point( 0 ), point( 1 ), point( 2 ), point( 3 ),
498  point( 4 ), point( 5 ), point( 6 ), point( 7 ) );
499 
501  return map_;
502  }
503 
504  // set status to invalid
505  void invalidate () { status_ = invalid ; }
506 
507  // return true if geometry is valid
508  bool valid () const { return status_ != invalid ; }
509  };
510 
511 
512  // geometry impl for hexahedrons
513  template <int dummy>
514  class GeometryImpl<dummy,3, tetra>
515  : public GeometryImplBase< 3, 4, LinearMapping<cdim, cdim> >
516  {
517  // dim = 3, corners = 8
519 
520  using BaseType :: corners_ ;
521  using BaseType :: copy ;
522  using BaseType :: coord_ ;
523  using BaseType :: map_ ;
524  using BaseType :: status_ ;
525 
526  typedef typename BaseType :: MappingType MappingType ;
528 
529  typedef alu3d_ctype CoordPtrType[cdim];
530 
531  // coordinate pointer vector
532  const alu3d_ctype* coordPtr_[ corners_ ];
533  public:
534  using BaseType :: update ;
535  using BaseType :: valid ;
536 
537  // default constructor
538  GeometryImpl() : BaseType()
539  {
540  // set initialize coord pointers
541  for( int i=0; i<corners_; ++i )
542  coordPtr_[ i ] = 0;
543  }
544 
545  // destructor
547  {
548  if( coord_ ) delete coord_;
549  }
550 
551  const alu3d_ctype* point( const int i ) const
552  {
553  assert( valid() );
554  assert( i>=0 && i<corners_ );
555  assert( coordPtr_[ i ] );
556  return coordPtr_[ i ];
557  }
558 
559  // return coordinate vector
560  inline CoordinateVectorType operator [] (const int i) const
561  {
562  CoordinateVectorType coord ;
563  copy( point( i ), coord );
564  return coord ;
565  }
566 
567  // update geometry coordinates
568  inline void update(const CoordPtrType& p0,
569  const CoordPtrType& p1,
570  const CoordPtrType& p2,
571  const CoordPtrType& p3)
572  {
573  coordPtr_[0] = &p0[ 0 ];
574  coordPtr_[1] = &p1[ 0 ];
575  coordPtr_[2] = &p2[ 0 ];
576  coordPtr_[3] = &p3[ 0 ];
577  status_ = updated;
578  }
579 
580  // update geometry in father coordinates
581  template <class GeometryImp>
582  inline void updateInFather(const GeometryImp &fatherGeom ,
583  const GeometryImp & myGeom)
584  {
585  if( coord_ == 0 )
586  {
588  }
589 
590  CoordinateMatrixType& coord = *coord_;
591  // compute the local coordinates in father refelem
592  for(int i=0; i < myGeom.corners() ; ++i)
593  {
594  // calculate coordinate
595  coord[i] = fatherGeom.local( myGeom.corner( i ) );
596 
597  // set pointer
598  coordPtr_[i] = (&(coord[i][0]));
599 
600  // to avoid rounding errors
601  for(int j=0; j<cdim; ++j)
602  {
603  if ( coord[i][j] < 1e-16) coord[i][j] = 0.0;
604  }
605  }
606 
607  status_ = updated;
608  }
609 
610  // return mapping (always up2date)
611  inline MappingType& mapping()
612  {
613  assert( valid() );
614  if( status_ == buildmapping ) return map_;
615 
616  map_.buildMapping( point( 0 ), point( 1 ), point( 2 ), point( 3 ) );
617 
619  return map_;
620  }
621  };
622  }; // end of class ALUGridGeometryImplementation
623 
624  template <int mydim, int cdim, class GridImp>
625  class ALU3dGridGeometry :
626  public GeometryDefaultImplementation<mydim, cdim, GridImp, ALU3dGridGeometry>
627  {
628  static const ALU3dGridElementType elementType = GridImp::elementType;
629 
630  typedef typename GridImp::MPICommunicatorType Comm;
631 
632  friend class ALU3dGridIntersectionIterator<GridImp>;
633 
634  typedef typename ALU3dImplTraits< elementType, Comm >::IMPLElementType IMPLElementType;
635  typedef typename ALU3dImplTraits< elementType, Comm >::GEOFaceType GEOFaceType;
636  typedef typename ALU3dImplTraits< elementType, Comm >::GEOEdgeType GEOEdgeType;
637  typedef typename ALU3dImplTraits< elementType, Comm >::GEOVertexType GEOVertexType;
638 
639  // interface types
640  typedef typename ALU3dImplTraits< elementType, Comm >::HFaceType HFaceType;
641  typedef typename ALU3dImplTraits< elementType, Comm >::HEdgeType HEdgeType;
642  typedef typename ALU3dImplTraits< elementType, Comm >::VertexType VertexType;
643 
646 
647  enum { corners_ = (elementType == hexa) ? StaticPower<2,mydim>::power : mydim+1 };
648 
649  // type of specialized geometry implementation
650  typedef typename MyALUGridGeometryImplementation<cdim> ::
651  template GeometryImpl<0, mydim, elementType > GeometryImplType;
652 
653  public:
654  typedef typename GridImp :: ctype ctype;
655 
657  typedef FieldVector<ctype, mydim> LocalCoordinate;
658 
660  typedef FieldVector<ctype, cdim > GlobalCoordinate;
661 
663  typedef FieldMatrix<ctype,cdim,mydim> JacobianInverseTransposed;
664 
666  typedef FieldMatrix< ctype, mydim, cdim > JacobianTransposed;
667 
668  // type of coordinate matrix for faces
669  typedef FieldMatrix<ctype,
671 
675 
678 
681 
684 
687  GeometryType type () const;
688 
690  int corners () const;
691 
693  GlobalCoordinate corner (int i) const;
694 
697  GlobalCoordinate global (const LocalCoordinate& local) const;
698 
701  LocalCoordinate local (const GlobalCoordinate& global) const;
702 
704  ctype integrationElement (const LocalCoordinate& local) const;
705 
708  const JacobianInverseTransposed &jacobianInverseTransposed (const LocalCoordinate& local) const;
709 
711  const JacobianTransposed& jacobianTransposed (const LocalCoordinate& local) const;
712 
714  inline bool affine () const;
715 
717  ctype volume () const;
718 
719  //***********************************************************************
721  //***********************************************************************
723  bool buildGeom(const IMPLElementType & item);
724  bool buildGeom(const HFaceType & item, int twist, int faceNum);
725  bool buildGeom(const HEdgeType & item, int twist, int);
726  bool buildGeom(const VertexType & item, int twist, int);
727 
728  // this method is used by the intersection iterator
729  bool buildGeom(const FaceCoordinatesType& coords);
730 
731  // this method is used by the intersection iterator
732  template <class coord_t>
733  bool buildGeom(const coord_t& p0,
734  const coord_t& p1,
735  const coord_t& p2,
736  const coord_t& p3);
737 
738  // this method is used by the intersection iterator
739  template <class coord_t>
740  bool buildGeom(const coord_t& p0,
741  const coord_t& p1,
742  const coord_t& p2);
743 
745  template <class GeometryType>
746  bool buildGeomInFather(const GeometryType &fatherGeom , const GeometryType & myGeom);
747 
750  void print (std::ostream& ss) const;
751 
753  void invalidate () ;
754 
756  bool valid () const ;
757 
758  protected:
760  void assign( const ALU3dGridGeometry& other );
762  void removeObj();
764  void getObject();
765 
766  // type of object provider
768 
770  static GeometryProviderType& geoProvider()
771  {
772 #ifdef USE_SMP_PARALLEL
773  typedef ALUGridObjectFactory< GridImp > GridObjectFactoryType;
774  static std::vector< GeometryProviderType > storage( GridObjectFactoryType :: maxThreads() );
775  return storage[ GridObjectFactoryType :: threadNumber () ];
776 #else
777  static GeometryProviderType storage;
778  return storage;
779 #endif
780  }
781 
782  // return reference to geometry implementation
783  GeometryImplType& geoImpl() const
784  {
785  assert( geoImpl_ );
786  return *geoImpl_;
787  }
788 
789  // implementation of the coordinates and mapping
790  GeometryImplType* geoImpl_;
791  };
792 
793 } // end namespace Dune
794 
795 #include "geometry_imp.cc"
796 
797 #endif
unsigned int refCount_
the reference counter
Definition: alugrid/3d/geometry.hh:87
static GeometryProviderType & geoProvider()
return storage provider for geometry objects
Definition: alugrid/3d/geometry.hh:770
Definition: alugrid/3d/entity.hh:28
static const signed char buildmapping
Definition: alugrid/3d/geometry.hh:44
GridImp::ctype ctype
Definition: alugrid/3d/geometry.hh:654
static const int corners_
number of corners
Definition: alugrid/3d/geometry.hh:55
void assign(const ALU3dGridGeometry &other)
assign pointer
FieldMatrix< ctype, cdim, mydim > JacobianInverseTransposed
type of jacobian inverse transposed
Definition: alugrid/3d/geometry.hh:663
void update(const CoordPtrType &p0)
Definition: alugrid/3d/geometry.hh:217
void update(const CoordPtrType &p0, const CoordPtrType &p1, const CoordPtrType &p2, const CoordPtrType &p3)
Definition: alugrid/3d/geometry.hh:568
FieldVector< alu3d_ctype, cdim > CoordinateVectorType
Definition: alugrid/3d/geometry.hh:40
ALU3dGridGeometry & operator=(const ALU3dGridGeometry &)
copy constructor copying pointer and increasing reference count
static const signed char invalid
Definition: alugrid/3d/geometry.hh:42
A bilinear surface mapping.
Definition: mappings.hh:144
FieldMatrix< ctype, EntityCount< elementType >::numVerticesPerFace, 3 > FaceCoordinatesType
Definition: alugrid/3d/geometry.hh:670
void reset()
reset status and reference count
Definition: alugrid/3d/geometry.hh:102
GeometryImplType & geoImpl() const
Definition: alugrid/3d/geometry.hh:783
void updateInFather(const GeometryImp &fatherGeom, const GeometryImp &myGeom)
Definition: alugrid/3d/geometry.hh:463
void print(std::ostream &ss) const
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
ctype integrationElement(const LocalCoordinate &local) const
A(l) , see grid.hh.
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:492
Include standard header files.
Definition: agrid.hh:59
void update(const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &) const
Definition: alugrid/3d/geometry.hh:147
Definition: topology.hh:126
void invalidate()
Definition: alugrid/3d/geometry.hh:505
double alu3d_ctype
Definition: alu3dinclude.hh:59
FieldVector< ctype, cdim > GlobalCoordinate
type of the global coordinates
Definition: alugrid/3d/geometry.hh:660
const CoordinateVectorType & operator[](const int i) const
Definition: alugrid/3d/geometry.hh:198
const alu3d_ctype * point(const int i) const
Definition: alugrid/3d/geometry.hh:424
void updateInFather(const GeometryImp &fatherGeom, const GeometryImp &myGeom)
Definition: alugrid/3d/geometry.hh:582
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
jacobian transposed
void operator--()
decrease reference count
Definition: alugrid/3d/geometry.hh:114
Definition: topology.hh:13
MappingType map_
the mapping
Definition: alugrid/3d/geometry.hh:81
FieldVector< ctype, mydim > LocalCoordinate
type of local coordinates
Definition: alugrid/3d/geometry.hh:657
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:315
FieldMatrix< alu3d_ctype, corners, cdim > CoordinateMatrixType
the vertex coordinates
Definition: alugrid/3d/geometry.hh:58
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
bool valid() const
Definition: alugrid/3d/geometry.hh:167
GeometryImplBase()
default constructor
Definition: alugrid/3d/geometry.hh:93
CoordinateMatrixType Type
Definition: alugrid/3d/geometry.hh:63
Definition: topology.hh:16
organize the memory management for entitys used by the NeighborIterator
Definition: alugrid/2d/grid.hh:68
Definition: topology.hh:13
Different resources needed by all grid implementations.
void buildMapping(const vector_t &, const vector_t &, const vector_t &, const vector_t &)
Definition: alugrid/3d/geometry.hh:47
Definition: alugrid/3d/entity.hh:32
GeometryImplType * geoImpl_
Definition: alugrid/3d/geometry.hh:790
void invalidate()
invalidate geometry implementation to avoid errors
void update(const CoordPtrType &p0, const CoordPtrType &p1, const CoordPtrType &p2, const CoordPtrType &p3)
Definition: alugrid/3d/geometry.hh:361
signed char status_
the status (see different status above)
Definition: alugrid/3d/geometry.hh:90
Definition: topology.hh:40
Definition: alugrid/3d/geometry.hh:37
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:374
void invalidate()
Definition: alugrid/3d/geometry.hh:164
GlobalCoordinate global(const LocalCoordinate &local) const
void update(const CoordPtrType &p0, const CoordPtrType &p1, const CoordPtrType &p2)
Definition: alugrid/3d/geometry.hh:304
ALUMemoryProvider< GeometryImplType > GeometryProviderType
Definition: alugrid/3d/geometry.hh:767
static const signed char updated
Definition: alugrid/3d/geometry.hh:43
FieldMatrix< ctype, mydim, cdim > JacobianTransposed
type of jacobian transposed
Definition: alugrid/3d/geometry.hh:666
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:205
CoordinateStorageType coord_
to coordinates
Definition: alugrid/3d/geometry.hh:78
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:253
Definition: alu3dinclude.hh:201
void setVolume(const double volume)
Definition: alugrid/3d/geometry.hh:170
void getObject()
get a new pointer object
ctype volume() const
returns volume of geometry
GeometryType type() const
void update(const CoordPtrType &p0, const CoordPtrType &p1)
Definition: alugrid/3d/geometry.hh:265
void update(const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &, const CoordPtrType &) const
Definition: alugrid/3d/geometry.hh:134
ALU3dGridElementType
Definition: topology.hh:13
void update(const CoordPtrType &p0, const CoordPtrType &p1, const CoordPtrType &p2, const CoordPtrType &p3, const CoordPtrType &p4, const CoordPtrType &p5, const CoordPtrType &p6, const CoordPtrType &p7)
Definition: alugrid/3d/geometry.hh:441
bool buildGeom(const IMPLElementType &item)
Methods that not belong to the Interface, but have to be public.
int corners() const
return the number of corners of this element. Corners are numbered 0..n-1
CoordTypeExtractorType< 0, dim >::Type CoordinateStorageType
Definition: alugrid/3d/geometry.hh:72
void removeObj()
remove pointer object
bool valid() const
Definition: alugrid/3d/geometry.hh:508
general type of geometry implementation
Definition: alugrid/3d/geometry.hh:178
double volume() const
Definition: alugrid/3d/geometry.hh:173
Definition: mappings.hh:30
bool operator!() const
return true if object has no references anymore
Definition: alugrid/3d/geometry.hh:117
bool valid() const
invalidate geometry implementation to avoid errors
bool buildGeomInFather(const GeometryType &fatherGeom, const GeometryType &myGeom)
build geometry of local coordinates relative to father
bool stillUsed() const
return true if there exists more then on reference
Definition: alugrid/3d/geometry.hh:120
GlobalCoordinate corner(int i) const
access to coordinates of corners. Index is the number of the corner
Definition: objectfactory.hh:26
MappingType & mapping()
Definition: alugrid/3d/geometry.hh:611
bool affine() const
returns true if mapping is affine
GeometryImpl()
constructor creating geo impl
Definition: alugrid/3d/geometry.hh:411
void operator++()
increase reference count
Definition: alugrid/3d/geometry.hh:111
double volume_
volume of element
Definition: alugrid/3d/geometry.hh:84
const alu3d_ctype * point(const int i) const
Definition: alugrid/3d/geometry.hh:551
Mapping MappingType
the type of the mapping
Definition: alugrid/3d/geometry.hh:75
static void copy(const CoordPtrType &p, CoordinateVectorType &c)
Definition: alugrid/3d/geometry.hh:124
~ALU3dGridGeometry()
destructor decreasing reference count and freeing object
void update(const CoordPtrType &, const CoordPtrType &, const CoordPtrType &) const
Definition: alugrid/3d/geometry.hh:156
LocalCoordinate local(const GlobalCoordinate &global) const