1 #ifndef DUNE_FEM_GRIDPART_COMMON_GRIDPART_HH 2 #define DUNE_FEM_GRIDPART_COMMON_GRIDPART_HH 5 #include <dune/common/bartonnackmanifcheck.hh> 6 #include <dune/common/deprecated.hh> 9 #include <dune/grid/common/datahandleif.hh> 10 #include <dune/grid/common/entity.hh> 11 #include <dune/grid/common/grid.hh> 67 template<
class Gr
idPartTraits >
103 = Traits::indexSetPartitionType;
105 = Traits::indexSetInterfaceType;
115 typedef typename GridType::ctype
ctype;
120 template<
int codim >
131 template< PartitionIteratorType pitype >
145 CHECK_INTERFACE_IMPLEMENTATION((asImp().
grid()));
146 return asImp().grid();
151 CHECK_INTERFACE_IMPLEMENTATION((asImp().
grid()));
152 return asImp().grid();
157 DUNE_DEPRECATED_MSG("gridPart.
gridView() is deprecated, use direct cast to GridPart::GridViewType instead")
159 return static_cast< GridViewType
>( asImp() );
165 CHECK_INTERFACE_IMPLEMENTATION((asImp().
indexSet()));
166 return asImp().indexSet();
173 template<
int codim >
177 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template begin< codim >()) );
178 return asImp().template begin< codim >();
186 template<
int codim, PartitionIteratorType pitype >
190 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template begin< codim, pitype >()) );
191 return asImp().template begin< codim, pitype >();
198 template<
int codim >
202 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template end< codim >()) );
203 return asImp().template end< codim >();
211 template<
int codim, PartitionIteratorType pitype >
215 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
template end< codim, pitype >()) );
216 return asImp().template end< codim, pitype >();
222 CHECK_INTERFACE_IMPLEMENTATION((asImp().
level()));
223 return asImp().level();
227 IntersectionIteratorType
230 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
ibegin( entity )) );
231 return asImp().ibegin( entity );
237 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
iend( entity )) );
238 return asImp().iend( entity );
242 int boundaryId (
const IntersectionType &intersection )
const 244 CHECK_INTERFACE_IMPLEMENTATION( asImp().
boundaryId( intersection ) );
245 return asImp().boundaryId( intersection );
249 const CollectiveCommunicationType &
comm ()
const 251 CHECK_INTERFACE_IMPLEMENTATION( asImp().
comm() );
252 return asImp().comm();
256 template<
class DataHandleImp,
class DataType >
257 void communicate ( CommDataHandleIF< DataHandleImp, DataType > &data,
258 InterfaceType iftype, CommunicationDirection dir )
const 260 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION( (asImp().
communicate( data, iftype, dir )) );
264 template <
class EntitySeed >
268 CHECK_INTERFACE_IMPLEMENTATION( asImp().
entity( seed ) );
269 return asImp().entity( seed );
278 template <
class Entity>
281 CHECK_INTERFACE_IMPLEMENTATION( asImp().
convert( entity ) );
282 return asImp().convert( entity );
290 CHECK_INTERFACE_IMPLEMENTATION( asImp().
sequence() );
291 return asImp().sequence() ;
299 GridPartType &asImp () {
return static_cast< GridPartType &
>( *this ); }
300 const GridPartType &asImp ()
const {
return static_cast< const GridPartType &
>( *this ); }
306 template<
class Gr
idPartTraits >
333 dofManager_( DofManagerType :: instance( grid_ ) )
337 : grid_( other.grid_ ),
338 dofManager_( DofManagerType :: instance( grid_ ) )
346 const GridType &
grid ()
const {
return grid_; }
349 GridType &
grid () {
return grid_; }
352 const CollectiveCommunicationType &
comm ()
const 354 return grid().comm();
364 template <
class EntitySeed >
368 return grid().entity( seed );
375 template <
class Entity>
393 template<
class Entity >
396 template<
int codim,
int dim,
class Gr
id,
template<
int,
int,
class >
class EntityImpl >
399 typedef Dune::Entity< codim, dim, Grid, EntityImpl >
EntityType;
408 template<
class Entity >
419 #endif // #define DUNE_FEM_GRIDPART_COMMON_GRIDPART_HH Default implementation for the GridPart classes.
Definition: gridpart.hh:307
Codim< codim >::template Partition< pitype >::IteratorType end() const
obtain end iterator for the given partition
Definition: gridpart.hh:213
Traits::IndexSetType IndexSetType
Index set implementation.
Definition: gridpart.hh:318
GridType & grid_
Definition: gridpart.hh:326
Traits::GridType GridType
Grid implementation.
Definition: gridpart.hh:316
GridViewType gridView() const
convert grid part into a dune grid view
Definition: gridpart.hh:156
const CollectiveCommunicationType & comm() const
obtain collective communication object
Definition: gridpart.hh:352
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridpart.hh:346
Traits::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridpart.hh:96
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
corresponding communication method for grid part
Definition: gridpart.hh:257
Definition: gridpart.hh:394
Definition: gridpart.hh:132
Codim< codim >::IteratorType end() const
obtain end iterator for the interior-border partition
Definition: gridpart.hh:200
GridType::ctype ctype
Definition: gridpart.hh:115
static const InterfaceType indexSetInterfaceType
Definition: gridpart.hh:105
Traits::CollectiveCommunicationType CollectiveCommunicationType
Collective communication.
Definition: gridpart.hh:321
Traits::template Codim< codim >::GeometryType GeometryType
Definition: gridpart.hh:123
IntersectionIteratorType ibegin(const typename Codim< 0 >::EntityType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: gridpart.hh:228
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:279
Traits::template Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: gridpart.hh:366
GridType::CollectiveCommunication CollectiveCommunicationType
Definition: adaptiveleafgridpart.hh:264
const CollectiveCommunicationType & comm() const
obtain collective communication object
Definition: gridpart.hh:249
Definition: datacollector.hh:45
Traits::GridPartType GridPartType
Type of the implementation.
Definition: gridpart.hh:87
Partition< InteriorBorder_Partition >::IteratorType IteratorType
Definition: gridpart.hh:138
Definition: gridpart.hh:121
int sequence() const
return sequence number to update structures depending on the grid part
Definition: gridpart.hh:288
const IndexSetType & indexSet() const
Returns reference to index set of the underlying grid.
Definition: gridpart.hh:163
static const int dimension
Definition: gridpart.hh:117
Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
obtain entity pointer from entity seed
Definition: gridpart.hh:266
GridPartDefault(const ThisType &other)
Definition: gridpart.hh:336
GridPartTraits Traits
Type of the Traits.
Definition: gridpart.hh:314
Codim< codim >::IteratorType begin() const
obtain begin iterator for the interior-border partition
Definition: gridpart.hh:175
Dune::Entity< codim, dim, Grid, EntityImpl > GridEntityType
Definition: gridpart.hh:400
Traits::template Codim< codim >::EntityPointerType EntityPointerType
Definition: gridpart.hh:126
Codim< codim >::template Partition< pitype >::IteratorType begin() const
obtain begin iterator for the given partition
Definition: gridpart.hh:188
Traits::template Codim< codim >::EntitySeedType EntitySeedType
Definition: gridpart.hh:129
Traits::IntersectionIteratorType IntersectionIteratorType
type of IntersectionIterator
Definition: gridpart.hh:108
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridpart.hh:143
GridType & grid()
Returns reference to the underlying grid.
Definition: gridpart.hh:349
Traits::TwistUtilityType TwistUtilityType
Twist utility type.
Definition: gridpart.hh:99
int sequence() const
return number of sequence, if dofmanagers memory was changed by calling some method like resize...
Definition: dofmanager.hh:1047
Definition: coordinate.hh:4
IntersectionIteratorType::Intersection IntersectionType
type of Intersection
Definition: gridpart.hh:111
Traits::IndexSetType IndexSetType
Index set implementation.
Definition: gridpart.hh:93
static const PartitionIteratorType indexSetPartitionType
Maximum Partition type, the index set provides indices for.
Definition: gridpart.hh:103
GridPartDefault(GridType &grid)
constructor
Definition: gridpart.hh:331
IntersectionIteratorType iend(const typename Codim< 0 >::EntityType &entity) const
iend of corresponding intersection iterator for given entity
Definition: gridpart.hh:235
Traits::template Codim< codim >::LocalGeometryType LocalGeometryType
Definition: gridpart.hh:124
DofManager< GridType > DofManagerType
type of DofManager
Definition: gridpart.hh:324
GridPartInterface()
do not create explicit instances of this class
Definition: gridpart.hh:296
const GridEntityAccess< Entity >::GridEntityType & gridEntity(const Entity &entity)
Definition: gridpart.hh:410
Traits::template Codim< codim >::template Partition< pitype >::IteratorType IteratorType
Definition: gridpart.hh:135
static const GridEntityType & gridEntity(const EntityType &entity)
Definition: gridpart.hh:402
Definition: policies.hh:21
Traits::GridType GridType
type of Grid implementation
Definition: gridpart.hh:90
GridPartTraits Traits
Type of the Traits.
Definition: gridpart.hh:84
~GridPartDefault()
Definition: gridpart.hh:341
int boundaryId(const IntersectionType &intersection) const
return boundary if given an intersection
Definition: gridpart.hh:242
Interface for the GridPart classes A GridPart class allows to access only a specific subset of a grid...
Definition: gridpart.hh:75
Grid GridType
type of the grid
Definition: adaptiveleafgridpart.hh:256
DofManagerType & dofManager_
Definition: gridpart.hh:327
PoliciesType::GridViewType GridViewType
Definition: gridpart.hh:113
Dune::Entity< codim, dim, Grid, EntityImpl > EntityType
Definition: gridpart.hh:399
int sequence() const
return sequence number to update structures depending on the grid part
Definition: gridpart.hh:385
Definition: adaptiveleafindexset.hh:33
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:376
GridType & grid()
Returns reference to the underlying grid.
Definition: gridpart.hh:149
static const int dimensionworld
Definition: gridpart.hh:118
int level() const
Level of the grid part.
Definition: gridpart.hh:220
Traits::template Codim< codim >::EntityType EntityType
Definition: gridpart.hh:127