5 #ifndef DUNE_GRID_COMMON_GRIDVIEW_HH 6 #define DUNE_GRID_COMMON_GRIDVIEW_HH 10 #include <dune/common/std/type_traits.hh> 11 #include <dune/common/iteratorrange.hh> 12 #include <dune/common/parallel/future.hh> 14 #include <dune/geometry/type.hh> 22 template<
int,
int,
class,
class >
23 class GridDefaultImplementation;
64 template<
class ViewTraits >
118 template< PartitionIteratorType pit >
168 return impl().grid();
179 return impl().indexSet();
185 return impl().size( codim );
191 return impl().size( type );
197 using HasIsConformingMethod = decltype(std::declval<I>().
isConforming());
205 if constexpr (Std::is_detected_v<HasIsConformingMethod, Implementation>)
207 return impl().isConforming();
222 template<
class EntityType>
225 return impl().indexSet().contains(e);
232 return impl().template begin<cd>();
239 return impl().template end<cd>();
243 template<
int cd , PartitionIteratorType pitype >
244 typename Codim< cd > :: template Partition< pitype > :: Iterator
247 return impl().template begin<cd,pitype>();
251 template<
int cd, PartitionIteratorType pitype >
252 typename Codim< cd > :: template Partition< pitype > :: Iterator
255 return impl().template end<cd,pitype>();
262 return impl().ibegin(entity);
269 return impl().iend(entity);
275 return impl().comm();
281 return impl().overlapSize(codim);
287 return impl().ghostSize(codim);
291 template<
class DataHandleImp,
class DataType >
298 std::integral_constant<
bool, std::is_same< CommFuture, void > :: value >() );
317 template<
class DataHandleImp,
class DataType >
322 return impl().communicate(data,iftype,dir);
329 std::cerr <<
"WARNING: GridView::communicate of '" <<
330 typeid(
Implementation ).name() <<
"' still returns void. Please update implementation to new interface returning a future object!" << std::endl;
342 template<
class DataHandleImp,
class DataType >
347 impl().communicate(data,iftype,dir);
356 #endif // #ifndef DUNE_GRID_COMMON_GRIDVIEW_HH Traits ::Intersection Intersection
type of the intersection
Definition: common/gridview.hh:89
IntersectionIterator iend(const typename Codim< 0 > ::Entity &entity) const
obtain end intersection iterator with respect to this view
Definition: common/gridview.hh:267
concept IntersectionIterator
Model of an intersection iterator.
Definition: concepts/intersectioniterator.hh:21
Definition: common/gridview.hh:325
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: common/grid.hh:390
const Grid & grid() const
obtain a const reference to the underlying hierarchic grid
Definition: common/gridview.hh:166
GridView(const ThisType &other)
Copy constructor.
Definition: common/gridview.hh:153
IntersectionIterator ibegin(const typename Codim< 0 > ::Entity &entity) const
obtain begin intersection iterator with respect to this view
Definition: common/gridview.hh:260
Traits ::template Codim< cd >::Iterator Iterator
type of iterator returned by the grid view
Definition: common/gridview.hh:106
Traits ::template Codim< cd >::template Partition< pit >::Iterator Iterator
iterator over a given codim and partition type
Definition: common/gridview.hh:123
auto communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
Communicate data on this view.
Definition: common/gridview.hh:292
ViewTraits Traits
Traits class.
Definition: common/gridview.hh:80
int ghostSize(int codim) const
Return size of the ghost region for a given codim on the grid view.
Definition: common/gridview.hh:285
void wait()
Definition: common/gridview.hh:337
Traits ::template Codim< cd >::LocalGeometry LocalGeometry
type of the implementation for local geometries
Definition: common/gridview.hh:115
Implementation impl_
Definition: common/gridview.hh:351
Grid::ctype ctype
type used for coordinates in grid
Definition: common/gridview.hh:131
concept Intersection
Model of an intersection.
Definition: concepts/intersection.hh:23
const IndexSet & indexSet() const
obtain the index set
Definition: common/gridview.hh:177
typename Traits ::Communication Communication
A type that is a model of Dune::Communication. It provides a portable way for communication on the se...
Definition: common/gridview.hh:98
Traits ::template Codim< cd >::Geometry Geometry
type of the geometry implementation
Definition: common/gridview.hh:112
int overlapSize(int codim) const
Return size of the overlap region for a given codim on the grid view.
Definition: common/gridview.hh:279
bool contains(const EntityType &e) const
Return true if the given entity is contained in this grid view.
Definition: common/gridview.hh:223
ThisType & operator=(const ThisType &other)
assignment operator
Definition: common/gridview.hh:158
void printMessage() const
Definition: common/gridview.hh:327
ViewTraits ::GridViewImp Implementation
type of underlying implementation
Definition: common/gridview.hh:75
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: common/gridview.hh:137
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:343
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:170
int size(const GeometryType &type) const
obtain number of entities with a given geometry type
Definition: common/gridview.hh:189
Grid view abstract base class.
Definition: common/gridview.hh:65
Codim< cd >::Iterator end() const
obtain end iterator for this view
Definition: common/gridview.hh:237
Implementation & impl()
access to the underlying implementation
Definition: common/gridview.hh:306
const Implementation & impl() const
access to the underlying implementation
Definition: common/gridview.hh:313
Include standard header files.
Definition: agrid.hh:59
static constexpr bool conforming
Export if this grid view is guaranteed conforming.
Definition: common/gridview.hh:128
int size(int codim) const
obtain number of entities in a given codimension
Definition: common/gridview.hh:183
bool valid() const
Definition: common/gridview.hh:338
Codim< cd >::Iterator begin() const
obtain begin iterator for this view
Definition: common/gridview.hh:230
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:77
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
concept Grid
Requirements for implementations of the Dune::Grid interface.The Grid concept defines interface requi...
Definition: concepts/grid.hh:109
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:347
Codim< cd >::template Partition< pitype >::Iterator begin() const
obtain begin iterator for this view
Definition: common/gridview.hh:245
static constexpr int dimension
The dimension of the grid.
Definition: common/gridview.hh:134
Traits ::IntersectionIterator IntersectionIterator
type of the intersection iterator
Definition: common/gridview.hh:92
static constexpr int dimension
The dimension of the grid.
Definition: common/grid.hh:387
Traits ::IndexSet IndexSet
type of the index set
Definition: common/gridview.hh:86
Codim< cd >::template Partition< pitype >::Iterator end() const
obtain end iterator for this view
Definition: common/gridview.hh:253
Traits ::Grid Grid
type of the grid
Definition: common/gridview.hh:83
Define types needed to iterate over entities of a given partition type.
Definition: common/gridview.hh:119
Describes the parallel communication interface class for MessageBuffers and DataHandles.
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:518
const Communication & comm() const
obtain communication object
Definition: common/gridview.hh:273
GridView(const Implementation &imp)
constructor (engine concept)
Definition: common/gridview.hh:147
bool isConforming() const
return true if current state of grid view represents a conforming grid
Definition: common/gridview.hh:202
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
bool ready()
Definition: common/gridview.hh:333
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:318
A struct that collects all associated types of one implementation from the Traits class...
Definition: common/gridview.hh:104
Traits ::template Codim< cd >::Entity Entity
type of corresponding entity
Definition: common/gridview.hh:109
ViewTraits ::GridViewImp GridViewImp
Definition: common/gridview.hh:77
Output conforming data.
Definition: common.hh:73
concept IndexSet
Model of an index set.
Definition: concepts/indexidset.hh:55