Go to the documentation of this file.
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 >
22 template<
class Gr
idImp >
26 template<
class Gr
idImp >
32 typedef typename std::remove_const<GridImp>::type
Grid;
35 typedef typename Grid::Traits::LevelIndexSet
IndexSet;
41 typedef typename Grid::Traits::LevelIntersectionIterator
59 template< PartitionIteratorType pit >
72 template<
class Gr
idImp >
73 class AlbertaLevelGridView
75 typedef AlbertaLevelGridView< GridImp > ThisType;
109 indexSet_( &(
grid.levelIndexSet( level )) ),
116 : grid_( other.grid_ ),
117 indexSet_( other.indexSet_ ),
118 level_( other.level_ )
122 ThisType &operator= (
const ThisType & other)
125 indexSet_ = other.indexSet_;
126 level_ = other.level_;
145 return grid().size( level_, codim );
151 return grid().size( level_, type );
158 return grid().template lbegin< cd, All_Partition >( level_ );
162 template<
int cd, PartitionIteratorType pit >
165 return grid().template lbegin< cd, pit >( level_ );
172 return grid().template lend< cd, All_Partition >( level_ );
176 template<
int cd, PartitionIteratorType pit >
179 return grid().template lend< cd, pit >( level_ );
186 if(
grid().maxLevel() == 0)
193 DUNE_THROW( NotImplemented,
"method ibegin not implemented on LevelGridView for AlbertaGrid." );
210 return grid().comm();
216 return grid().overlapSize(level_, codim);
222 return grid().ghostSize(level_, codim);
226 template<
class DataHandleImp,
class DataType >
239 template<
class Gr
idImp >
245 typedef typename std::remove_const<GridImp>::type
Grid;
248 typedef typename Grid::Traits::LeafIndexSet
IndexSet;
254 typedef typename Grid::Traits::LeafIntersectionIterator
273 template <PartitionIteratorType pit >
286 template<
class Gr
idImp >
287 class AlbertaLeafGridView
289 typedef AlbertaLeafGridView< GridImp > ThisType;
323 indexSet_( &(
grid.leafIndexSet()) )
329 : grid_( other.grid_ ),
330 indexSet_( other.indexSet_ )
334 ThisType &operator= (
const ThisType & other)
337 indexSet_ = other.indexSet_;
356 return grid().size( codim );
362 return grid().size( type );
369 return grid().template leafbegin< cd, All_Partition >();
373 template<
int cd, PartitionIteratorType pit >
376 return grid().template leafbegin< cd, pit >();
383 return grid().template leafend< cd, All_Partition >();
387 template<
int cd, PartitionIteratorType pit >
390 return grid().template leafend< cd, pit >();
397 const ElementInfo elementInfo = Grid::getRealImplementation( entity ).elementInfo();
398 assert( !!elementInfo );
403 if( elementInfo.
elInfo().opp_vertex[ i ] == 127 )
404 DUNE_THROW( NotImplemented,
"AlbertaGrid: Intersections on outside entities are not fully implemented, yet." );
406 #endif // #ifndef NDEBUG
416 assert( !!Grid::getRealImplementation( entity ).elementInfo() );
424 return grid().comm();
430 return grid().overlapSize(codim);
436 return grid().ghostSize(codim);
440 template<
class DataHandleImp,
class DataType >
453 #endif // #if HAVE_ALBERTA
454 #endif // #ifndef DUNE_ALBERTAGRID_GRIDVIEW_HH
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:56
AlbertaLeafGridView(const Grid &grid)
Definition: albertagrid/gridview.hh:321
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:298
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:441
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:143
Grid::Traits::LevelIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:35
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:274
Include standard header files.
Definition: agrid.hh:59
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:304
Definition: albertagrid/gridview.hh:99
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:307
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:163
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:268
Definition: albertagrid/gridview.hh:48
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:214
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:345
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:278
Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator Iterator
Definition: albertagrid/gridview.hh:264
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:201
AlbertaLevelGridView(const Grid &grid, int level)
Definition: albertagrid/gridview.hh:107
Grid::Traits::LeafIndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:248
std::remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:245
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:301
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:137
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition: albertagrid/gridview.hh:270
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:266
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:434
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition: albertagrid/gridview.hh:64
ALBERTA EL_INFO & elInfo() const
Definition: elementinfo.hh:742
Definition: albertagrid/gridview.hh:261
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false)
Definition: common/capabilities.hh:86
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:81
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
Codim Structure.
Definition: albertagrid/gridview.hh:97
Grid::Traits::LeafIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:251
AlbertaLeafGridView< GridImp > GridViewImp
Definition: albertagrid/gridview.hh:242
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:395
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:170
Codim Structure.
Definition: albertagrid/gridview.hh:311
Grid::Traits::LevelIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:42
Definition: elementinfo.hh:40
Definition: albertagrid/gridview.hh:240
Specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition: common/capabilities.hh:77
Grid abstract base class.
Definition: common/grid.hh:373
A set of traits classes to store static information about grid implementation.
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:388
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: albertagrid/gridview.hh:227
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:177
Define types needed to iterate over entities of a given partition type.
Definition: albertagrid/gridview.hh:60
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:367
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:342
Index Set Interface base class.
Definition: common/grid.hh:346
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:93
Grid::Traits::template Codim< cd >::Entity Entity
Definition: albertagrid/gridview.hh:52
Grid::Traits::LevelIntersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:38
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: albertagrid/gridview.hh:131
Implementation of the IntersectionIterator for AlbertaGrid.
Definition: albertagrid/entity.hh:33
The dimension of the grid.
Definition: common/grid.hh:387
Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator Iterator
Definition: albertagrid/gridview.hh:50
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: albertagrid/gridview.hh:381
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:428
Traits::Intersection Intersection
type of the intersection
Definition: albertagrid/gridview.hh:87
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:149
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:208
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: albertagrid/gridview.hh:422
Definition: albertagrid/gridview.hh:27
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:90
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:45
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:414
Grid::Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: albertagrid/gridview.hh:258
Grid::template Codim< cd >::Geometry Geometry
Definition: albertagrid/gridview.hh:54
AlbertaLevelGridView< GridImp > GridViewImp
Definition: albertagrid/gridview.hh:29
Definition: albertagrid/gridview.hh:20
Definition: albertagrid/gridview.hh:313
Definition: albertagrid/gridview.hh:282
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: albertagrid/gridview.hh:360
AlbertaLeafGridViewTraits< GridImp > Traits
Definition: albertagrid/gridview.hh:292
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: albertagrid/gridview.hh:184
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:374
Definition: albertagrid/gridview.hh:23
std::remove_const< GridImp >::type Grid
type of the grid
Definition: albertagrid/gridview.hh:32
Definition: albertagrid/intersectioniterator.hh:33
int size(int codim) const
obtain number of entities in a given codimension
Definition: albertagrid/gridview.hh:354
const IndexSet & indexSet() const
obtain the index set
Definition: albertagrid/gridview.hh:348
Traits::IndexSet IndexSet
type of the index set
Definition: albertagrid/gridview.hh:84
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: albertagrid/gridview.hh:156
Grid::Traits::LeafIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: albertagrid/gridview.hh:255
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
AlbertaLevelGridViewTraits< GridImp > Traits
Definition: albertagrid/gridview.hh:78
Definition: albertagrid/intersectioniterator.hh:34
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
Definition: albertagrid/gridview.hh:68
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: albertagrid/gridview.hh:220
Traits::Grid Grid
type of the grid
Definition: albertagrid/gridview.hh:295