3#ifndef DUNE_GRID_COMMON_GRIDVIEW_HH
4#define DUNE_GRID_COMMON_GRIDVIEW_HH
8#include <dune/common/iteratorrange.hh>
9#include <dune/common/parallel/future.hh>
11#include <dune/geometry/type.hh>
19 template<
int,
int,
class,
class >
20 class GridDefaultImplementation;
61 template<
class ViewTraits >
80 typedef typename Traits :: Grid
Grid;
112 template< PartitionIteratorType pit >
166 return impl().grid();
177 return impl().indexSet();
183 return impl().size( codim );
187 int size (
const GeometryType &type )
const
189 return impl().size( type );
198 template<
class EntityType>
201 return impl().indexSet().contains(e);
208 return impl().template begin<cd>();
215 return impl().template end<cd>();
219 template<
int cd , PartitionIteratorType pitype >
220 typename Codim< cd > :: template Partition< pitype > :: Iterator
223 return impl().template begin<cd,pitype>();
227 template<
int cd, PartitionIteratorType pitype >
228 typename Codim< cd > :: template Partition< pitype > :: Iterator
231 return impl().template end<cd,pitype>();
238 return impl().ibegin(entity);
245 return impl().iend(entity);
251 return impl().comm();
257 return impl().overlapSize(codim);
263 return impl().ghostSize(codim);
267 template<
class DataHandleImp,
class DataType >
272 typedef decltype(
impl().communicate(data,iftype,dir) ) CommFuture;
274 std::integral_constant<
bool, std::is_same< CommFuture, void > :: value >() );
293 template<
class DataHandleImp,
class DataType >
298 return impl().communicate(data,iftype,dir);
305 std::cerr <<
"WARNING: GridView::communicate of '" <<
306 typeid(
Implementation ).name() <<
"' still returns void. Please update implementation to new interface returning a future object!" << std::endl;
318 template<
class DataHandleImp,
class DataType >
323 impl().communicate(data,iftype,dir);
Describes the parallel communication interface class for MessageBuffers and DataHandles.
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:168
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
const IndexSet & indexSet() const
obtain the index set
Definition: common/gridview.hh:175
Traits::Grid Grid
type of the grid
Definition: common/gridview.hh:80
ThisType & operator=(const ThisType &other)
assignment operator
Definition: common/gridview.hh:156
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: common/gridview.hh:206
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: common/gridview.hh:164
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: common/gridview.hh:213
Implementation & impl()
access to the underlying implementation
Definition: common/gridview.hh:282
Traits::template Codim< cd >::Iterator Iterator
type of iterator returned by the grid view
Definition: common/gridview.hh:100
const CollectiveCommunication & comm() const
obtain collective communication object
Definition: common/gridview.hh:249
Traits::template Codim< cd >::template Partition< pit >::Iterator Iterator
iterator over a given codim and partition type
Definition: common/gridview.hh:117
ViewTraits Traits
Traits class.
Definition: common/gridview.hh:77
Traits::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: common/gridview.hh:89
const Implementation & impl() const
access to the underlying implementation
Definition: common/gridview.hh:289
IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: common/gridview.hh:236
Traits::IndexSet IndexSet
type of the index set
Definition: common/gridview.hh:83
Implementation impl_
Definition: common/gridview.hh:327
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: common/gridview.hh:255
Traits::CollectiveCommunication CollectiveCommunication
type of the collective communication
Definition: common/gridview.hh:92
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: common/gridview.hh:187
void printMessage() const
Definition: common/gridview.hh:303
ViewTraits::GridViewImp GridViewImp
Definition: common/gridview.hh:74
int size(int codim) const
obtain number of entities in a given codimension
Definition: common/gridview.hh:181
auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Communicate data on this view.
Definition: common/gridview.hh:268
auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir, std::integral_constant< bool, false >) const
Communicate data on this view.
Definition: common/gridview.hh:294
bool valid() const
Definition: common/gridview.hh:314
ViewTraits::GridViewImp Implementation
type of underlying implementation
Definition: common/gridview.hh:72
GridView(const Implementation &imp)
constructor (engine concept)
Definition: common/gridview.hh:145
Codim< cd >::template Partition< pitype >::Iterator begin() const
obtain begin iterator for this view
Definition: common/gridview.hh:221
bool ready()
Definition: common/gridview.hh:309
Traits::Intersection Intersection
type of the intersection
Definition: common/gridview.hh:86
IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: common/gridview.hh:243
Traits::template Codim< cd >::Entity Entity
type of corresponding entity
Definition: common/gridview.hh:103
Traits::template Codim< cd >::LocalGeometry LocalGeometry
type of the implementation for local geometries
Definition: common/gridview.hh:109
Grid::ctype ctype
type used for coordinates in grid
Definition: common/gridview.hh:127
auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir, std::integral_constant< bool, true >) const
Communicate data on this view.
Definition: common/gridview.hh:319
Codim< cd >::template Partition< pitype >::Iterator end() const
obtain end iterator for this view
Definition: common/gridview.hh:229
bool contains(const EntityType &e) const
Return true if the given entity is contained in this grid view.
Definition: common/gridview.hh:199
void wait()
Definition: common/gridview.hh:313
GridView(const ThisType &other)
Copy constructor.
Definition: common/gridview.hh:151
Traits::template Codim< cd >::Geometry Geometry
type of the geometry implementation
Definition: common/gridview.hh:106
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: common/gridview.hh:261
@ dimensionworld
The dimension of the world the grid lives in.
Definition: common/gridview.hh:134
@ conforming
Export if this grid view is conforming.
Definition: common/gridview.hh:123
@ dimension
The dimension of the grid.
Definition: common/gridview.hh:130
Include standard header files.
Definition: agrid.hh:58
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:76
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/intersectioniterator.hh:81
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:521
Grid view abstract base class.
Definition: common/gridview.hh:63
A struct that collects all associated types of one implementation from the Traits class.
Definition: common/gridview.hh:98
Define types needed to iterate over entities of a given partition type.
Definition: common/gridview.hh:114
Definition: common/gridview.hh:302