dune-grid  2.2.1
albertagrid/intersection.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALBERTA_INTERSECTION_HH
2 #define DUNE_ALBERTA_INTERSECTION_HH
3 
5 
9 
10 #if HAVE_ALBERTA
11 
12 namespace Dune
13 {
14 
15  // External Forward Declarations
16  // -----------------------------
17 
18  template< int codim, int dim, class GridImp >
19  class AlbertaGridEntity;
20 
21 
22 
23  // AlbertaGridIntersectionBase
24  // ---------------------------
25 
26  template< class Grid >
28  {
30 
31  public:
32  typedef typename Grid::ctype ctype;
33 
34  static const int dimension = Grid::dimension;
36 
37  typedef FieldVector< ctype, dimensionworld > NormalVector;
38  typedef FieldVector< ctype, dimension-1 > LocalCoordType;
39 
40  typedef typename Grid::template Codim< 0 >::Entity Entity;
41  typedef typename Grid::template Codim< 0 >::EntityPointer EntityPointer;
42 
43  typedef typename Grid::template Codim< 1 >::Geometry Geometry;
44  typedef typename Grid::template Codim< 1 >::LocalGeometry LocalGeometry;
45 
47 
48  protected:
50 
51  typedef typename Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
52  typedef typename Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
53 
54  struct GlobalCoordReader;
55  struct LocalCoordReader;
56 
57  public:
58  AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex );
59 
60  EntityPointer inside () const;
61 
62  bool boundary () const;
63  int boundaryId () const;
64  size_t boundarySegmentIndex () const;
65 
66  int indexInInside () const;
67 
68  GeometryType type () const;
69 
73 
74  NormalVector integrationOuterNormal ( const LocalCoordType &local ) const;
75  NormalVector outerNormal ( const LocalCoordType &local ) const;
76  NormalVector unitOuterNormal ( const LocalCoordType &local ) const;
77 
78 
80 
81 
82  const Grid &grid () const;
83  const ElementInfo &elementInfo () const;
84 
85  protected:
86  const Grid *grid_;
89  };
90 
91 
92 
93  // AlbertaGridLeafIntersection
94  // ---------------------------
95 
96  template< class GridImp >
98  : public AlbertaGridIntersectionBase< GridImp >
99  {
102 
103  friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
104 
105  public:
107 
108  static const int dimension = Base::dimension;
110 
113 
114  typedef typename Base::Entity Entity;
116 
117  typedef typename Base::Geometry Geometry;
119 
120  typedef typename Base::ElementInfo ElementInfo;
121 
122  protected:
123  typedef typename Base::EntityImp EntityImp;
124 
127 
128  typedef typename Base::GlobalCoordReader GlobalCoordReader;
129  typedef typename Base::LocalCoordReader LocalCoordReader;
130 
131  public:
132  using Base::grid;
133  using Base::elementInfo;
134 
135  using Base::inside;
136 
137  AlbertaGridLeafIntersection ( const EntityImp &entity, const int n );
138 
139  AlbertaGridLeafIntersection ( const This &other );
140 
141  This &operator= ( const This &other );
142 
143  bool operator== ( const This &other ) const;
144 
145  void next ();
146 
147  EntityPointer outside () const;
148 
149  bool neighbor () const;
150 
151  bool conforming () const;
152 
155 
156  Geometry geometry () const;
157 
158  int indexInOutside () const;
159 
160 
161  int twistInInside () const;
162  int twistInOutside () const;
163 
164  protected:
165  using Base::oppVertex_;
166 
167  private:
168  mutable ElementInfo neighborInfo_;
169  };
170 
171 } // namespace Dune
172 
173 #endif // #if HAVE_ALBERTA
174 
175 #endif // #ifndef DUNE_ALBERTA_INTERSECTION_HH