Dune Core Modules (2.5.0)

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
44 typedef typename Grid::template Codim< 1 >::Geometry Geometry;
45 typedef typename Grid::template Codim< 1 >::LocalGeometry LocalGeometry;
46
47 typedef Alberta::ElementInfo< dimension > ElementInfo;
48
49 protected:
50 typedef AlbertaGridEntity< 0, dimension, Grid > EntityImp;
51
52 typedef typename Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
53 typedef typename Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
54
55 struct GlobalCoordReader;
56 struct LocalCoordReader;
57
58 public:
59
60 AlbertaGridIntersectionBase ();
61
62 AlbertaGridIntersectionBase ( const EntityImp &entity, const int oppVertex );
63
64 Entity inside () const;
65
66 bool boundary () const;
67 int boundaryId () const;
68 size_t boundarySegmentIndex () const;
69
70 int indexInInside () const;
71
72 GeometryType type () const;
73
74 NormalVector centerIntegrationOuterNormal () const;
75 NormalVector centerOuterNormal () const;
76 NormalVector centerUnitOuterNormal () const;
77
78 NormalVector integrationOuterNormal ( const LocalCoordType &local ) const;
79 NormalVector outerNormal ( const LocalCoordType &local ) const;
80 NormalVector unitOuterNormal ( const LocalCoordType &local ) const;
81
82
83 AlbertaTransformation transformation () const;
84
85
86 const Grid &grid () const;
87 const ElementInfo &elementInfo () const;
88
89 protected:
90 const Grid *grid_;
91 ElementInfo elementInfo_;
92 int oppVertex_;
93 };
94
95
96
97 // AlbertaGridLeafIntersection
98 // ---------------------------
99
100 template< class GridImp >
101 class AlbertaGridLeafIntersection
102 : public AlbertaGridIntersectionBase< GridImp >
103 {
104 typedef AlbertaGridLeafIntersection< GridImp > This;
105 typedef AlbertaGridIntersectionBase< GridImp > Base;
106
107 friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
108
109 public:
110 typedef This ImplementationType;
111
112 static const int dimension = Base::dimension;
113 static const int dimensionworld = Base::dimensionworld;
114
115 typedef typename Base::NormalVector NormalVector;
116 typedef typename Base::LocalCoordType LocalCoordType;
117
118 typedef typename Base::Entity Entity;
119
120 typedef typename Base::Geometry Geometry;
121 typedef typename Base::LocalGeometry LocalGeometry;
122
123 typedef typename Base::ElementInfo ElementInfo;
124
125 protected:
126 typedef typename Base::EntityImp EntityImp;
127
128 typedef typename Base::GeometryImpl GeometryImpl;
129 typedef typename Base::LocalGeometryImpl LocalGeometryImpl;
130
131 typedef typename Base::GlobalCoordReader GlobalCoordReader;
132 typedef typename Base::LocalCoordReader LocalCoordReader;
133
134 public:
135 using Base::grid;
136 using Base::elementInfo;
137
138 using Base::inside;
139
140 AlbertaGridLeafIntersection ()
141 {}
142
143 AlbertaGridLeafIntersection ( const EntityImp &entity, const int n );
144
145 AlbertaGridLeafIntersection ( const This &other );
146
147 bool equals( const AlbertaGridLeafIntersection& other ) const
148 {
149 return (*this) == other;
150 }
151
152 This &operator= ( const This &other );
153
154 bool operator== ( const This &other ) const;
155
156 void next ();
157
158 typename GridImp::template Codim< 0 >::Entity
159 outside () const;
160
161 bool neighbor () const;
162
163 bool conforming () const;
164
165 LocalGeometry geometryInInside () const;
166 LocalGeometry geometryInOutside () const;
167
168 Geometry geometry () const;
169
170 int indexInOutside () const;
171
172
173 int twistInInside () const;
174 int twistInOutside () const;
175
176 protected:
177 using Base::oppVertex_;
178
179 private:
180 mutable ElementInfo neighborInfo_;
181 };
182
183} // namespace Dune
184
185#endif // #if HAVE_ALBERTA
186
187#endif // #ifndef DUNE_ALBERTA_INTERSECTION_HH
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:393
@ dimension
The dimension of the grid.
Definition: grid.hh:387
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:522
@ conforming
Output conforming data.
Definition: common.hh:70
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
provides a wrapper for ALBERTA's el_info structure
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:441
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:233
Dune namespace.
Definition: alignment.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)