Dune Core Modules (2.4.1)

intersection.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_ALBERTA_INTERSECTION_HH
4#define DUNE_ALBERTA_INTERSECTION_HH
5
6#include <dune/grid/common/intersection.hh>
7
8#include <dune/grid/albertagrid/transformation.hh>
10#include <dune/grid/albertagrid/geometry.hh>
11
12#if HAVE_ALBERTA
13
14namespace 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 >
29 class AlbertaGridIntersectionBase
30 {
31 typedef AlbertaGridIntersectionBase< Grid > This;
32
33 public:
34 typedef typename Grid::ctype ctype;
35
36 static const int dimension = Grid::dimension;
37 static const int dimensionworld = Grid::dimensionworld;
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
48 typedef Alberta::ElementInfo< dimension > ElementInfo;
49
50 protected:
51 typedef AlbertaGridEntity< 0, dimension, Grid > EntityImp;
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
61 AlbertaGridIntersectionBase ();
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
84 AlbertaTransformation transformation () const;
85
86
87 const Grid &grid () const;
88 const ElementInfo &elementInfo () const;
89
90 protected:
91 const Grid *grid_;
92 ElementInfo elementInfo_;
93 int oppVertex_;
94 };
95
96
97
98 // AlbertaGridLeafIntersection
99 // ---------------------------
100
101 template< class GridImp >
102 class AlbertaGridLeafIntersection
103 : public AlbertaGridIntersectionBase< GridImp >
104 {
105 typedef AlbertaGridLeafIntersection< GridImp > This;
106 typedef AlbertaGridIntersectionBase< GridImp > Base;
107
108 friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
109
110 public:
111 typedef This ImplementationType;
112
113 static const int dimension = Base::dimension;
114 static const int dimensionworld = Base::dimensionworld;
115
116 typedef typename Base::NormalVector NormalVector;
117 typedef typename Base::LocalCoordType LocalCoordType;
118
119 typedef typename Base::Entity Entity;
120 typedef typename Base::EntityPointer EntityPointer;
121
122 typedef typename Base::Geometry Geometry;
123 typedef typename Base::LocalGeometry LocalGeometry;
124
125 typedef typename Base::ElementInfo ElementInfo;
126
127 protected:
128 typedef typename Base::EntityImp EntityImp;
129
130 typedef typename Base::GeometryImpl GeometryImpl;
131 typedef typename Base::LocalGeometryImpl LocalGeometryImpl;
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
142 AlbertaGridLeafIntersection ()
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
167 LocalGeometry geometryInInside () const;
168 LocalGeometry geometryInOutside () const;
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
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:408
@ dimension
The dimension of the grid.
Definition: grid.hh:402
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:548
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
provides a wrapper for ALBERTA's el_info structure
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:230
Dune namespace.
Definition: alignment.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)