5#ifndef DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
6#define DUNE_GRID_COMMON_DEFAULTGRIDVIEW_HH
12#include <dune/grid/common/gridview.hh>
17 template<
class Gr
idImp >
18 class DefaultLevelGridView;
20 template<
class Gr
idImp >
21 class DefaultLeafGridView;
24 template<
class Gr
idImp >
25 struct DefaultLevelGridViewTraits
27 typedef DefaultLevelGridView< GridImp > GridViewImp;
30 typedef typename std::remove_const<GridImp>::type Grid;
33 typedef typename Grid :: Traits :: LevelIndexSet IndexSet;
36 typedef typename Grid :: Traits :: LevelIntersection Intersection;
39 typedef typename Grid :: Traits :: LevelIntersectionIterator
43 typedef typename Grid :: Traits :: Communication Communication;
46 [[deprecated(
"Use Communication instead!")]]
52 typedef typename Grid :: Traits
53 :: template Codim< cd > :: template Partition< All_Partition > :: LevelIterator
56 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
58 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
59 typedef typename Grid :: template Codim< cd > :: LocalGeometry
63 template< PartitionIteratorType pit >
67 typedef typename Grid :: template Codim< cd >
73 constexpr static bool conforming = Capabilities :: isLevelwiseConforming< Grid > :: v;
77 template<
class Gr
idImp >
78 class DefaultLevelGridView
80 typedef DefaultLevelGridView< GridImp > ThisType;
83 typedef DefaultLevelGridViewTraits<GridImp> Traits;
86 typedef typename Traits::Grid
Grid;
89 typedef typename Traits :: IndexSet
IndexSet;
98 typedef typename Grid :: Traits :: Communication
Communication;
101 [[deprecated(
"Use Communication instead!")]]
108 constexpr static bool conforming = Traits :: conforming;
110 DefaultLevelGridView (
const Grid &grid,
int level )
116 const Grid &grid ()
const
123 const IndexSet &indexSet ()
const
125 return grid().levelIndexSet( level_ );
129 bool isConforming()
const {
return bool(Traits::conforming); }
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 );
145 typename Codim< cd > :: Iterator begin ()
const
147 return grid().template lbegin< cd, All_Partition >( 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_ );
159 typename Codim< cd > :: Iterator end ()
const
161 return grid().template lend< cd, All_Partition >( 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 entity.impl().ilevelbegin();
180 iend (
const typename Codim< 0 > :: Entity &entity )
const
182 return entity.impl().ilevelend();
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 DataHandleImp,
class DataType >
205 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
209 return grid().communicate( data, iftype, dir, level_ );
218 template<
class Gr
idImp >
219 struct DefaultLeafGridViewTraits {
220 typedef DefaultLeafGridView< GridImp > GridViewImp;
223 typedef typename std::remove_const<GridImp>::type Grid;
226 typedef typename Grid :: Traits :: LeafIndexSet IndexSet;
229 typedef typename Grid :: Traits :: LeafIntersection Intersection;
232 typedef typename Grid :: Traits :: LeafIntersectionIterator
233 IntersectionIterator;
236 typedef typename Grid :: Traits :: Communication Communication;
239 [[deprecated(
"Use Communication instead!")]]
245 typedef typename Grid :: Traits
246 :: template Codim< cd > :: template Partition< All_Partition > :: LeafIterator
249 typedef typename Grid :: Traits :: template Codim< cd > :: Entity Entity;
251 typedef typename Grid :: template Codim< cd > :: Geometry Geometry;
252 typedef typename Grid :: template Codim< cd > :: LocalGeometry
256 template <PartitionIteratorType pit >
260 typedef typename Grid :: template Codim< cd >
266 constexpr static bool conforming = Capabilities :: isLeafwiseConforming< Grid > :: v;
270 template<
class Gr
idImp >
271 class DefaultLeafGridView
273 typedef DefaultLeafGridView< GridImp > ThisType;
276 typedef DefaultLeafGridViewTraits<GridImp> Traits;
279 typedef typename Traits::Grid
Grid;
282 typedef typename Traits :: IndexSet
IndexSet;
291 typedef typename Grid :: Traits :: Communication
Communication;
294 [[deprecated(
"Use Communication instead!")]]
301 constexpr static bool conforming = Traits :: conforming;
304 DefaultLeafGridView (
const Grid &grid )
309 const Grid &grid ()
const
316 const IndexSet &indexSet ()
const
318 return grid().leafIndexSet();
322 bool isConforming()
const {
return bool(Traits::conforming); }
325 int size (
int codim )
const
327 return grid().size( codim );
331 int size (
const GeometryType &type )
const
333 return grid().size( type );
338 typename Codim< cd > :: Iterator begin ()
const
340 return grid().template leafbegin< cd, All_Partition >();
344 template<
int cd, PartitionIteratorType pit >
345 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
347 return grid().template leafbegin< cd, pit >();
352 typename Codim< cd > :: Iterator end ()
const
354 return grid().template leafend< cd, All_Partition >();
358 template<
int cd, PartitionIteratorType pit >
359 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
361 return grid().template leafend< cd, pit >();
366 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
368 return entity.impl().ileafbegin();
373 iend (
const typename Codim< 0 > :: Entity &entity )
const
375 return entity.impl().ileafend();
379 const Communication &comm ()
const
381 return grid().comm();
385 int overlapSize(
int codim)
const
387 return grid().overlapSize(codim);
391 int ghostSize(
int codim)
const
393 return grid().ghostSize(codim);
397 template<
class DataHandleImp,
class DataType >
398 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
402 return grid().communicate( data, iftype, dir );
Collective communication interface and sequential default implementation.
Definition: communication.hh:100
Grid abstract base class.
Definition: grid.hh:375
Index Set Interface base class.
Definition: indexidset.hh:78
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
A set of traits classes to store static information about grid implementation.
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:13
Communication< T > CollectiveCommunication
Definition: communication.hh:541
Define types needed to iterate over entities of a given partition type.
Definition: defaultgridview.hh:258
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: defaultgridview.hh:262
Codim Structure.
Definition: defaultgridview.hh:299
Define types needed to iterate over entities of a given partition type.
Definition: defaultgridview.hh:65
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: defaultgridview.hh:69
Codim Structure.
Definition: defaultgridview.hh:106
Traits for type conversions and type information.