1 #ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_HH 2 #define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_HH 8 #include <dune/grid/common/datahandleif.hh> 9 #include <dune/grid/common/gridview.hh> 30 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet = false >
31 class FilteredGridPart;
38 template <
class FilteredGP,
class HostGP,
bool useFilteredIndexSet >
43 static IndexSetType *
create(
const FilteredGP &gridPart)
48 template <
class IndexSetPtr >
49 static const IndexSetType &
50 indexSet (
const FilteredGP &gridPart,
const IndexSetPtr *idxSetPtr )
59 template<
class FilteredGP,
class HostGP >
64 static IndexSetType *
create(
const FilteredGP &gridPart)
69 template <
class IndexSetPtr >
70 static const IndexSetType &
71 indexSet (
const FilteredGP &gridPart,
const IndexSetPtr * )
73 return gridPart.hostGridPart().indexSet();
82 template<
class Entity >
85 template<
int codim,
int dim,
class Gr
id,
template<
int,
int,
class >
class Impl >
91 template<
class Entity >
102 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet >
112 typedef typename HostGridPartType::GridType
GridType;
138 template<
int codim >
149 template< PartitionIteratorType pitype >
161 static const PartitionIteratorType indexSetPartitionType = HostGridPartType::indexSetPartitionType;
163 static const InterfaceType indexSetInterfaceType = HostGridPartType::indexSetInterfaceType;
166 static const bool conforming = HostGridPartType::Traits::conforming;
192 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet >
194 :
public GridPartInterface< FilteredGridPartTraits< HostGridPartImp, FilterImp, useFilteredIndexSet > >
225 template<
int codim >
238 : hostGridPart_( hostGridPart ),
242 indexSetPtr_ = IndexSetSelectorType::create( *
this );
254 : hostGridPart_( other.hostGridPart_ ),
255 filter_( other.filter_ ),
256 indexSetPtr_ ( IndexSetSelectorType::
create( *this ) )
262 return hostGridPart().grid();
268 return hostGridPart().grid();
275 return IndexSetSelectorType::indexSet( *
this, indexSetPtr_ );
279 template<
int codim >
282 return begin< codim, InteriorBorder_Partition >();
286 template<
int codim, PartitionIteratorType pitype >
290 typedef typename IteratorType::Implementation IteratorImpl;
291 return IteratorType( IteratorImpl( *
this, hostGridPart().
template begin< codim, pitype >() ) );
295 template<
int codim >
298 return end< codim, InteriorBorder_Partition >();
302 template<
int codim, PartitionIteratorType pitype >
306 typedef typename IteratorType::Implementation IteratorImpl;
307 return IteratorType( IteratorImpl( *
this, hostGridPart().
template end< codim, pitype >() ) );
313 return hostGridPart().level();
317 IntersectionIteratorType
ibegin (
const EntityType &entity )
const 323 IntersectionIteratorType
iend (
const EntityType &entity )
const 328 int boundaryId (
const IntersectionType &intersection )
const 333 const CollectiveCommunicationType &
comm ()
const {
return hostGridPart_.comm(); }
336 template <
class DataHandleImp,
class DataType >
337 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &dataHandle,
338 InterfaceType iftype, CommunicationDirection dir )
const 340 typedef CommDataHandleIF< DataHandleImp, DataType > HostHandleType;
342 hostGridPart().communicate( handleWrapper, iftype, dir );
346 template <
class EntitySeed >
350 return hostGridPart().entity( seed );
365 template<
class Entity >
368 return filter().contains( entity );
373 return hostGridPart_;
378 return hostGridPart_;
382 template <
class Entity>
383 const Entity&
convert (
const Entity &entity )
const 385 return hostGridPart().convert( entity );
389 HostGridPartType &hostGridPart_;
391 const IndexSetType *indexSetPtr_;
398 #endif // #ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_HH int boundaryId(const IntersectionType &intersection) const
Definition: filteredgridpart.hh:328
IndexSetSelectorType::IndexSetType IndexSetType
index set use in this gridpart
Definition: filteredgridpart.hh:127
Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: filteredgridpart.hh:348
FilteredGridPartIndexSetSelector< GridPartType, HostGridPartType, useFilteredIndexSet > IndexSetSelectorType
index set use in this gridpart
Definition: filteredgridpart.hh:124
bool contains(const Entity &entity) const
Definition: filteredgridpart.hh:366
HostGridPartType::template Codim< codim >::EntityType EntityType
Definition: filteredgridpart.hh:144
HostGP::IndexSetType IndexSetType
Definition: filteredgridpart.hh:62
const GridType & grid() const
return const reference to underlying grid
Definition: filteredgridpart.hh:260
FilteredGridPartTraits< HostGridPartImp, FilterImp, useFilteredIndexSet > Traits
traits class
Definition: filteredgridpart.hh:202
Traits::IntersectionIteratorType IntersectionIteratorType
intersection iterator type
Definition: filteredgridpart.hh:217
const FilterType & filter() const
return reference to filter
Definition: filteredgridpart.hh:354
Definition: filteredgridpart/intersectioniterator.hh:23
~FilteredGridPart()
destructor
Definition: filteredgridpart.hh:246
Definition: filteredgridpart.hh:39
void communicate(CommDataHandleIF< DataHandleImp, DataType > &dataHandle, InterfaceType iftype, CommunicationDirection dir) const
corresponding communication method for this grid part
Definition: filteredgridpart.hh:337
static const IndexSetType & indexSet(const FilteredGP &gridPart, const IndexSetPtr *idxSetPtr)
Definition: filteredgridpart.hh:50
IntersectionIteratorType::Intersection IntersectionType
intersection type
Definition: filteredgridpart.hh:220
IntersectionIteratorType iend(const EntityType &entity) const
iend of corresponding intersection iterator for given entity
Definition: filteredgridpart.hh:323
const CollectiveCommunicationType & comm() const
Definition: filteredgridpart.hh:333
struct providing types of the iterators on codimension cd
Definition: filteredgridpart.hh:139
HostGridPartType::template Codim< codim >::LocalGeometryType LocalGeometryType
Definition: filteredgridpart.hh:142
int level() const
Returns maxlevel of the grid.
Definition: filteredgridpart.hh:311
Codim< codim >::template Partition< pitype >::IteratorType end() const
End iterator on the leaf level.
Definition: filteredgridpart.hh:303
A FilteredGridPart allows to extract a set of entities from a grid satisfying a given constrainted de...
Definition: gridpart/filteredgridpart/capabilities.hh:23
int boundaryId() const
overloaded boundaryId method
Definition: filteredgridpart/intersectioniterator.hh:177
HostGridPartImp HostGridPartType
grid part imp
Definition: filteredgridpart.hh:109
static const IndexSetType & indexSet(const FilteredGP &gridPart, const IndexSetPtr *)
Definition: filteredgridpart.hh:71
Traits::IndexSetType IndexSetType
index set type
Definition: filteredgridpart.hh:214
IntersectionIteratorType ibegin(const EntityType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: filteredgridpart.hh:317
Definition: filteredgridpart.hh:83
const HostGridPartType & hostGridPart() const
Definition: filteredgridpart.hh:376
Codim< codim >::template Partition< pitype >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:287
Codim< codim >::IteratorType end() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:296
FilterType & filter()
return reference to filter
Definition: filteredgridpart.hh:360
HostGridPartType::Traits::IntersectionIteratorType HostIntersectionIteratorType
of host grid part intersection iterator type
Definition: filteredgridpart.hh:130
Definition: filteredgridpart.hh:150
Definition: filteredgridpart/datahandle.hh:29
Definition: coordinate.hh:4
HostGridPartType::template Codim< codim >::EntitySeedType EntitySeedType
Definition: filteredgridpart.hh:147
Codim< codim >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:280
Traits::HostGridPartType HostGridPartType
Definition: filteredgridpart.hh:208
const Entity & convert(const Entity &entity) const
convert the grid's entity to a grid part entity Usually the parameter is GridType :: Codim< codim > :...
Definition: filteredgridpart.hh:383
AdaptiveLeafIndexSet< FilteredGP > IndexSetType
Definition: filteredgridpart.hh:41
Traits::CollectiveCommunicationType CollectiveCommunicationType
Definition: filteredgridpart.hh:222
Definition: filteredgridpart.hh:103
FilteredGridPartIntersectionIterator< const FilterType, const GridPartType, HostIntersectionIteratorType > IntersectionIteratorType
type of intersection iterator
Definition: filteredgridpart.hh:133
static IndexSetType * create(const FilteredGP &gridPart)
Definition: filteredgridpart.hh:64
Grid Type
Definition: filteredgridpart.hh:88
FilterImp FilterType
type of filter
Definition: filteredgridpart.hh:205
HostGridPartType::GridType GridType
type of grid
Definition: filteredgridpart.hh:112
FilterType::EntityType EntityType
type of entity
Definition: filteredgridpart.hh:121
FilteredGridPart(HostGridPartType &hostGridPart, const FilterType &filter)
constructor
Definition: filteredgridpart.hh:237
IntersectionIteratorType::Intersection IntersectionType
Definition: filteredgridpart.hh:135
const IndexSetType & indexSet() const
return index set of this grid part
Definition: filteredgridpart.hh:273
HostGridPartType::template Codim< codim >::EntityPointerType EntityPointerType
Definition: filteredgridpart.hh:145
MetaTwistUtility forwards the twist calls to the TwistUtility of the underlying HostTwistUtility.
Definition: metatwistutility.hh:21
HostGridPartType::template Codim< codim >::GeometryType GeometryType
Definition: filteredgridpart.hh:141
Partition< InteriorBorder_Partition >::IteratorType IteratorType
Definition: filteredgridpart.hh:155
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set ...
Definition: adaptiveleafindexset.hh:31
Interface for the GridPart classes A GridPart class allows to access only a specific subset of a grid...
Definition: gridpart.hh:75
EntityGridTypeGetter< Entity >::Type Type
Definition: filteredgridpart.hh:94
FilterImp FilterType
export filter type
Definition: filteredgridpart.hh:118
Traits::GridType GridType
grid type
Definition: filteredgridpart.hh:211
static IndexSetType * create(const FilteredGP &gridPart)
Definition: filteredgridpart.hh:43
MetaTwistUtility< typename HostGridPartType::TwistUtilityType > TwistUtilityType
The type of the corresponding TwistUtility.
Definition: filteredgridpart.hh:115
HostGridPartType::CollectiveCommunicationType CollectiveCommunicationType
Definition: filteredgridpart.hh:158
grid part typedefs, use those of traits
Definition: filteredgridpart.hh:226
FilteredGridPart(const FilteredGridPart &other)
copy constructor
Definition: filteredgridpart.hh:253
Dune::EntityIterator< codim, typename EntityGridTypeGetter< EntityType >::Type, FilteredGridPartIterator< codim, pitype, GridPartType > > IteratorType
Definition: filteredgridpart.hh:152
Definition: filteredgridpart/iterator.hh:20
HostGridPartType & hostGridPart()
Definition: filteredgridpart.hh:371
GridType & grid()
return reference to underlying grid
Definition: filteredgridpart.hh:266
FilteredGridPart< HostGridPartImp, FilterImp, useFilteredIndexSet > GridPartType
type of grid part
Definition: filteredgridpart.hh:106