3#ifndef DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
4#define DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
10#include <dune/grid/common/gridview.hh>
15 template<
class Gr
idImp >
16 class DefaultLevelGridView;
18 template<
class Gr
idImp >
19 class DefaultLeafGridView;
22 template<
class Gr
idImp >
23 struct DefaultLevelGridViewTraits
25 typedef DefaultLevelGridView< GridImp > 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 :: CollectiveCommunication CollectiveCommunication;
46 typedef typename Grid :: Traits
47 :: template Codim< cd > :: template Partition< All_Partition > :: LevelIterator
50 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
52 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
53 typedef typename Grid :: template Codim< cd > :: LocalGeometry
57 template< PartitionIteratorType pit >
61 typedef typename Grid :: template Codim< cd >
67 enum { conforming = Capabilities :: isLevelwiseConforming< Grid > :: v };
71 template<
class Gr
idImp >
72 class DefaultLevelGridView
74 typedef DefaultLevelGridView< GridImp > ThisType;
77 typedef DefaultLevelGridViewTraits<GridImp> Traits;
80 typedef typename Traits::Grid Grid;
83 typedef typename Traits :: IndexSet IndexSet;
86 typedef typename Traits :: Intersection Intersection;
89 typedef typename Traits :: IntersectionIterator IntersectionIterator;
92 typedef typename Traits :: CollectiveCommunication CollectiveCommunication;
98 enum { conforming = Traits :: conforming };
100 DefaultLevelGridView (
const Grid &grid,
int level )
106 const Grid &grid ()
const
113 const IndexSet &indexSet ()
const
115 return grid().levelIndexSet( level_ );
119 int size (
int codim )
const
121 return grid().size( level_, codim );
125 int size (
const GeometryType &type )
const
127 return grid().size( level_, type );
132 typename Codim< cd > :: Iterator begin ()
const
134 return grid().template lbegin< cd, All_Partition >( level_ );
138 template<
int cd, PartitionIteratorType pit >
139 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
141 return grid().template lbegin< cd, pit >( level_ );
146 typename Codim< cd > :: Iterator end ()
const
148 return grid().template lend< cd, All_Partition >( level_ );
152 template<
int cd, PartitionIteratorType pit >
153 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
155 return grid().template lend< cd, pit >( level_ );
160 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
162 return entity.impl().ilevelbegin();
167 iend (
const typename Codim< 0 > :: Entity &entity )
const
169 return entity.impl().ilevelend();
173 const CollectiveCommunication &comm ()
const
175 return grid().comm();
179 int overlapSize(
int codim)
const
181 return grid().overlapSize(level_, codim);
185 int ghostSize(
int codim)
const
187 return grid().ghostSize(level_, codim);
191 template<
class DataHandleImp,
class DataType >
192 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
196 return grid().communicate( data, iftype, dir, level_ );
205 template<
class Gr
idImp >
206 struct DefaultLeafGridViewTraits {
207 typedef DefaultLeafGridView< GridImp > GridViewImp;
210 typedef typename std::remove_const<GridImp>::type Grid;
213 typedef typename Grid :: Traits :: LeafIndexSet IndexSet;
216 typedef typename Grid :: Traits :: LeafIntersection Intersection;
219 typedef typename Grid :: Traits :: LeafIntersectionIterator
220 IntersectionIterator;
223 typedef typename Grid :: Traits :: CollectiveCommunication CollectiveCommunication;
228 typedef typename Grid :: Traits
229 :: template Codim< cd > :: template Partition< All_Partition > :: LeafIterator
232 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
234 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
235 typedef typename Grid :: template Codim< cd > :: LocalGeometry
239 template <PartitionIteratorType pit >
243 typedef typename Grid :: template Codim< cd >
249 enum { conforming = Capabilities :: isLeafwiseConforming< Grid > :: v };
253 template<
class Gr
idImp >
254 class DefaultLeafGridView
256 typedef DefaultLeafGridView< GridImp > ThisType;
259 typedef DefaultLeafGridViewTraits<GridImp> Traits;
262 typedef typename Traits::Grid Grid;
265 typedef typename Traits :: IndexSet IndexSet;
268 typedef typename Traits :: Intersection Intersection;
271 typedef typename Traits :: IntersectionIterator IntersectionIterator;
274 typedef typename Traits :: CollectiveCommunication CollectiveCommunication;
280 enum { conforming = Traits :: conforming };
283 DefaultLeafGridView (
const Grid &grid )
288 const Grid &grid ()
const
295 const IndexSet &indexSet ()
const
297 return grid().leafIndexSet();
301 int size (
int codim )
const
303 return grid().size( codim );
307 int size (
const GeometryType &type )
const
309 return grid().size( type );
314 typename Codim< cd > :: Iterator begin ()
const
316 return grid().template leafbegin< cd, All_Partition >();
320 template<
int cd, PartitionIteratorType pit >
321 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
323 return grid().template leafbegin< cd, pit >();
328 typename Codim< cd > :: Iterator end ()
const
330 return grid().template leafend< cd, All_Partition >();
334 template<
int cd, PartitionIteratorType pit >
335 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
337 return grid().template leafend< cd, pit >();
342 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
344 return entity.impl().ileafbegin();
349 iend (
const typename Codim< 0 > :: Entity &entity )
const
351 return entity.impl().ileafend();
355 const CollectiveCommunication &comm ()
const
357 return grid().comm();
361 int overlapSize(
int codim)
const
363 return grid().overlapSize(codim);
367 int ghostSize(
int codim)
const
369 return grid().ghostSize(codim);
373 template<
class DataHandleImp,
class DataType >
374 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
378 return grid().communicate( data, iftype, dir );
Grid abstract base class.
Definition: grid.hh:373
A set of traits classes to store static information about grid implementation.
A few common exception classes.
Dune namespace.
Definition: alignment.hh:11
Define types needed to iterate over entities of a given partition type.
Definition: defaultgridview.hh:241
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: defaultgridview.hh:245
Codim Structure.
Definition: defaultgridview.hh:278
Define types needed to iterate over entities of a given partition type.
Definition: defaultgridview.hh:59
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: defaultgridview.hh:63
Codim Structure.
Definition: defaultgridview.hh:96
Traits for type conversions and type information.