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
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:84
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:400
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:359
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:365
Index Set Interface base class.
Definition: common/grid.hh:361
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:67
Codim Structure.
Definition: albertagrid/gridview.hh:100
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:211
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:230
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:93
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false) ...
Definition: common/capabilities.hh:107
Definition: albertagrid/gridview.hh:27
Grid::Traits::LeafIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:254
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:303
Definition: elementinfo.hh:40
AlbertaLeafGridViewTraits< GridImp, pitype > Traits
Definition: albertagrid/gridview.hh:297
Grid::Traits::LeafIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:251
Definition: albertagrid/gridview.hh:243
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:360
Grid::Traits::LevelIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:42
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:57
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:180
Definition: albertagrid/gridview.hh:287
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:223
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:96
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:372
Definition: albertagrid/gridview.hh:318
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:59
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:386
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:134
Definition: albertagrid/gridview.hh:20
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:353
Grid::Traits::template Codim< cd >::template Partition< pitype >::LevelIterator Iterator
Definition: albertagrid/gridview.hh:51
Definition: albertagrid/gridview.hh:23
Codim Structure.
Definition: albertagrid/gridview.hh:316
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:439
Grid::Traits::template Codim< cd >::EntityPointer EntityPointer
Definition: albertagrid/gridview.hh:55
Grid::Traits::LeafIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:258
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:273
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:300
Definition: albertagrid/gridview.hh:48
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:279
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:187
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:275
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:204
Implementation of the IntersectionIterator for AlbertaGrid.
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:427
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:217
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:269
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:45
Definition: albertagrid/intersectioniterator.hh:34
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:261
Definition: albertagrid/entity.hh:33
AlbertaLevelGridView< GridImp, pitype > GridViewImp
Definition: albertagrid/gridview.hh:29
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:309
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:379
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:63
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:433
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:388
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:347
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:173
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:306
Grid::Traits::template Codim< cd >::template Partition< pitype >::LeafIterator Iterator
Definition: albertagrid/gridview.hh:267
remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:248
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:140
AlbertaLevelGridView(const Grid &grid, int level)
Definition: albertagrid/gridview.hh:110
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:90
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:87
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:393
Definition: albertagrid/gridview.hh:264
A set of traits classes to store static information about grid implementation.
Grid::Traits::LevelIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:35
Grid::Traits::template Codim< cd >::EntityPointer EntityPointer
Definition: albertagrid/gridview.hh:271
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:446
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:152
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:312
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
AlbertaLeafGridView< GridImp, pitype > GridViewImp
Definition: albertagrid/gridview.hh:245
The dimension of the grid.
Definition: common/grid.hh:402
remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:32
Grid::Traits::LevelIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:38
Definition: albertagrid/gridview.hh:71
Specialize with 'true' if implementation guarantees conforming level grids. (default=false) ...
Definition: common/capabilities.hh:98
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:283
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:146
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:53
AlbertaLevelGridViewTraits< GridImp, pitype > Traits
Definition: albertagrid/gridview.hh:81
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:159
Definition: albertagrid/gridview.hh:102
Definition: albertagrid/intersectioniterator.hh:33
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:166
ALBERTA EL_INFO & elInfo() const
Definition: elementinfo.hh:742
AlbertaLeafGridView(const Grid &grid)
Definition: albertagrid/gridview.hh:326