1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_HH
9#include <dune/grid/common/datahandleif.hh>
10#include <dune/grid/common/gridview.hh>
32 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet = false >
33 class FilteredGridPart;
40 template <
class FilteredGP,
class HostGP,
bool useFilteredIndexSet >
50 template <
class IndexSetPtr >
52 indexSet (
const FilteredGP &gridPart,
const std::unique_ptr< IndexSetPtr >& idxSetPtr )
65 template<
class FilteredGP,
class HostGP >
75 template <
class IndexSetPtr >
77 indexSet (
const FilteredGP &gridPart,
const std::unique_ptr< IndexSetPtr >& )
79 return gridPart.hostGridPart().indexSet();
88 template<
class Entity >
91 template<
int codim,
int dim,
class Gr
id,
template<
int,
int,
class >
class Impl >
97 template<
class Entity >
108 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet >
122 typedef typename HostGridPart::ctype
ctype;
127 typedef Dune::IntersectionIterator< const GridPartFamily, IntersectionIteratorImpl, IntersectionImpl >
IntersectionIterator;
128 typedef Dune::Intersection< const GridPartFamily, IntersectionImpl >
Intersection;
130 template<
int codim >
145 typedef typename HostGridPartType::GridType
GridType;
172 template<
int codim >
181 template< PartitionIteratorType pitype >
198 static const bool conforming = HostGridPartType::Traits::conforming;
224 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet >
226 :
public GridPartInterface< FilteredGridPartTraits< HostGridPartImp, FilterImp, useFilteredIndexSet > >
227 ,
public AddGridView< FilteredGridPartTraits< HostGridPartImp, FilterImp, useFilteredIndexSet > >
261 template<
int codim >
292 hostGridPart_( other.hostGridPart_ ),
293 filter_( other.filter_ ),
317 template<
int codim >
320 return begin< codim, InteriorBorder_Partition >();
324 template<
int codim, PartitionIteratorType pitype >
329 return IteratorType( IteratorImpl( *
this,
hostGridPart().
template begin< codim, pitype >() ) );
333 template<
int codim >
336 return end< codim, InteriorBorder_Partition >();
340 template<
int codim, PartitionIteratorType pitype >
345 return IteratorType( IteratorImpl( *
this,
hostGridPart().
template end< codim, pitype >() ) );
357 typedef typename IntersectionIteratorType::Implementation IntersectionIteratorImpl;
364 typedef typename IntersectionIteratorType::Implementation IntersectionIteratorImpl;
371 return hostGridPart().boundaryId( intersection.impl().hostIntersection() );
377 template <
class DataHandleImp,
class DataType >
378 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &dataHandle,
379 InterfaceType iftype, CommunicationDirection dir )
const
381 typedef CommDataHandleIF< DataHandleImp, DataType > HostHandleType;
383 hostGridPart().communicate( handleWrapper, iftype, dir );
387 template <
class EntitySeed >
388 typename Codim< EntitySeed::codimension >::EntityType
406 template<
class Entity >
414 return hostGridPart_;
419 return hostGridPart_;
423 template <
class Entity>
432 std::unique_ptr< IndexSetType > indexSetPtr_;
Definition: bindguard.hh:11
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set
Definition: adaptiveleafindexset.hh:1345
Interface for the GridPart classes A GridPart class allows to access only a specific subset of a grid...
Definition: gridpart.hh:77
Definition: gridpart.hh:419
const GridViewType & gridView() const
Definition: gridpart.hh:441
Definition: gridpart2gridview.hh:69
MetaTwistUtility forwards the twist calls to the TwistUtility of the underlying HostTwistUtility.
Definition: metatwistutility.hh:22
A FilteredGridPart allows to extract a set of entities from a grid satisfying a given constrainted de...
Definition: filteredgridpart.hh:228
int boundaryId(const IntersectionType &intersection) const
boundary id
Definition: filteredgridpart.hh:369
FilteredGridPart(HostGridPartType &hostGridPart, const FilterType &filter)
constructor
Definition: filteredgridpart.hh:273
GridType & grid()
return reference to underlying grid
Definition: filteredgridpart.hh:304
Codim< codim >::template Partition< pitype >::IteratorType end() const
End iterator on the leaf level.
Definition: filteredgridpart.hh:341
IntersectionIteratorType ibegin(const EntityType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: filteredgridpart.hh:355
Codim< codim >::IteratorType end() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:334
const GridType & grid() const
return const reference to underlying grid
Definition: filteredgridpart.hh:298
Traits::CollectiveCommunicationType CollectiveCommunicationType
Definition: filteredgridpart.hh:256
FilteredGridPart(HostGridPartType &hostGridPart, const FilterType &filter, const GridViewType *gridView)
Definition: filteredgridpart.hh:281
Traits::GridType GridType
grid type
Definition: filteredgridpart.hh:245
Traits::IndexSetType IndexSetType
index set type
Definition: filteredgridpart.hh:248
int level() const
Returns maxlevel of the grid.
Definition: filteredgridpart.hh:349
const CollectiveCommunicationType & comm() const
Definition: filteredgridpart.hh:374
Traits::IntersectionIteratorType IntersectionIteratorType
intersection iterator type
Definition: filteredgridpart.hh:251
Codim< codim >::template Partition< pitype >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:325
Codim< codim >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: filteredgridpart.hh:318
const HostGridPartType & hostGridPart() const
Definition: filteredgridpart.hh:417
AddGridViewType::GridViewType GridViewType
Definition: filteredgridpart.hh:258
FilterType & filter()
return reference to filter
Definition: filteredgridpart.hh:401
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:424
bool contains(const Entity &entity) const
Definition: filteredgridpart.hh:407
HostGridPartType & hostGridPart()
Definition: filteredgridpart.hh:412
FilteredGridPart(const FilteredGridPart &other)
copy constructor
Definition: filteredgridpart.hh:290
Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: filteredgridpart.hh:389
FilteredGridPartTraits< HostGridPartImp, FilterImp, useFilteredIndexSet > Traits
traits class
Definition: filteredgridpart.hh:236
FilterImp FilterType
type of filter
Definition: filteredgridpart.hh:239
Traits::HostGridPartType HostGridPartType
Definition: filteredgridpart.hh:242
const IndexSetType & indexSet() const
return index set of this grid part
Definition: filteredgridpart.hh:311
const FilterType & filter() const
return reference to filter
Definition: filteredgridpart.hh:395
void communicate(CommDataHandleIF< DataHandleImp, DataType > &dataHandle, InterfaceType iftype, CommunicationDirection dir) const
corresponding communication method for this grid part
Definition: filteredgridpart.hh:378
IntersectionIteratorType iend(const EntityType &entity) const
iend of corresponding intersection iterator for given entity
Definition: filteredgridpart.hh:362
IntersectionIteratorType::Intersection IntersectionType
intersection type
Definition: filteredgridpart.hh:254
Definition: filteredgridpart.hh:42
static IndexSetType * create(const FilteredGP &gridPart)
Definition: filteredgridpart.hh:45
AdaptiveLeafIndexSet< FilteredGP > IndexSetType
Definition: filteredgridpart.hh:43
static const IndexSetType & indexSet(const FilteredGP &gridPart, const std::unique_ptr< IndexSetPtr > &idxSetPtr)
Definition: filteredgridpart.hh:52
static IndexSetType * create(const FilteredGP &gridPart)
Definition: filteredgridpart.hh:70
static const IndexSetType & indexSet(const FilteredGP &gridPart, const std::unique_ptr< IndexSetPtr > &)
Definition: filteredgridpart.hh:77
HostGP::IndexSetType IndexSetType
Definition: filteredgridpart.hh:68
Definition: filteredgridpart.hh:89
EntityGridTypeGetter< Entity >::Type Type
Definition: filteredgridpart.hh:100
Definition: filteredgridpart.hh:110
HostGridPartImp HostGridPartType
grid part imp
Definition: filteredgridpart.hh:142
FilterType::EntityType EntityType
type of entity
Definition: filteredgridpart.hh:154
HostGridPartType::Traits::IntersectionIteratorType HostIntersectionIteratorType
of host grid part intersection iterator type
Definition: filteredgridpart.hh:163
GridPartFamily::Intersection IntersectionType
type of intersection
Definition: filteredgridpart.hh:169
IndexSetSelectorType::IndexSetType IndexSetType
index set use in this gridpart
Definition: filteredgridpart.hh:160
FilteredGridPartIndexSetSelector< GridPartType, HostGridPartType, useFilteredIndexSet > IndexSetSelectorType
index set use in this gridpart
Definition: filteredgridpart.hh:157
FilteredGridPart< HostGridPartImp, FilterImp, useFilteredIndexSet > GridPartType
type of grid part
Definition: filteredgridpart.hh:112
static const bool conforming
is true if grid on this view only has conforming intersections
Definition: filteredgridpart.hh:198
MetaTwistUtility< typename HostGridPartType ::TwistUtilityType > TwistUtilityType
The type of the corresponding TwistUtility.
Definition: filteredgridpart.hh:148
static const InterfaceType indexSetInterfaceType
Definition: filteredgridpart.hh:195
static const PartitionIteratorType indexSetPartitionType
maximum partition type, the index set provides indices for
Definition: filteredgridpart.hh:193
HostGridPartType::CollectiveCommunicationType CollectiveCommunicationType
Definition: filteredgridpart.hh:190
HostGridPartType::GridType GridType
type of grid
Definition: filteredgridpart.hh:145
GridPartFamily::IntersectionIterator IntersectionIteratorType
type of intersection iterator
Definition: filteredgridpart.hh:166
FilterImp FilterType
export filter type
Definition: filteredgridpart.hh:151
Definition: filteredgridpart.hh:115
Dune::Intersection< const GridPartFamily, IntersectionImpl > Intersection
Definition: filteredgridpart.hh:128
HostGridPart::ctype ctype
Definition: filteredgridpart.hh:122
HostGridPartImp HostGridPart
Definition: filteredgridpart.hh:117
static const int dimension
Definition: filteredgridpart.hh:119
FilterImp Filter
Definition: filteredgridpart.hh:116
FilteredGridPartIntersectionIterator< const GridPartFamily > IntersectionIteratorImpl
Definition: filteredgridpart.hh:124
FilteredGridPartIntersection< Filter, typename HostGridPart::IntersectionType > IntersectionImpl
Definition: filteredgridpart.hh:125
static const int dimensionworld
Definition: filteredgridpart.hh:120
Dune::IntersectionIterator< const GridPartFamily, IntersectionIteratorImpl, IntersectionImpl > IntersectionIterator
Definition: filteredgridpart.hh:127
Definition: filteredgridpart.hh:132
HostGridPart::template Codim< codim >::LocalGeometryType LocalGeometry
Definition: filteredgridpart.hh:134
HostGridPart::template Codim< codim >::EntityType Entity
Definition: filteredgridpart.hh:136
HostGridPart::template Codim< codim >::GeometryType Geometry
Definition: filteredgridpart.hh:133
HostGridPart::template Codim< codim >::EntitySeedType EntitySeed
Definition: filteredgridpart.hh:137
struct providing types of the iterators on codimension cd
Definition: filteredgridpart.hh:174
HostGridPartType::template Codim< codim >::LocalGeometryType LocalGeometryType
Definition: filteredgridpart.hh:176
Partition< InteriorBorder_Partition >::IteratorType IteratorType
Definition: filteredgridpart.hh:187
HostGridPartType::template Codim< codim >::EntitySeedType EntitySeedType
Definition: filteredgridpart.hh:179
HostGridPartType::template Codim< codim >::GeometryType GeometryType
Definition: filteredgridpart.hh:175
HostGridPartType::template Codim< codim >::EntityType EntityType
Definition: filteredgridpart.hh:178
Definition: filteredgridpart.hh:183
Dune::EntityIterator< codim, typename EntityGridTypeGetter< EntityType >::Type, FilteredGridPartIterator< codim, pitype, GridPartType > > IteratorType
Definition: filteredgridpart.hh:184
grid part typedefs, use those of traits
Definition: filteredgridpart.hh:263
Definition: gridpart/filteredgridpart/datahandle.hh:31
Definition: filteredgridpart/intersection.hh:21
Definition: filteredgridpart/intersectioniterator.hh:24
Definition: filteredgridpart/iterator.hh:21