5#ifndef DUNE_GEOGRID_GRIDVIEW_HH
6#define DUNE_GEOGRID_GRIDVIEW_HH
12#include <dune/grid/common/gridview.hh>
13#include <dune/grid/geometrygrid/datahandle.hh>
14#include <dune/grid/geometrygrid/indexsets.hh>
15#include <dune/grid/geometrygrid/intersection.hh>
16#include <dune/grid/geometrygrid/intersectioniterator.hh>
17#include <dune/grid/geometrygrid/iterator.hh>
28 template<
class HGV,
class CoordFunction,
class Allocator >
36 template<
class HGV,
class CoordFunction,
class Allocator >
39 friend class GridView< HGV, CoordFunction, Allocator >;
41 typedef HGV HostGridView;
43 typedef typename HostGridView::Grid HostGrid;
44 typedef typename HostGridView::Intersection HostIntersection;
45 typedef typename HostGridView::IntersectionIterator HostIntersectionIterator;
48 typedef GridView< HostGridView, CoordFunction, Allocator > GridViewImp;
52 typedef GeoGrid::IndexSet< const Grid, typename HostGridView::IndexSet > IndexSet;
57 <
const Grid, GeoGrid::IntersectionIterator< const Grid, HostIntersectionIterator >, GeoGrid::Intersection< const Grid, HostIntersection > >
60 typedef typename HostGridView::Communication Communication;
65 [[deprecated(
"Use Communication instead!!")]]
71 typedef GeoGrid::Iterator< HostGridView, codim, All_Partition, const Grid > IteratorImp;
74 typedef typename Grid::Traits::template Codim< codim >::Entity Entity;
76 typedef typename Grid::template Codim< codim >::Geometry Geometry;
77 typedef typename Grid::template Codim< codim >::LocalGeometry LocalGeometry;
79 template< PartitionIteratorType pit >
82 typedef GeoGrid::Iterator< HostGridView, codim, pit, const Grid > IteratorImp;
87 static const bool conforming = HostGridView::conforming;
95 template<
class HGV,
class CoordFunction,
class Allocator >
98 typedef GridView< HGV, CoordFunction, Allocator > This;
101 typedef GridViewTraits< HGV, CoordFunction, Allocator > Traits;
103 typedef typename Traits::HostGridView HostGridView;
105 typedef typename Traits::Grid Grid;
107 typedef typename Traits::IndexSet IndexSet;
109 typedef typename Traits::Intersection Intersection;
111 typedef typename Traits::IntersectionIterator IntersectionIterator;
113 typedef typename Traits::Communication Communication;
118 [[deprecated(
"Use Communication instead!!")]]
121 template<
int codim >
123 :
public Traits::template Codim< codim >
126 static const bool conforming = Traits::conforming;
128 GridView (
const Grid &grid,
const HostGridView &hostGridView )
129 : grid_( &grid ), hostGridView_( hostGridView )
132 GridView (
const This &other )
133 : grid_( other.grid_ ), hostGridView_( other.hostGridView_ )
136 GridView ( This &&other )
137 : grid_( other.grid_ ), hostGridView_(
std::move( other.hostGridView_ ) )
140 This &operator= (
const This &other )
143 hostGridView_ = other.hostGridView_;
145 indexSet_.reset( hostGridView().indexSet() );
149 This &operator= ( This &&other )
152 hostGridView_ = std::move( other.hostGridView_ );
154 indexSet_.reset( hostGridView().indexSet() );
158 const Grid &grid ()
const
164 const IndexSet &indexSet ()
const
166 indexSet_.reset( hostGridView().indexSet() );
170 bool isConforming()
const {
return hostGridView().isConforming(); }
172 int size (
int codim )
const
174 return hostGridView().size( codim );
177 int size (
const GeometryType &type )
const
179 return hostGridView().size( type );
182 template<
int codim >
183 typename Codim< codim >::Iterator begin ()
const
185 return begin< codim, All_Partition >();
188 template<
int codim, PartitionIteratorType pit >
189 typename Codim< codim >::template Partition< pit >::Iterator begin ()
const
191 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::begin( grid(), hostGridView() );
194 template<
int codim >
195 typename Codim< codim >::Iterator end ()
const
197 return end< codim, All_Partition >();
200 template<
int codim, PartitionIteratorType pit >
201 typename Codim< codim >::template Partition< pit >::Iterator end ()
const
203 return Traits::template Codim< codim >::template Partition< pit >::IteratorImp::end( grid(), hostGridView() );
206 IntersectionIterator ibegin (
const typename Codim< 0 >::Entity &entity )
const
208 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
209 return IntersectionIteratorImpl( entity, hostGridView().ibegin( entity.impl().hostEntity() ) );
212 IntersectionIterator iend (
const typename Codim< 0 >::Entity &entity )
const
214 typedef GeoGrid::IntersectionIterator< const Grid, typename HostGridView::IntersectionIterator > IntersectionIteratorImpl;
215 return IntersectionIteratorImpl( entity, hostGridView().iend( entity.impl().hostEntity() ) );
218 const Communication &comm ()
const
220 return hostGridView().comm();
223 int overlapSize (
int codim )
const
225 return hostGridView().overlapSize( codim );
228 int ghostSize (
int codim )
const
230 return hostGridView().ghostSize( codim );
233 template<
class DataHandle,
class Data >
234 auto communicate ( CommDataHandleIF< DataHandle, Data > &dataHandle,
238 typedef CommDataHandleIF< DataHandle, Data > DataHandleIF;
239 typedef GeoGrid::CommDataHandle< Grid, DataHandleIF > WrappedDataHandle;
241 WrappedDataHandle wrappedDataHandle( grid(), dataHandle );
242 return hostGridView().communicate( wrappedDataHandle, interface, direction );
245 const HostGridView &hostGridView ()
const {
return hostGridView_; }
249 HostGridView hostGridView_;
250 mutable IndexSet indexSet_;
interface class for an iterator over grid entities
Definition: entityiterator.hh:32
grid wrapper replacing the geometries
Definition: grid.hh:86
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
A few common exception classes.
Traits for type conversions and type information.
A set of traits classes to store static information about grid implementation.
Dune namespace.
Definition: alignedallocator.hh:13
Communication< T > CollectiveCommunication
Definition: communication.hh:541
@ conforming
use only conforming bisection refinement
Definition: declaration.hh:25