1#ifndef DUNE_FEM_GRIDPART_COMMON_GRIDPART_HH
2#define DUNE_FEM_GRIDPART_COMMON_GRIDPART_HH
5#include <dune/common/bartonnackmanifcheck.hh>
8#include <dune/grid/common/datahandleif.hh>
9#include <dune/grid/common/entity.hh>
10#include <dune/grid/common/grid.hh>
74 template<
class Gr
idPartTraits >
103 = Traits::indexSetPartitionType;
105 = Traits::indexSetInterfaceType;
115 typedef typename GridType::ctype
ctype;
120 template<
int codim >
129 template< PartitionIteratorType pitype >
142 CHECK_INTERFACE_IMPLEMENTATION((asImp().
grid()));
143 return asImp().grid();
148 CHECK_INTERFACE_IMPLEMENTATION((asImp().
grid()));
149 return asImp().grid();
155 CHECK_INTERFACE_IMPLEMENTATION((asImp().
indexSet()));
156 return asImp().indexSet();
163 template<
int codim >
167 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template begin< codim >()) );
168 return asImp().template begin< codim >();
176 template<
int codim, PartitionIteratorType pitype >
177 typename Codim< codim >::template Partition< pitype >::IteratorType
180 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template begin< codim, pitype >()) );
181 return asImp().template begin< codim, pitype >();
188 template<
int codim >
192 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template end< codim >()) );
193 return asImp().template end< codim >();
201 template<
int codim, PartitionIteratorType pitype >
202 typename Codim< codim >::template Partition< pitype >::IteratorType
205 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template end< codim, pitype >()) );
206 return asImp().template end< codim, pitype >();
212 CHECK_INTERFACE_IMPLEMENTATION((asImp().
level()));
213 return asImp().level();
220 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
ibegin(
entity )) );
221 return asImp().ibegin(
entity );
227 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
iend(
entity )) );
228 return asImp().iend(
entity );
234 CHECK_INTERFACE_IMPLEMENTATION( asImp().
boundaryId( intersection ) );
235 return asImp().boundaryId( intersection );
241 CHECK_INTERFACE_IMPLEMENTATION( asImp().
comm() );
242 return asImp().comm();
246 template<
class DataHandleImp,
class DataType >
247 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
248 InterfaceType iftype, CommunicationDirection dir )
const
250 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION( (asImp().
communicate( data, iftype, dir )) );
254 template <
class EntitySeed >
258 CHECK_INTERFACE_IMPLEMENTATION( asImp().
entity( seed ) );
259 return asImp().entity( seed );
268 template <
class Entity>
272 return asImp().convert(
entity );
280 CHECK_INTERFACE_IMPLEMENTATION( asImp().
sequence() );
281 return asImp().sequence() ;
296 template<
class Gr
idPartTraits >
350 return grid().comm();
360 template <
class EntitySeed >
361 typename Traits::template Codim< EntitySeed::codimension >::EntityType
364 return grid().entity( seed );
371 template <
class Entity>
389 return BoundaryIdProviderType::boundaryId( intersection );
395 template<
class Entity >
398 template<
int codim,
int dim,
class Gr
id,
template<
int,
int,
class >
class EntityImpl >
401 typedef Dune::Entity< codim, dim, Grid, EntityImpl >
EntityType;
410 template<
class Entity >
411 const typename GridEntityAccess< Entity >::GridEntityType &
417 template<
class TraitsImp >
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
std::tuple_element< i, Tuple >::type & get(Dune::TypeIndexedTuple< Tuple, Types > &tuple)
Definition: typeindexedtuple.hh:122
const GridEntityAccess< Entity >::GridEntityType & gridEntity(const Entity &entity)
Definition: gridpart.hh:412
Interface for the GridPart classes A GridPart class allows to access only a specific subset of a grid...
Definition: gridpart.hh:77
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
corresponding communication method for grid part
Definition: gridpart.hh:247
int sequence() const
return sequence number to update structures depending on the grid part
Definition: gridpart.hh:278
GridType & grid()
Returns reference to the underlying grid.
Definition: gridpart.hh:146
GridPartTraits Traits
Type of the Traits.
Definition: gridpart.hh:84
PoliciesType::GridViewType GridViewType
Definition: gridpart.hh:113
Codim< codim >::IteratorType end() const
obtain end iterator for the interior-border partition
Definition: gridpart.hh:190
static const int dimensionworld
Definition: gridpart.hh:118
static const int dimension
Definition: gridpart.hh:117
Traits::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridpart.hh:96
Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: gridpart.hh:256
GridType::ctype ctype
Definition: gridpart.hh:115
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
Codim< codim >::IteratorType begin() const
obtain begin iterator for the interior-border partition
Definition: gridpart.hh:165
GridPartInterface()=default
do not create explicit instances of this class
Traits::TwistUtilityType TwistUtilityType
Twist utility type.
Definition: gridpart.hh:99
IntersectionIteratorType::Intersection IntersectionType
type of Intersection
Definition: gridpart.hh:111
static const InterfaceType indexSetInterfaceType
Definition: gridpart.hh:105
Codim< codim >::template Partition< pitype >::IteratorType end() const
obtain end iterator for the given partition
Definition: gridpart.hh:203
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: gridpart.hh:269
Codim< codim >::template Partition< pitype >::IteratorType begin() const
obtain begin iterator for the given partition
Definition: gridpart.hh:178
const CollectiveCommunicationType & comm() const
obtain collective communication object
Definition: gridpart.hh:239
int boundaryId(const IntersectionType &intersection) const
return boundary if given an intersection
Definition: gridpart.hh:232
IntersectionIteratorType iend(const typename Codim< 0 >::EntityType &entity) const
iend of corresponding intersection iterator for given entity
Definition: gridpart.hh:225
const IndexSetType & indexSet() const
Returns reference to index set of the underlying grid.
Definition: gridpart.hh:153
static const PartitionIteratorType indexSetPartitionType
Maximum Partition type, the index set provides indices for.
Definition: gridpart.hh:103
Traits::IntersectionIteratorType IntersectionIteratorType
type of IntersectionIterator
Definition: gridpart.hh:108
Traits::GridPartType GridPartType
Type of the implementation.
Definition: gridpart.hh:87
IntersectionIteratorType ibegin(const typename Codim< 0 >::EntityType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: gridpart.hh:218
Traits::IndexSetType IndexSetType
Index set implementation.
Definition: gridpart.hh:93
int level() const
Level of the grid part.
Definition: gridpart.hh:210
Definition: gridpart.hh:122
Traits::template Codim< codim >::EntitySeedType EntitySeedType
Definition: gridpart.hh:127
Traits::template Codim< codim >::LocalGeometryType LocalGeometryType
Definition: gridpart.hh:124
Traits::template Codim< codim >::GeometryType GeometryType
Definition: gridpart.hh:123
Traits::template Codim< codim >::EntityType EntityType
Definition: gridpart.hh:126
Partition< InteriorBorder_Partition >::IteratorType IteratorType
Definition: gridpart.hh:136
Definition: gridpart.hh:131
Traits::template Codim< codim >::template Partition< pitype >::IteratorType IteratorType
Definition: gridpart.hh:133
Default implementation for the GridPart classes.
Definition: gridpart.hh:299
DofManagerType & dofManager_
Definition: gridpart.hh:327
GridPartTraits Traits
Type of the Traits.
Definition: gridpart.hh:304
GridType & grid_
Definition: gridpart.hh:326
Traits::template Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: gridpart.hh:362
IntersectionIteratorType::Intersection IntersectionType
type of intersection
Definition: gridpart.hh:314
int boundaryId(const IntersectionType &intersection) const
obtain entity pointer from entity seed
Definition: gridpart.hh:387
Traits::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridpart.hh:317
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridpart.hh:342
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: gridpart.hh:372
const CollectiveCommunicationType & comm() const
obtain collective communication object
Definition: gridpart.hh:348
GridPartDefault(GridType &grid)
constructor
Definition: gridpart.hh:330
int sequence() const
return sequence number to update structures depending on the grid part
Definition: gridpart.hh:381
GridType & grid()
Returns reference to the underlying grid.
Definition: gridpart.hh:345
Traits::IndexSetType IndexSetType
Index set implementation.
Definition: gridpart.hh:308
BoundaryIdProvider< GridType > BoundaryIdProviderType
type of boundary id provider specialized for each grid type
Definition: gridpart.hh:323
DofManager< GridType > DofManagerType
type of DofManager
Definition: gridpart.hh:320
Traits::IntersectionIteratorType IntersectionIteratorType
type of intersection iterator
Definition: gridpart.hh:311
GridPartDefault(const ThisType &other)
Definition: gridpart.hh:335
Traits::GridType GridType
Grid implementation.
Definition: gridpart.hh:306
Definition: gridpart.hh:396
Dune::Entity< codim, dim, Grid, EntityImpl > EntityType
Definition: gridpart.hh:401
static const GridEntityType & gridEntity(const EntityType &entity)
Definition: gridpart.hh:404
Dune::Entity< codim, dim, Grid, EntityImpl > GridEntityType
Definition: gridpart.hh:402
Definition: gridpart.hh:419
const GridViewType & gridView() const
Definition: gridpart.hh:441
GridPart2GridViewImpl< GridPartType > GridViewType
Definition: gridpart.hh:421
AddGridView(const AddGridView &other)
Definition: gridpart.hh:432
AddGridView(const GridViewType *gridView)
Definition: gridpart.hh:428
AddGridView()
Definition: gridpart.hh:437
const GridViewType * gridView_
Definition: gridpart.hh:423
std::shared_ptr< GridViewType > gridViewStorage_
Definition: gridpart.hh:422
TraitsImp::GridPartType GridPartType
Definition: gridpart.hh:420
AddGridView(const GridPartType *gridPart)
Definition: gridpart.hh:424
Definition: gridpart2gridview.hh:69
Definition: policies.hh:95
Definition: boundaryidprovider.hh:36
Definition: dofmanager.hh:761