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, PartitionIteratorType pitype >
34 template<
class HGV,
class CoordFunction,
class Allocator, PartitionIteratorType pitype >
37 friend class GridView< HGV, CoordFunction, Allocator, pitype >;
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, pitype > 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, pitype, const Grid > IteratorImp;
66 typedef typename Grid::Traits::template Codim< codim >::Entity Entity;
67 typedef typename Grid::Traits::template Codim< codim >::EntityPointer EntityPointer;
69 typedef typename Grid::template Codim< codim >::Geometry Geometry;
70 typedef typename Grid::template Codim< codim >::LocalGeometry LocalGeometry;
72 template< PartitionIteratorType pit >
75 typedef GeoGrid::Iterator< HostGridView, codim, pit, const Grid > IteratorImp;
80 static const bool conforming = HostGridView::conforming;
88 template<
class HGV,
class CoordFunction,
class Allocator, PartitionIteratorType pitype >
91 typedef GridView< HGV, CoordFunction, Allocator, pitype > This;
94 typedef GridViewTraits< HGV, CoordFunction, Allocator, pitype > Traits;
96 typedef typename Traits::HostGridView HostGridView;
98 typedef typename Traits::Grid Grid;
100 typedef typename Traits::IndexSet IndexSet;
102 typedef typename Traits::Intersection Intersection;
104 typedef typename Traits::IntersectionIterator IntersectionIterator;
106 typedef typename Traits::CollectiveCommunication CollectiveCommunication;
108 template<
int codim >
110 :
public Traits::template Codim< codim >
113 static const bool conforming = Traits::conforming;
115 GridView (
const Grid &grid,
const HostGridView &hostGridView )
117 hostGridView_( hostGridView )
120 const Grid &grid ()
const
126 const IndexSet &indexSet ()
const
129 indexSet_ = IndexSet( hostGridView().indexSet() );
133 int size (
int codim )
const
135 return hostGridView().size( codim );
138 int size (
const GeometryType &type )
const
140 return hostGridView().size( type );
143 template<
int codim >
144 typename Codim< codim >::Iterator begin ()
const
146 return begin< codim, pitype >();
149 template<
int codim, PartitionIteratorType pit >
150 typename Codim< codim >::template Partition< pit >::Iterator begin ()
const
152 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::begin( grid(), hostGridView() );
155 template<
int codim >
156 typename Codim< codim >::Iterator end ()
const
158 return end< codim, pitype >();
161 template<
int codim, PartitionIteratorType pit >
162 typename Codim< codim >::template Partition< pit >::Iterator end ()
const
164 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::end( grid(), hostGridView() );
167 IntersectionIterator ibegin (
const typename Codim< 0 >::Entity &entity )
const
169 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
173 IntersectionIterator iend (
const typename Codim< 0 >::Entity &entity )
const
175 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
179 const CollectiveCommunication &comm ()
const
181 return hostGridView().comm();
184 int overlapSize (
int codim )
const
186 return hostGridView().overlapSize( codim );
189 int ghostSize (
int codim )
const
191 return hostGridView().ghostSize( codim );
194 template<
class DataHandle,
class Data >
195 void communicate ( CommDataHandleIF< DataHandle, Data > &dataHandle,
199 typedef CommDataHandleIF< DataHandle, Data > DataHandleIF;
200 typedef GeoGrid::CommDataHandle< Grid, DataHandleIF > WrappedDataHandle;
202 WrappedDataHandle wrappedDataHandle( grid(), dataHandle );
203 hostGridView().communicate( wrappedDataHandle, interface, direction );
206 const HostGridView &hostGridView ()
const {
return hostGridView_; }
210 HostGridView hostGridView_;
211 mutable IndexSet indexSet_;
interface class for an iterator over grid entities
Definition: entityiterator.hh:37
grid wrapper replacing the geometries
Definition: grid.hh:83
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:1305
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:84
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: intersection.hh:161
A set of traits classes to store static information about grid implementation.
A few common exception classes.
Dune namespace.
Definition: alignment.hh:10
Traits for type conversions and type information.