5#ifndef DUNE_ALBERTAGRID_GRIDVIEW_HH
6#define DUNE_ALBERTAGRID_GRIDVIEW_HH
10#include <dune/common/typetraits.hh>
11#include <dune/common/exceptions.hh>
21 template<
class Gr
idImp >
22 class AlbertaLevelGridView;
24 template<
class Gr
idImp >
25 class AlbertaLeafGridView;
28 template<
class Gr
idImp >
34 typedef typename std::remove_const<GridImp>::type
Grid;
37 typedef typename Grid::Traits::LevelIndexSet
IndexSet;
43 typedef typename Grid::Traits::LevelIntersectionIterator
61 template< PartitionIteratorType pit >
74 template<
class Gr
idImp >
111 indexSet_( &(
grid.levelIndexSet( level )) ),
118 : grid_( other.grid_ ),
119 indexSet_( other.indexSet_ ),
120 level_( other.level_ )
124 ThisType &operator= (
const ThisType & other)
127 indexSet_ = other.indexSet_;
128 level_ = other.level_;
150 return grid().size( level_, codim );
154 int size (
const GeometryType &type )
const
156 return grid().size( level_, type );
163 return grid().template lbegin< cd, All_Partition >( level_ );
167 template<
int cd, PartitionIteratorType pit >
170 return grid().template lbegin< cd, pit >( level_ );
177 return grid().template lend< cd, All_Partition >( level_ );
181 template<
int cd, PartitionIteratorType pit >
184 return grid().template lend< cd, pit >( level_ );
191 if(
grid().maxLevel() == 0)
198 DUNE_THROW( NotImplemented,
"method ibegin not implemented on LevelGridView for AlbertaGrid." );
215 return grid().comm();
219 int overlapSize ( [[maybe_unused]]
int codim )
const {
return 0; }
222 int ghostSize ( [[maybe_unused]]
int codim )
const {
return 0; }
225 template<
class DataHandleImp,
class DataType >
238 template<
class Gr
idImp >
244 typedef typename std::remove_const<GridImp>::type
Grid;
247 typedef typename Grid::Traits::LeafIndexSet
IndexSet;
253 typedef typename Grid::Traits::LeafIntersectionIterator
272 template <PartitionIteratorType pit >
285 template<
class Gr
idImp >
322 indexSet_( &(
grid.leafIndexSet()) )
328 : grid_( other.grid_ ),
329 indexSet_( other.indexSet_ )
333 ThisType &operator= (
const ThisType & other)
336 indexSet_ = other.indexSet_;
358 return grid().size( codim );
362 int size (
const GeometryType &type )
const
364 return grid().size( type );
371 return grid().template leafbegin< cd, All_Partition >();
375 template<
int cd, PartitionIteratorType pit >
378 return grid().template leafbegin< cd, pit >();
385 return grid().template leafend< cd, All_Partition >();
389 template<
int cd, PartitionIteratorType pit >
392 return grid().template leafend< cd, pit >();
399 const ElementInfo elementInfo = entity.impl().elementInfo();
400 assert( !!elementInfo );
405 if( elementInfo.
elInfo().opp_vertex[ i ] == 127 )
406 DUNE_THROW( NotImplemented,
"AlbertaGrid: Intersections on outside entities are not fully implemented, yet." );
418 assert( !!entity.impl().elementInfo() );
426 return grid().comm();
430 int overlapSize ( [[maybe_unused]]
int codim )
const {
return 0; }
433 int ghostSize ( [[maybe_unused]]
int codim )
const {
return 0; }
436 template<
class DataHandleImp,
class DataType >
CommunicationDirection
Define a type for communication direction parameter.
Definition gridenums.hh:170
InterfaceType
Parameter to be used for the communication functions.
Definition gridenums.hh:86
Include standard header files.
Definition agrid.hh:60
Definition elementinfo.hh:43
ALBERTA EL_INFO & elInfo() const
Definition elementinfo.hh:744
Definition albertagrid/intersectioniterator.hh:27
Definition albertagrid/gridview.hh:76
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition albertagrid/gridview.hh:154
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition albertagrid/gridview.hh:226
Traits::IndexSet IndexSet
type of the index set
Definition albertagrid/gridview.hh:86
const Communication & comm() const
obtain communication object
Definition albertagrid/gridview.hh:213
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition albertagrid/gridview.hh:206
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition albertagrid/gridview.hh:168
AlbertaLevelGridView(const Grid &grid, int level)
Definition albertagrid/gridview.hh:109
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition albertagrid/gridview.hh:133
int size(int codim) const
obtain number of entities in a given codimension
Definition albertagrid/gridview.hh:148
Traits::Intersection Intersection
type of the intersection
Definition albertagrid/gridview.hh:89
bool isConforming() const
return true if current state of grid view represents a conforming grid
Definition albertagrid/gridview.hh:145
AlbertaLevelGridViewTraits< GridImp > Traits
Definition albertagrid/gridview.hh:80
Traits::Grid Grid
type of the grid
Definition albertagrid/gridview.hh:83
static constexpr bool conforming
Definition albertagrid/gridview.hh:101
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition albertagrid/gridview.hh:222
Traits::Communication Communication
type of the communication
Definition albertagrid/gridview.hh:95
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition albertagrid/gridview.hh:175
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition albertagrid/gridview.hh:92
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition albertagrid/gridview.hh:161
const IndexSet & indexSet() const
obtain the index set
Definition albertagrid/gridview.hh:139
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition albertagrid/gridview.hh:219
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition albertagrid/gridview.hh:182
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition albertagrid/gridview.hh:189
Definition albertagrid/gridview.hh:287
AlbertaLeafGridView(const Grid &grid)
Definition albertagrid/gridview.hh:320
AlbertaLeafGridViewTraits< GridImp > Traits
Definition albertagrid/gridview.hh:291
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition albertagrid/gridview.hh:303
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition albertagrid/gridview.hh:433
int size(int codim) const
obtain number of entities in a given codimension
Definition albertagrid/gridview.hh:356
bool isConforming() const
return true if current state of grid view represents a conforming grid
Definition albertagrid/gridview.hh:353
Traits::Grid Grid
type of the grid
Definition albertagrid/gridview.hh:294
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition albertagrid/gridview.hh:369
Traits::Intersection Intersection
type of the intersection
Definition albertagrid/gridview.hh:300
static constexpr bool conforming
Definition albertagrid/gridview.hh:312
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition albertagrid/gridview.hh:341
Traits::IndexSet IndexSet
type of the index set
Definition albertagrid/gridview.hh:297
Codim< cd >::template Partition< pit >::Iterator end() const
obtain end iterator for this view
Definition albertagrid/gridview.hh:390
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition albertagrid/gridview.hh:437
IntersectionIterator ibegin(const typename Codim< 0 >::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition albertagrid/gridview.hh:397
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition albertagrid/gridview.hh:362
Traits::Communication Communication
type of the communication
Definition albertagrid/gridview.hh:306
IntersectionIterator iend(const typename Codim< 0 >::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition albertagrid/gridview.hh:416
const IndexSet & indexSet() const
obtain the index set
Definition albertagrid/gridview.hh:347
const Communication & comm() const
obtain communication object
Definition albertagrid/gridview.hh:424
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition albertagrid/gridview.hh:383
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition albertagrid/gridview.hh:430
Codim< cd >::template Partition< pit >::Iterator begin() const
obtain begin iterator for this view
Definition albertagrid/gridview.hh:376
Definition albertagrid/gridview.hh:30
Grid::Traits::LevelIntersection Intersection
type of the intersection
Definition albertagrid/gridview.hh:40
Grid::Traits::Communication Communication
type of the communication
Definition albertagrid/gridview.hh:47
AlbertaLevelGridView< GridImp > GridViewImp
Definition albertagrid/gridview.hh:31
static constexpr bool conforming
Definition albertagrid/gridview.hh:70
Grid::Traits::LevelIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition albertagrid/gridview.hh:44
Grid::Traits::LevelIndexSet IndexSet
type of the index set
Definition albertagrid/gridview.hh:37
std::remove_const< GridImp >::type Grid
type of the grid
Definition albertagrid/gridview.hh:34
Definition albertagrid/gridview.hh:51
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition albertagrid/gridview.hh:58
Grid::template Codim< cd >::Geometry Geometry
Definition albertagrid/gridview.hh:56
Grid::Traits::template Codim< cd >::Entity Entity
Definition albertagrid/gridview.hh:54
Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator Iterator
Definition albertagrid/gridview.hh:52
Define types needed to iterate over entities of a given partition type.
Definition albertagrid/gridview.hh:63
Grid::template Codim< cd >::template Partition< pit >::LevelIterator Iterator
iterator over a given codim and partition type
Definition albertagrid/gridview.hh:66
Codim Structure.
Definition albertagrid/gridview.hh:99
Definition albertagrid/gridview.hh:240
std::remove_const< GridImp >::type Grid
type of the grid
Definition albertagrid/gridview.hh:244
Grid::Traits::Communication Communication
type of the communication
Definition albertagrid/gridview.hh:257
AlbertaLeafGridView< GridImp > GridViewImp
Definition albertagrid/gridview.hh:241
Grid::Traits::LeafIntersection Intersection
type of the intersection
Definition albertagrid/gridview.hh:250
static constexpr bool conforming
Definition albertagrid/gridview.hh:281
Grid::Traits::LeafIndexSet IndexSet
type of the index set
Definition albertagrid/gridview.hh:247
Grid::Traits::LeafIntersectionIterator IntersectionIterator
type of the intersection iterator
Definition albertagrid/gridview.hh:254
Definition albertagrid/gridview.hh:261
Grid::Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator Iterator
Definition albertagrid/gridview.hh:263
Grid::Traits::template Codim< cd >::Entity Entity
Definition albertagrid/gridview.hh:265
Grid::template Codim< cd >::LocalGeometry LocalGeometry
Definition albertagrid/gridview.hh:269
Grid::template Codim< cd >::Geometry Geometry
Definition albertagrid/gridview.hh:267
Define types needed to iterate over entities of a given partition type.
Definition albertagrid/gridview.hh:274
Grid::template Codim< cd >::template Partition< pit >::LeafIterator Iterator
iterator over a given codim and partition type
Definition albertagrid/gridview.hh:277
Codim Structure.
Definition albertagrid/gridview.hh:310
Definition albertagrid/intersectioniterator.hh:35
Definition albertagrid/intersectioniterator.hh:36
Specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition common/capabilities.hh:106
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false)
Definition common/capabilities.hh:115
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition datahandleif.hh:78
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition common/intersectioniterator.hh:83
Index Set Interface base class.
Definition common/indexidset.hh:78
Grid abstract base class.
Definition common/grid.hh:375
static constexpr int dimension
The dimension of the grid.
Definition common/grid.hh:387
A set of traits classes to store static information about grid implementation.
Implementation of the IntersectionIterator for AlbertaGrid.