1#ifndef DUNE_ALUGRID_3D_GRIDVIEW_HH
2#define DUNE_ALUGRID_3D_GRIDVIEW_HH
10#include <dune/grid/common/gridview.hh>
15 template<
class Gr
idImp, PartitionIteratorType pitype >
16 class ALU3dLevelGridView;
18 template<
class Gr
idImp, PartitionIteratorType pitype >
19 class ALU3dLeafGridView;
22 template<
class Gr
idImp, PartitionIteratorType pitype >
23 struct ALU3dLevelGridViewTraits
25 typedef ALU3dLevelGridView< GridImp, pitype > GridViewImp;
28 typedef typename std::remove_const<GridImp>::type Grid;
31 typedef typename Grid :: Traits :: LevelIndexSet IndexSet;
34 typedef typename Grid :: Traits :: LevelIntersection Intersection;
37 typedef typename Grid :: Traits :: LevelIntersectionIterator
41 typedef typename Grid :: Traits :: Communication Communication;
47 typedef typename Grid::Traits::template Codim< cd >::Twists Twists;
48 typedef typename Twists::Twist Twist;
50 typedef typename Grid :: Traits
51 :: template
Codim< cd > :: template Partition< pitype > :: LevelIterator
54 typedef typename Grid :: Traits :: template
Codim< cd > :: Entity Entity;
56 typedef typename Grid :: template
Codim< cd > :: Geometry Geometry;
57 typedef typename Grid :: template
Codim< cd > :: LocalGeometry
61 template< PartitionIteratorType pit >
71 enum {
conforming = Capabilities :: isLevelwiseConforming< Grid > :: v };
75 template<
class Gr
idImp, PartitionIteratorType pitype >
76 class ALU3dLevelGridView
78 typedef ALU3dLevelGridView< GridImp, pitype > ThisType;
81 typedef ALU3dLevelGridViewTraits<GridImp,pitype> Traits;
84 typedef typename Traits::Grid Grid;
87 typedef typename Traits :: IndexSet IndexSet;
90 typedef typename Traits :: Intersection Intersection;
93 typedef typename Traits :: IntersectionIterator IntersectionIterator;
96 typedef typename Traits :: Communication Communication;
105 ALU3dLevelGridView (
const Grid &grid,
int level )
111 const Grid &grid ()
const
118 const IndexSet &indexSet ()
const
120 return grid().levelIndexSet( level_ );
124 bool isConforming()
const
128 return level_ == 0 ? true : ! grid().conformingRefinement();
132 int size (
int codim )
const
134 return grid().size( level_, codim );
138 int size (
const GeometryType &type )
const
140 return grid().size( level_, type );
147 return grid().template lbegin< cd, pitype >( level_ );
151 template<
int cd, PartitionIteratorType pit >
152 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
154 return grid().template lbegin< cd, pit >( level_ );
161 return grid().template lend< cd, pitype >( level_ );
165 template<
int cd, PartitionIteratorType pit >
166 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
168 return grid().template lend< cd, pit >( level_ );
173 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
175 return grid().ilevelbegin( entity );
180 iend (
const typename Codim< 0 > :: Entity &entity )
const
182 return grid().ilevelend( entity );
186 const Communication &comm ()
const
188 return grid().comm();
192 int overlapSize(
int codim)
const
194 return grid().overlapSize(level_, codim);
198 int ghostSize(
int codim)
const
200 return grid().ghostSize(level_, codim);
204 template<
class DataHandle,
class Data >
205 typename Grid::LevelCommunication communicate ( CommDataHandleIF< DataHandle, Data > &data,
209 return grid().communicate( data, iftype, dir, level_ );
213 typename Codim< cd >::Twists twists ( GeometryType type )
const
215 return grid().template twists< cd >( type );
224 template<
class Gr
idImp, PartitionIteratorType pitype >
225 struct ALU3dLeafGridViewTraits {
226 typedef ALU3dLeafGridView< GridImp, pitype > GridViewImp;
229 typedef typename std::remove_const<GridImp>::type Grid;
232 typedef typename Grid :: Traits :: LeafIndexSet IndexSet;
235 typedef typename Grid :: Traits :: LeafIntersection Intersection;
238 typedef typename Grid :: Traits :: LeafIntersectionIterator
239 IntersectionIterator;
242 typedef typename Grid :: Traits :: Communication Communication;
248 typedef typename Grid::Traits::template Codim< cd >::Twists Twists;
249 typedef typename Twists::Twist Twist;
251 typedef typename Grid :: Traits
252 :: template
Codim< cd > :: template Partition< pitype > :: LeafIterator
255 typedef typename Grid :: Traits :: template
Codim< cd > :: Entity Entity;
257 typedef typename Grid :: template
Codim< cd > :: Geometry Geometry;
258 typedef typename Grid :: template
Codim< cd > :: LocalGeometry
262 template <PartitionIteratorType pit >
272 enum {
conforming = Capabilities :: isLeafwiseConforming< Grid > :: v };
276 template<
class Gr
idImp, PartitionIteratorType pitype >
277 class ALU3dLeafGridView
279 typedef ALU3dLeafGridView< GridImp, pitype > ThisType;
282 typedef ALU3dLeafGridViewTraits<GridImp,pitype> Traits;
285 typedef typename Traits::Grid Grid;
288 typedef typename Traits :: IndexSet IndexSet;
291 typedef typename Traits :: Intersection Intersection;
294 typedef typename Traits :: IntersectionIterator IntersectionIterator;
297 typedef typename Traits :: Communication Communication;
307 ALU3dLeafGridView (
const Grid &grid )
312 const Grid &grid ()
const
319 const IndexSet &indexSet ()
const
321 return grid().leafIndexSet();
325 bool isConforming()
const {
return grid().conformingRefinement(); }
328 int size (
int codim )
const
330 return grid().size( codim );
334 int size (
const GeometryType &type )
const
336 return grid().size( type );
343 return grid().template leafbegin< cd, pitype >();
347 template<
int cd, PartitionIteratorType pit >
348 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
350 return grid().template leafbegin< cd, pit >();
357 return grid().template leafend< cd, pitype >();
361 template<
int cd, PartitionIteratorType pit >
362 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
364 return grid().template leafend< cd, pit >();
369 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
371 return grid().ileafbegin( entity );
376 iend (
const typename Codim< 0 > :: Entity &entity )
const
378 return grid().ileafend( entity );
382 const Communication &comm ()
const
384 return grid().comm();
388 int overlapSize(
int codim)
const
390 return grid().overlapSize(codim);
394 int ghostSize(
int codim)
const
396 return grid().ghostSize(codim);
400 template<
class DataHandle,
class Data >
401 typename Grid::LeafCommunication communicate ( CommDataHandleIF< DataHandle, Data > &data,
405 return grid().communicate( data, iftype, dir );
409 typename Codim< cd >::Twists twists ( GeometryType type )
const
411 return grid().template twists< cd >( type );
Grid abstract base class.
Definition: grid.hh:375
A few common exception classes.
A set of traits classes to store static information about grid implementation.
Dune namespace.
Definition: alignedallocator.hh:13
Communication< T > CollectiveCommunication
Definition: communication.hh:541
@ conforming
use only conforming bisection refinement
Definition: declaration.hh:25
Define types needed to iterate over entities of a given partition type.
Definition: gridview.hh:264
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: gridview.hh:268
Codim Structure.
Definition: gridview.hh:302
Define types needed to iterate over entities of a given partition type.
Definition: gridview.hh:63
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: gridview.hh:67
Codim Structure.
Definition: gridview.hh:101
Various macros to work with Dune module version numbers.