1#ifndef DUNE_FEM_GRIDPART_COMMON_GRIDVIEW2GRIDPART_HH
2#define DUNE_FEM_GRIDPART_COMMON_GRIDVIEW2GRIDPART_HH
6#include <dune/common/exceptions.hh>
8#include <dune/grid/common/gridenums.hh>
24 template<
class Gr
idView,
class Implementation,
bool storeCopy=true >
25 class GridView2GridPart;
34 template<
class Gr
idView,
class Implementation,
bool storeCopy >
35 struct GridView2GridPartTraits
37 typedef Implementation GridPartType;
39 typedef GridView GridViewType;
40 static const bool conforming = GridView::conforming;
56 template< PartitionIteratorType pitype >
63 typedef typename GridViewType::IntersectionIterator IntersectionIteratorType;
67 static const PartitionIteratorType indexSetPartitionType = All_Partition;
68 static const InterfaceType indexSetInterfaceType = All_All_Interface;
78 template<
class Gr
idView,
class Implementation,
bool storeCopy >
80 :
public GridPartInterface< GridView2GridPartTraits< GridView, Implementation, storeCopy > >
83 typedef GridView2GridPartTraits< GridView, Implementation, storeCopy > TraitsType;
95 :
public BaseType::template
Codim< codim >
131 : gridView_( rhs.gridView_ ),
153 template<
int codim >
156 return begin< codim, InteriorBorder_Partition >();
160 template<
int codim, PartitionIteratorType pitype >
163 return gridView_.template begin< codim, pitype >();
167 template<
int codim >
170 return end< codim, InteriorBorder_Partition >();
174 template<
int codim, PartitionIteratorType pitype >
177 return gridView_.template end< codim, pitype >();
183 return gridView_.ibegin(
entity );
189 return gridView_.iend(
entity );
196 template<
class DataHandle,
class DataType >
197 void communicate ( CommDataHandleIF< DataHandle, DataType > &dataHandle,
198 InterfaceType interface, CommunicationDirection direction )
const
200 gridView_.communicate( dataHandle, interface, direction );
207 template <
class EntitySeed >
208 typename Codim< EntitySeed::codimension >::EntityType
211 return grid().entity( seed );
215 template <
class Entity>
218 return convert< Entity::codimension >(
entity );
223 const GridView&
gridView()
const {
return gridView_; }
228 template<
int codim >
229 const typename Codim< codim >::EntityType &
230 convert(
const typename Codim< codim >::EntityType &
entity )
const
235 std::conditional_t<storeCopy,const GridView,const GridView &> gridView_;
237 DofManagerType &dofManager_;
int sequence() const
return number of sequence, if dofmanagers memory was changed by calling some method like resize,...
Definition: dofmanager.hh:978
Definition: bindguard.hh:11
Interface for the GridPart classes A GridPart class allows to access only a specific subset of a grid...
Definition: gridpart.hh:77
PoliciesType::GridViewType GridViewType
Definition: gridpart.hh:113
Traits::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridpart.hh:96
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridpart.hh:140
Traits::GridType GridType
type of Grid implementation
Definition: gridpart.hh:90
int boundaryId(const IntersectionType &intersection) const
return boundary if given an intersection
Definition: gridpart.hh:232
Traits::IntersectionIteratorType IntersectionIteratorType
type of IntersectionIterator
Definition: gridpart.hh:108
Traits::IndexSetType IndexSetType
Index set implementation.
Definition: gridpart.hh:93
Definition: gridview2gridpart.hh:81
Codim< codim >::IteratorType end() const
obtain end iterator for the interior-border partition
Definition: gridview2gridpart.hh:168
BaseType::IntersectionIteratorType IntersectionIteratorType
type of IntersectionIterator
Definition: gridview2gridpart.hh:99
GridView2GridPart(const ThisType &rhs)
Definition: gridview2gridpart.hh:130
const Entity & convert(const Entity &entity) const
return sequence number to update structures depending on the grid part
Definition: gridview2gridpart.hh:216
const IndexSetType & indexSet() const
Returns reference to index set of the underlying grid.
Definition: gridview2gridpart.hh:150
GridView2GridPart(const GridView &gridView)
Definition: gridview2gridpart.hh:118
Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: gridview2gridpart.hh:209
IntersectionIteratorType ibegin(const typename Codim< 0 >::EntityType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: gridview2gridpart.hh:181
IntersectionIteratorType iend(const typename Codim< 0 >::EntityType &entity) const
iend of corresponding intersection iterator for given entity
Definition: gridview2gridpart.hh:187
GridView2GridPart(GridView &&gridView)
Definition: gridview2gridpart.hh:124
Codim< codim >::template Partition< pitype >::IteratorType end() const
obtain end iterator for the interior-border partition
Definition: gridview2gridpart.hh:175
void communicate(CommDataHandleIF< DataHandle, DataType > &dataHandle, InterfaceType interface, CommunicationDirection direction) const
corresponding communication method for grid part
Definition: gridview2gridpart.hh:197
BaseType::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridview2gridpart.hh:105
BaseType::GridType GridType
type of Grid implementation
Definition: gridview2gridpart.hh:88
const GridView & gridView() const
cast to underlying grid view
Definition: gridview2gridpart.hh:223
Codim< codim >::template Partition< pitype >::IteratorType begin() const
obtain begin iterator for the interior-border partition
Definition: gridview2gridpart.hh:161
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridview2gridpart.hh:146
BaseType::GridViewType GridViewType
Definition: gridview2gridpart.hh:91
Codim< codim >::IteratorType begin() const
obtain begin iterator for the interior-border partition
Definition: gridview2gridpart.hh:154
BaseType::IndexSetType IndexSetType
Index set implementation.
Definition: gridview2gridpart.hh:102
~GridView2GridPart()
Definition: gridview2gridpart.hh:136
GridType & grid()
Definition: gridview2gridpart.hh:147
const CollectiveCommunicationType & comm() const
obtain collective communication object
Definition: gridview2gridpart.hh:193
int sequence() const
return sequence number to update structures depending on the grid part
Definition: gridview2gridpart.hh:204
Definition: gridview2gridpart.hh:96
wrapper for (adaptive) index sets that disables all support for adaptivity
Definition: nonadaptiveindexset.hh:55
BaseType::GridType GridType
type of Grid implementation
Definition: leafgridpart.hh:26
Utility to get twist from IntersectionIterator, if provided by grid (i.e. AlbertaGrid,...
Definition: twistutility.hh:84
Definition: dofmanager.hh:761