dune-grid  2.4.1
albertagrid/intersection.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_ALBERTA_INTERSECTION_HH
4 #define DUNE_ALBERTA_INTERSECTION_HH
5 
7 
11 
12 #if HAVE_ALBERTA
13 
14 namespace Dune
15 {
16 
17  // External Forward Declarations
18  // -----------------------------
19 
20  template< int codim, int dim, class GridImp >
21  class AlbertaGridEntity;
22 
23 
24 
25  // AlbertaGridIntersectionBase
26  // ---------------------------
27 
28  template< class Grid >
30  {
32 
33  public:
34  typedef typename Grid::ctype ctype;
35 
36  static const int dimension = Grid::dimension;
38 
39  typedef FieldVector< ctype, dimensionworld > NormalVector;
40  typedef FieldVector< ctype, dimension-1 > LocalCoordType;
41 
42  typedef typename Grid::template Codim< 0 >::Entity Entity;
43  typedef typename Grid::template Codim< 0 >::EntityPointer EntityPointer;
44 
45  typedef typename Grid::template Codim< 1 >::Geometry Geometry;
46  typedef typename Grid::template Codim< 1 >::LocalGeometry LocalGeometry;
47 
49 
50  protected:
52 
53  typedef typename Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
54  typedef typename Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
55 
56  struct GlobalCoordReader;
57  struct LocalCoordReader;
58 
59  public:
60 
62 
63  AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex );
64 
65  Entity inside () const;
66 
67  bool boundary () const;
68  int boundaryId () const;
69  size_t boundarySegmentIndex () const;
70 
71  int indexInInside () const;
72 
73  GeometryType type () const;
74 
75  NormalVector centerIntegrationOuterNormal () const;
76  NormalVector centerOuterNormal () const;
77  NormalVector centerUnitOuterNormal () const;
78 
79  NormalVector integrationOuterNormal ( const LocalCoordType &local ) const;
80  NormalVector outerNormal ( const LocalCoordType &local ) const;
81  NormalVector unitOuterNormal ( const LocalCoordType &local ) const;
82 
83 
85 
86 
87  const Grid &grid () const;
88  const ElementInfo &elementInfo () const;
89 
90  protected:
91  const Grid *grid_;
92  ElementInfo elementInfo_;
94  };
95 
96 
97 
98  // AlbertaGridLeafIntersection
99  // ---------------------------
100 
101  template< class GridImp >
103  : public AlbertaGridIntersectionBase< GridImp >
104  {
107 
108  friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
109 
110  public:
111  typedef This ImplementationType;
112 
113  static const int dimension = Base::dimension;
115 
118 
119  typedef typename Base::Entity Entity;
121 
122  typedef typename Base::Geometry Geometry;
124 
125  typedef typename Base::ElementInfo ElementInfo;
126 
127  protected:
128  typedef typename Base::EntityImp EntityImp;
129 
132 
133  typedef typename Base::GlobalCoordReader GlobalCoordReader;
134  typedef typename Base::LocalCoordReader LocalCoordReader;
135 
136  public:
137  using Base::grid;
138  using Base::elementInfo;
139 
140  using Base::inside;
141 
143  {}
144 
145  AlbertaGridLeafIntersection ( const EntityImp &entity, const int n );
146 
147  AlbertaGridLeafIntersection ( const This &other );
148 
149  bool equals( const AlbertaGridLeafIntersection& other ) const
150  {
151  return (*this) == other;
152  }
153 
154  This &operator= ( const This &other );
155 
156  bool operator== ( const This &other ) const;
157 
158  void next ();
159 
160  typename GridImp::template Codim< 0 >::Entity
161  outside () const;
162 
163  bool neighbor () const;
164 
165  bool conforming () const;
166 
169 
170  Geometry geometry () const;
171 
172  int indexInOutside () const;
173 
174 
175  int twistInInside () const;
176  int twistInOutside () const;
177 
178  protected:
179  using Base::oppVertex_;
180 
181  private:
182  mutable ElementInfo neighborInfo_;
183  };
184 
185 } // namespace Dune
186 
187 #endif // #if HAVE_ALBERTA
188 
189 #endif // #ifndef DUNE_ALBERTA_INTERSECTION_HH
FieldVector< ctype, dimensionworld > NormalVector
Definition: albertagrid/intersection.hh:39
The dimension of the world the grid lives in.
Definition: common/grid.hh:408
NormalVector centerOuterNormal() const
Definition: albertagrid/intersection.cc:171
Base::LocalCoordReader LocalCoordReader
Definition: albertagrid/intersection.hh:134
Grid::template Codim< 1 >::Geometry Geometry
Definition: albertagrid/intersection.hh:45
int twistInOutside() const
Definition: albertagrid/intersection.cc:484
void next()
Definition: albertagrid/intersection.cc:389
int oppVertex_
Definition: albertagrid/intersection.hh:93
Definition: albertagrid/intersection.hh:29
ElementInfo elementInfo_
Definition: albertagrid/intersection.hh:92
Entity inside() const
Definition: albertagrid/intersection.cc:34
int boundaryId() const
Definition: albertagrid/intersection.cc:49
Base::LocalGeometryImpl LocalGeometryImpl
Definition: albertagrid/intersection.hh:131
Definition: albertagrid/transformation.hh:15
LocalGeometry geometryInInside() const
Definition: albertagrid/intersection.cc:430
bool operator==(const This &other) const
Definition: albertagrid/intersection.cc:383
Base::Geometry Geometry
Definition: albertagrid/intersection.hh:122
NormalVector centerIntegrationOuterNormal() const
Definition: albertagrid/intersection.cc:90
GeometryType type() const
Definition: albertagrid/intersection.cc:81
int indexInOutside() const
Definition: albertagrid/intersection.cc:465
Grid::ctype ctype
Definition: albertagrid/intersection.hh:34
bool conforming() const
Definition: albertagrid/intersection.cc:415
LocalGeometry geometryInOutside() const
Definition: albertagrid/intersection.cc:441
Geometry geometry() const
Definition: albertagrid/intersection.cc:456
AlbertaGridIntersectionBase()
Definition: albertagrid/intersection.cc:17
const Grid * grid_
Definition: albertagrid/intersection.hh:91
NormalVector outerNormal(const LocalCoordType &local) const
Definition: albertagrid/intersection.cc:197
AlbertaGridLeafIntersection()
Definition: albertagrid/intersection.hh:142
static const int dimensionworld
Definition: albertagrid/intersection.hh:37
Base::EntityImp EntityImp
Definition: albertagrid/intersection.hh:128
GridImp::template Codim< 0 >::Entity outside() const
Definition: albertagrid/intersection.cc:398
Grid::template Codim< 0 >::Entity Entity
Definition: albertagrid/intersection.hh:42
Base::NormalVector NormalVector
Definition: albertagrid/intersection.hh:116
static const int dimensionworld
Definition: albertagrid/intersection.hh:114
Alberta::ElementInfo< dimension > ElementInfo
Definition: albertagrid/intersection.hh:48
Wrapper class for geometries.
Definition: common/geometry.hh:65
int twistInInside() const
Definition: albertagrid/intersection.cc:476
NormalVector unitOuterNormal(const LocalCoordType &local) const
Definition: albertagrid/intersection.cc:205
Base::Entity Entity
Definition: albertagrid/intersection.hh:119
size_t boundarySegmentIndex() const
Definition: albertagrid/intersection.cc:63
Grid::template Codim< 0 >::EntityPointer EntityPointer
Definition: albertagrid/intersection.hh:43
const Grid & grid() const
Definition: albertagrid/intersection.cc:220
This & operator=(const This &other)
Definition: albertagrid/intersection.cc:373
AlbertaGridEntity< 0, dimension, Grid > EntityImp
Definition: albertagrid/intersection.hh:51
int indexInInside() const
Definition: albertagrid/intersection.cc:73
Grid::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: albertagrid/intersection.hh:46
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:388
Base::LocalCoordType LocalCoordType
Definition: albertagrid/intersection.hh:117
NormalVector centerUnitOuterNormal() const
Definition: albertagrid/intersection.cc:179
static const int dimension
Definition: albertagrid/intersection.hh:36
Definition: albertagrid/entity.hh:30
provides a wrapper for ALBERTA's el_info structure
The dimension of the grid.
Definition: common/grid.hh:402
Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl
Definition: albertagrid/intersection.hh:54
Base::GlobalCoordReader GlobalCoordReader
Definition: albertagrid/intersection.hh:133
Base::EntityPointer EntityPointer
Definition: albertagrid/intersection.hh:120
bool neighbor() const
Definition: albertagrid/intersection.cc:421
Base::GeometryImpl GeometryImpl
Definition: albertagrid/intersection.hh:130
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:548
Include standard header files.
Definition: agrid.hh:59
Definition: albertagrid/entity.hh:45
bool boundary() const
Definition: albertagrid/intersection.cc:42
Base::LocalGeometry LocalGeometry
Definition: albertagrid/intersection.hh:123
FieldVector< ctype, dimension-1 > LocalCoordType
Definition: albertagrid/intersection.hh:40
bool equals(const AlbertaGridLeafIntersection &other) const
Definition: albertagrid/intersection.hh:149
Base::ElementInfo ElementInfo
Definition: albertagrid/intersection.hh:125
AlbertaTransformation transformation() const
Definition: albertagrid/intersection.cc:213
NormalVector integrationOuterNormal(const LocalCoordType &local) const
Definition: albertagrid/intersection.cc:189
static const int dimension
Definition: albertagrid/intersection.hh:113
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
const ElementInfo & elementInfo() const
Definition: albertagrid/intersection.cc:228
Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl
Definition: albertagrid/intersection.hh:53