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 >
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)
192 return IntersectionIteratorImpl( Grid::getRealImplementation( entity ), begin );
196 DUNE_THROW( NotImplemented,
"method ibegin not implemented on LevelGridView for AlbertaGrid." );
198 return IntersectionIteratorImpl( Grid::getRealImplementation( entity ), end );
207 return IntersectionIteratorImpl( Grid::getRealImplementation( entity ), end );
211 const CollectiveCommunication &
comm ()
const 213 return grid().comm();
219 return grid().overlapSize(level_, codim);
225 return grid().ghostSize(level_, codim);
229 template<
class DataHandleImp,
class DataType >
237 const IndexSet *indexSet_;
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 >
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 414 return IntersectionIteratorImpl( Grid::getRealImplementation( entity ), begin );
421 assert( !!Grid::getRealImplementation( entity ).elementInfo() );
423 return IntersectionIteratorImpl( Grid::getRealImplementation( entity ), end );
427 const CollectiveCommunication &
comm ()
const 429 return grid().comm();
435 return grid().overlapSize(codim);
441 return grid().ghostSize(codim);
445 template<
class DataHandleImp,
class DataType >
453 const IndexSet *indexSet_;
458 #endif // #if HAVE_ALBERTA 459 #endif // #ifndef DUNE_ALBERTAGRID_GRIDVIEW_HH Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:283
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:386
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:427
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:439
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:446
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:53
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:204
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:67
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:279
Specialize with 'true' if implementation guarantees conforming level grids. (default=false) ...
Definition: common/capabilities.hh:98
Definition: albertagrid/gridview.hh:23
Codim Structure.
Definition: albertagrid/gridview.hh:316
Codim Structure.
Definition: albertagrid/gridview.hh:100
Grid::Traits::LeafIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:258
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:57
Grid::Traits::template Codim< cd >::template Partition< pitype >::LeafIterator Iterator
Definition: albertagrid/gridview.hh:267
Definition: albertagrid/intersectioniterator.hh:33
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:152
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false) ...
Definition: common/capabilities.hh:107
Definition: albertagrid/gridview.hh:27
Definition: elementinfo.hh:40
Grid::Traits::template Codim< cd >::template Partition< pitype >::LevelIterator Iterator
Definition: albertagrid/gridview.hh:51
Definition: albertagrid/entity.hh:33
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:306
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:45
Implementation of the IntersectionIterator for AlbertaGrid.
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:173
Grid::Traits::LevelIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:38
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:140
AlbertaLevelGridView(const Grid &grid, int level)
Definition: albertagrid/gridview.hh:110
remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:32
Grid::Traits::LevelIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:35
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:90
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:146
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:87
AlbertaLeafGridView< GridImp, pitype > GridViewImp
Definition: albertagrid/gridview.hh:245
AlbertaLevelGridViewTraits< GridImp, pitype > Traits
Definition: albertagrid/gridview.hh:81
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:309
Definition: albertagrid/gridview.hh:264
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:159
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:379
Definition: albertagrid/gridview.hh:48
remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:248
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:269
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:347
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:166
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:353
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:84
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:273
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
Definition: alugrid/common/declaration.hh:20
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:300
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:211
AlbertaLevelGridView< GridImp, pitype > GridViewImp
Definition: albertagrid/gridview.hh:29
Definition: albertagrid/gridview.hh:20
AlbertaLeafGridViewTraits< GridImp, pitype > Traits
Definition: albertagrid/gridview.hh:297
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:275
Grid::Traits::template Codim< cd >::EntityPointer EntityPointer
Definition: albertagrid/gridview.hh:271
Definition: albertagrid/intersectioniterator.hh:34
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:59
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:400
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:230
Grid::Traits::LevelIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:42
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:93
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:261
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:312
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:180
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:359
Definition: albertagrid/gridview.hh:243
Include standard header files.
Definition: agrid.hh:59
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:223
Grid::Traits::LeafIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:251
A set of traits classes to store static information about grid implementation.
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:419
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:96
ALBERTA EL_INFO & elInfo() const
Definition: elementinfo.hh:742
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:303
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:63
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:187
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:433
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:365
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:372
Grid::Traits::LeafIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:254
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:217
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:134
Definition: albertagrid/gridview.hh:71
Grid::Traits::template Codim< cd >::EntityPointer EntityPointer
Definition: albertagrid/gridview.hh:55
AlbertaLeafGridView(const Grid &grid)
Definition: albertagrid/gridview.hh:326
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:393
The dimension of the grid.
Definition: common/grid.hh:402