3#ifndef DUNE_GEOGRID_GRIDVIEW_HH
4#define DUNE_GEOGRID_GRIDVIEW_HH
10#include <dune/grid/common/gridview.hh>
11#include <dune/grid/geometrygrid/datahandle.hh>
12#include <dune/grid/geometrygrid/indexsets.hh>
13#include <dune/grid/geometrygrid/intersection.hh>
14#include <dune/grid/geometrygrid/intersectioniterator.hh>
15#include <dune/grid/geometrygrid/iterator.hh>
26 template<
class HGV,
class CoordFunction,
class Allocator >
34 template<
class HGV,
class CoordFunction,
class Allocator >
37 friend class GridView< HGV, CoordFunction, Allocator >;
39 typedef HGV HostGridView;
41 typedef typename HostGridView::Grid HostGrid;
42 typedef typename HostGridView::Intersection HostIntersection;
43 typedef typename HostGridView::IntersectionIterator HostIntersectionIterator;
46 typedef GridView< HostGridView, CoordFunction, Allocator > GridViewImp;
50 typedef GeoGrid::IndexSet< const Grid, typename HostGridView::IndexSet > IndexSet;
55 <
const Grid, GeoGrid::IntersectionIterator< const Grid, HostIntersectionIterator >, GeoGrid::Intersection< const Grid, HostIntersection > >
58 typedef typename HostGridView::CollectiveCommunication CollectiveCommunication;
63 typedef GeoGrid::Iterator< HostGridView, codim, All_Partition, const Grid > IteratorImp;
66 typedef typename Grid::Traits::template Codim< codim >::Entity Entity;
68 typedef typename Grid::template Codim< codim >::Geometry Geometry;
69 typedef typename Grid::template Codim< codim >::LocalGeometry LocalGeometry;
71 template< PartitionIteratorType pit >
74 typedef GeoGrid::Iterator< HostGridView, codim, pit, const Grid > IteratorImp;
79 static const bool conforming = HostGridView::conforming;
87 template<
class HGV,
class CoordFunction,
class Allocator >
90 typedef GridView< HGV, CoordFunction, Allocator > This;
93 typedef GridViewTraits< HGV, CoordFunction, Allocator > Traits;
95 typedef typename Traits::HostGridView HostGridView;
97 typedef typename Traits::Grid Grid;
99 typedef typename Traits::IndexSet IndexSet;
101 typedef typename Traits::Intersection Intersection;
103 typedef typename Traits::IntersectionIterator IntersectionIterator;
105 typedef typename Traits::CollectiveCommunication CollectiveCommunication;
107 template<
int codim >
109 :
public Traits::template Codim< codim >
112 static const bool conforming = Traits::conforming;
114 GridView (
const Grid &grid,
const HostGridView &hostGridView )
116 hostGridView_( hostGridView )
119 const Grid &grid ()
const
125 const IndexSet &indexSet ()
const
128 indexSet_ = IndexSet( hostGridView().indexSet() );
132 int size (
int codim )
const
134 return hostGridView().size( codim );
137 int size (
const GeometryType &type )
const
139 return hostGridView().size( type );
142 template<
int codim >
143 typename Codim< codim >::Iterator begin ()
const
145 return begin< codim, All_Partition >();
148 template<
int codim, PartitionIteratorType pit >
149 typename Codim< codim >::template Partition< pit >::Iterator begin ()
const
151 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::begin( grid(), hostGridView() );
154 template<
int codim >
155 typename Codim< codim >::Iterator end ()
const
157 return end< codim, All_Partition >();
160 template<
int codim, PartitionIteratorType pit >
161 typename Codim< codim >::template Partition< pit >::Iterator end ()
const
163 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::end( grid(), hostGridView() );
166 IntersectionIterator ibegin (
const typename Codim< 0 >::Entity &entity )
const
168 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
172 IntersectionIterator iend (
const typename Codim< 0 >::Entity &entity )
const
174 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
178 const CollectiveCommunication &comm ()
const
180 return hostGridView().comm();
183 int overlapSize (
int codim )
const
185 return hostGridView().overlapSize( codim );
188 int ghostSize (
int codim )
const
190 return hostGridView().ghostSize( codim );
193 template<
class DataHandle,
class Data >
194 void communicate ( CommDataHandleIF< DataHandle, Data > &dataHandle,
198 typedef CommDataHandleIF< DataHandle, Data > DataHandleIF;
199 typedef GeoGrid::CommDataHandle< Grid, DataHandleIF > WrappedDataHandle;
201 WrappedDataHandle wrappedDataHandle( grid(), dataHandle );
202 hostGridView().communicate( wrappedDataHandle, interface, direction );
205 const HostGridView &hostGridView ()
const {
return hostGridView_; }
209 HostGridView hostGridView_;
210 mutable IndexSet indexSet_;
interface class for an iterator over grid entities
Definition: entityiterator.hh:37
grid wrapper replacing the geometries
Definition: grid.hh:82
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition: grid.hh:1115
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:81
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:162
A set of traits classes to store static information about grid implementation.
@ conforming
Output conforming data.
Definition: common.hh:70
A few common exception classes.
Dune namespace.
Definition: alignment.hh:11
Traits for type conversions and type information.