3 #ifndef DUNE_ALBERTAGRID_GRIDVIEW_HH
4 #define DUNE_ALBERTAGRID_GRIDVIEW_HH
8 #include <dune/common/typetraits.hh>
9 #include <dune/common/exceptions.hh>
19 template<
class Gr
idImp, PartitionIteratorType pitype >
22 template<
class Gr
idImp, PartitionIteratorType pitype >
26 template<
class Gr
idImp, PartitionIteratorType pitype >
32 typedef typename remove_const<GridImp>::type
Grid;
35 typedef typename Grid::Traits::LevelIndexSet
IndexSet;
41 typedef typename Grid::Traits::LevelIntersectionIterator
62 template< PartitionIteratorType pit >
75 template<
class Gr
idImp, PartitionIteratorType pitype >
76 class AlbertaLevelGridView
78 typedef AlbertaLevelGridView< GridImp, pitype > ThisType;
112 indexSet_( &(grid.levelIndexSet( level )) ),
119 : grid_( other.grid_ ),
120 indexSet_( other.indexSet_ ),
121 level_( other.level_ )
125 ThisType &operator= (
const ThisType & other)
128 indexSet_ = other.indexSet_;
129 level_ = other.level_;
148 return grid().size( level_, codim );
154 return grid().size( level_, type );
161 return grid().template lbegin< cd, pitype >( level_ );
165 template<
int cd, PartitionIteratorType pit >
168 return grid().template lbegin< cd, pit >( level_ );
175 return grid().template lend< cd, pitype >( level_ );
179 template<
int cd, PartitionIteratorType pit >
182 return grid().template lend< cd, pit >( level_ );
189 if(
grid().maxLevel() == 0)
196 DUNE_THROW( NotImplemented,
"method ibegin not implemented on LevelGridView for AlbertaGrid." );
213 return grid().comm();
219 return grid().overlapSize(level_, codim);
225 return grid().ghostSize(level_, codim);
229 template<
class DataHandleImp,
class DataType >
242 template<
class Gr
idImp, PartitionIteratorType pitype >
248 typedef typename remove_const<GridImp>::type
Grid;
251 typedef typename Grid::Traits::LeafIndexSet
IndexSet;
257 typedef typename Grid::Traits::LeafIntersectionIterator
278 template <PartitionIteratorType pit >
291 template<
class Gr
idImp, PartitionIteratorType pitype >
292 class AlbertaLeafGridView
294 typedef AlbertaLeafGridView< GridImp, pitype > ThisType;
328 indexSet_( &(grid.leafIndexSet()) )
334 : grid_( other.grid_ ),
335 indexSet_( other.indexSet_ )
339 ThisType &operator= (
const ThisType & other)
342 indexSet_ = other.indexSet_;
361 return grid().size( codim );
367 return grid().size( type );
374 return grid().template leafbegin< cd, pitype >();
378 template<
int cd, PartitionIteratorType pit >
381 return grid().template leafbegin< cd, pit >();
388 return grid().template leafend< cd, pitype >();
392 template<
int cd, PartitionIteratorType pit >
395 return grid().template leafend< cd, pit >();
402 const ElementInfo elementInfo = Grid::getRealImplementation( entity ).elementInfo();
403 assert( !!elementInfo );
408 if( elementInfo.
elInfo().opp_vertex[ i ] == 127 )
409 DUNE_THROW( NotImplemented,
"AlbertaGrid: Intersections on outside entities are not fully implemented, yet." );
411 #endif // #ifndef NDEBUG
421 assert( !!Grid::getRealImplementation( entity ).elementInfo() );
429 return grid().comm();
435 return grid().overlapSize(codim);
441 return grid().ghostSize(codim);
445 template<
class DataHandleImp,
class DataType >
458 #endif // #if HAVE_ALBERTA
459 #endif // #ifndef DUNE_ALBERTAGRID_GRIDVIEW_HH