3#ifndef DUNE_ALUGRID_MACROGRIDVIEW_HH
4#define DUNE_ALUGRID_MACROGRIDVIEW_HH
12#include <dune/grid/common/gridview.hh>
17 template<
class Gr
idImp, PartitionIteratorType pitype >
20 template<
class Gr
idImp, PartitionIteratorType pitype >
21 struct MacroGridViewTraits
23 typedef MacroGridView< GridImp, pitype > GridViewImp;
26 typedef typename std::remove_const<GridImp>::type Grid;
29 typedef typename Grid :: Traits :: LevelIndexSet IndexSet;
32 typedef typename Grid :: Traits :: LevelIntersection Intersection;
35 typedef typename Grid :: Traits :: LevelIntersectionIterator
39 typedef typename Grid :: Traits :: Communication Communication;
44 typedef typename Grid :: Traits
45 :: template
Codim< cd > :: template Partition< pitype > :: LevelIterator
48 typedef typename Grid :: Traits :: template
Codim< cd > :: Entity Entity;
50 typedef typename Grid :: template
Codim< cd > :: Geometry Geometry;
51 typedef typename Grid :: template
Codim< cd > :: LocalGeometry
55 template< PartitionIteratorType pit >
65 enum {
conforming = Capabilities :: isLevelwiseConforming< Grid > :: v };
69 template<
class Gr
idImp, PartitionIteratorType pitype >
72 typedef MacroGridView< GridImp, pitype > ThisType;
77 typedef MacroGridViewTraits< GridImp, pitype > 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 :: Communication Communication;
114 MacroGridView (
const Grid &grid )
120 const Grid &grid ()
const
127 const IndexSet &indexSet ()
const
129 return grid().levelIndexSet( level_ );
133 bool isConforming()
const
140 int size (
int codim )
const
142 return grid().size( level_, codim );
146 int size (
const GeometryType &type )
const
148 return grid().size( level_, type );
155 return grid().template lbegin< cd, pitype >( level_ );
159 template<
int cd, PartitionIteratorType pit >
160 typename Codim< cd > :: template Partition< pit > :: Iterator begin ()
const
162 return grid().template lbegin< cd, pit >( level_ );
169 return grid().template lend< cd, pitype >( level_ );
173 template<
int cd, PartitionIteratorType pit >
174 typename Codim< cd > :: template Partition< pit > :: Iterator end ()
const
176 return grid().template lend< cd, pit >( level_ );
181 ibegin (
const typename Codim< 0 > :: Entity &entity )
const
183 assert( entity.level() == level_ );
184 return grid().ilevelbegin( entity );
189 iend (
const typename Codim< 0 > :: Entity &entity )
const
191 assert( entity.level() == level_ );
192 return grid().ilevelend( entity );
196 const Communication &comm ()
const
198 return grid().comm();
202 int overlapSize(
int codim)
const
204 return grid().overlapSize(level_, codim);
208 int ghostSize(
int codim)
const
210 return grid().ghostSize(level_, codim);
214 template<
class DataHandleImp,
class DataType >
215 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
219 return grid().communicate( data, iftype, dir, level_ );
229 int master (
const typename Codim< 0 > :: Entity &entity )
const
231 return entity.impl().master();
235 int macroId (
const typename Codim< 0 > :: Entity &entity )
const
237 return entity.impl().macroId();
241 int weight (
const typename Codim< 0 > :: Entity &entity )
const
243 return entity.impl().weight();
248 int weight (
const Intersection &intersection )
const
250 return intersection.impl().weight();
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:390
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:532
A few common exception classes.
A set of traits classes to store static information about grid implementation.
Dune namespace.
Definition: alignedallocator.hh:13
@ conforming
use only conforming bisection refinement
Definition: declaration.hh:25
Define types needed to iterate over entities of a given partition type.
Definition: macrogridview.hh:57
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: macrogridview.hh:61
Codim Structure.
Definition: macrogridview.hh:96
Various macros to work with Dune module version numbers.