1 #ifndef DUNE_FEM_ADAPTIVELEAFGRIDPART_HH
2 #define DUNE_FEM_ADAPTIVELEAFGRIDPART_HH
5 #include <dune/grid/common/gridview.hh>
39 template <PartitionIteratorType ittype>
42 static const InterfaceType
value = InteriorBorder_All_Interface;
47 static const InterfaceType
value = InteriorBorder_InteriorBorder_Interface;
63 template<
class TraitsImp >
88 typedef typename GridType::LeafGridView LeafGridView;
106 return (&
grid_) == (& other.grid_ );
109 operator std::unique_ptr< GridPartType > ()
const
174 template<
int codim >
175 typename Codim< codim > :: IteratorType
178 return begin< codim, InteriorBorder_Partition >();
182 template<
int codim, PartitionIteratorType pitype >
183 typename Codim< codim > :: template Partition< pitype > :: IteratorType
190 template<
int codim >
191 typename Codim< codim > :: IteratorType
194 return end< codim, InteriorBorder_Partition >();
198 template<
int codim, PartitionIteratorType pitype >
199 typename Codim< codim > :: template Partition< pitype > :: IteratorType
222 return grid().maxLevel();
226 template<
class DataHandle,
class Data >
227 decltype(
auto )
communicate ( CommDataHandleIF< DataHandle, Data > &data, InterfaceType iftype, CommunicationDirection dir )
const
251 template<
class Gr
id, PartitionIteratorType
idxpitype = All_Partition,
bool onlyCodimensionZero = false >
252 class AdaptiveLeafGridPart;
255 template<
class Gr
id, PartitionIteratorType
idxpitype ,
bool onlyCodimensionZero >
273 template <
int dummy,
bool onlyCodimZero >
302 template<
int codim >
305 typedef typename GridType::template Codim< codim >::Geometry
GeometryType;
308 typedef typename GridType::template Codim< codim >::Entity
EntityType;
311 template< PartitionIteratorType pitype >
319 static const bool conforming = Dune::Capabilities::isLeafwiseConforming< GridType > :: v;
322 template<
class Gr
id, PartitionIteratorType
idxpitype ,
bool onlyCodimensionZero >
324 :
public AdaptiveGridPartBase< AdaptiveLeafGridPartTraits< Grid, idxpitype, onlyCodimensionZero > >
353 template<
class Gr
id, PartitionIteratorType
idxpitype = All_Partition >
357 template<
class Gr
id, PartitionIteratorType
idxpitype = All_Partition >
367 template<
class Gr
id, PartitionIteratorType
idxpitype >
385 template<
class Gr
id, PartitionIteratorType
idxpitype >
414 namespace GridPartCapabilities
420 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero >
423 static const bool v =
true;
426 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero >
429 static const bool v = Dune::Capabilities::hasSingleGeometryType< Grid >::v;
431 = Dune::Capabilities::hasSingleGeometryType< Grid >::topologyId;
434 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero >
437 static const bool v = Dune::Capabilities::isCartesian< Grid >::v;
440 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero,
int codim >
443 static const bool v = Dune::Capabilities::hasEntity< Grid, codim >::v;
446 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero,
int codim >
449 static const bool v = Dune::Capabilities::canCommunicate< Grid, codim >::v;
452 template<
class Gr
id, PartitionIteratorType
idxpitype,
bool onlyCodimensionZero >
455 static const bool v = Dune::Capabilities::isLeafwiseConforming< Grid >::v;
462 template<
class Gr
id, PartitionIteratorType
idxpitype >
465 static const bool v =
true;
468 template<
class Gr
id, PartitionIteratorType
idxpitype >
471 static const bool v = Dune::Capabilities::hasSingleGeometryType< Grid >::v;
473 = Dune::Capabilities::hasSingleGeometryType< Grid >::topologyId;
476 template<
class Gr
id, PartitionIteratorType
idxpitype >
479 static const bool v = Dune::Capabilities::isCartesian< Grid >::v;
482 template<
class Gr
id, PartitionIteratorType
idxpitype,
int codim >
485 static const bool v = Dune::Capabilities::hasEntity< Grid, codim >::v;
488 template<
class Gr
id, PartitionIteratorType
idxpitype,
int codim >
491 static const bool v = Dune::Capabilities::canCommunicate< Grid, codim >::v;
494 template<
class Gr
id, PartitionIteratorType
idxpitype >
497 static const bool v = Dune::Capabilities::isLeafwiseConforming< Grid >::v;
504 template<
class Gr
id, PartitionIteratorType
idxpitype >
507 static const bool v =
true;
510 template<
class Gr
id, PartitionIteratorType
idxpitype >
513 static const bool v = Dune::Capabilities::hasSingleGeometryType< Grid >::v;
515 = Dune::Capabilities::hasSingleGeometryType< Grid >::topologyId;
518 template<
class Gr
id, PartitionIteratorType
idxpitype >
521 static const bool v = Dune::Capabilities::isCartesian< Grid >::v;
524 template<
class Gr
id, PartitionIteratorType
idxpitype,
int codim >
527 static const bool v = Dune::Capabilities::hasEntity< Grid, codim >::v;
530 template<
class Gr
id, PartitionIteratorType
idxpitype,
int codim >
533 static const bool v = Dune::Capabilities::canCommunicate< Grid, codim >::v;
536 template<
class Gr
id, PartitionIteratorType
idxpitype >
539 static const bool v = Dune::Capabilities::isLeafwiseConforming< Grid >::v;
Definition: bindguard.hh:11
Definition: adaptiveleafgridpart.hh:41
static const InterfaceType value
Definition: adaptiveleafgridpart.hh:42
A grid part with an index set specially designed for adaptive calculations.
Definition: adaptiveleafgridpart.hh:66
Traits ::GridType GridType
Grid implementation type.
Definition: adaptiveleafgridpart.hh:77
IntersectionIteratorType iend(const ElementType &entity) const
iend of corresponding intersection iterator for given entity
Definition: adaptiveleafgridpart.hh:214
IntersectionIteratorType ibegin(const ElementType &entity) const
ibegin of corresponding intersection iterator for given entity
Definition: adaptiveleafgridpart.hh:207
int level() const
Returns maxlevel of the grid.
Definition: adaptiveleafgridpart.hh:220
SingletonList< KeyType, IndexSetType > IndexSetProviderType
Definition: adaptiveleafgridpart.hh:116
AdaptiveGridPartBase(GridType &grid, const KeyType *)
Constructor constructing object held by index set (for iterator access)
Definition: adaptiveleafgridpart.hh:146
GridPartType & asImp()
Definition: adaptiveleafgridpart.hh:238
LeafGridView leafGridView_
Definition: adaptiveleafgridpart.hh:122
Codim< codim >::IteratorType end() const
Begin iterator on the leaf level.
Definition: adaptiveleafgridpart.hh:192
Traits ::IndexSetType IndexSetType
The leaf index set of the grid implementation.
Definition: adaptiveleafgridpart.hh:79
Codim< codim >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: adaptiveleafgridpart.hh:176
Codim< codim >::template Partition< pitype >::IteratorType begin() const
Begin iterator on the leaf level.
Definition: adaptiveleafgridpart.hh:184
Key KeyType
Definition: adaptiveleafgridpart.hh:114
const IndexSetType & indexSet() const
Returns reference to index set of the underlying grid.
Definition: adaptiveleafgridpart.hh:167
TraitsImp Traits
Type definitions.
Definition: adaptiveleafgridpart.hh:72
Codim< codim >::template Partition< pitype >::IteratorType end() const
End iterator on the leaf level.
Definition: adaptiveleafgridpart.hh:200
Traits ::GridPartType GridPartType
Grid implementation type.
Definition: adaptiveleafgridpart.hh:75
const GridPartType & asImp() const
Definition: adaptiveleafgridpart.hh:233
~AdaptiveGridPartBase()
Destructor removing index set, if only one reference left, index set removed.
Definition: adaptiveleafgridpart.hh:155
Codim< 0 >::EntityType ElementType
Definition: adaptiveleafgridpart.hh:119
AdaptiveGridPartBase(const ThisType &other)
Copy Constructor.
Definition: adaptiveleafgridpart.hh:138
AdaptiveGridPartBase(GridType &grid)
constructor
Definition: adaptiveleafgridpart.hh:131
IntersectionIteratorType::Intersection IntersectionType
type of intersection
Definition: adaptiveleafgridpart.hh:95
Traits::IntersectionIteratorType IntersectionIteratorType
type of intersection iterator
Definition: adaptiveleafgridpart.hh:92
const IndexSetType * indexSet_
Definition: adaptiveleafgridpart.hh:125
Struct providing types of the leaf iterators on codimension codim.
Definition: adaptiveleafgridpart.hh:85
Definition: adaptiveleafgridpart.hh:99
GridType & grid_
Definition: adaptiveleafgridpart.hh:100
Key(GridType &grid)
Definition: adaptiveleafgridpart.hh:101
bool operator==(const Key &other) const
Definition: adaptiveleafgridpart.hh:103
Definition: adaptiveleafgridpart.hh:325
AdaptiveLeafGridPart(GridType &grid)
Constructor.
Definition: adaptiveleafgridpart.hh:331
AdaptiveLeafGridPart(const AdaptiveLeafGridPart &other)=default
copy constructor
BaseType ::GridType GridType
Definition: adaptiveleafgridpart.hh:329
AdaptiveLeafGridPart(GridType &grid, const KeyType *dummy)
copy constructor (for construction from KeyType, no public use)
Definition: adaptiveleafgridpart.hh:337
Type definitions for the LeafGridPart class.
Definition: adaptiveleafgridpart.hh:257
AdaptiveLeafGridPart< GridType, idxpitype, onlyCodimensionZero > GridPartType
type of the grid part , i.e. this type
Definition: adaptiveleafgridpart.hh:263
Grid GridType
type of the grid
Definition: adaptiveleafgridpart.hh:260
static const bool conforming
is true if grid on this view only has conforming intersections
Definition: adaptiveleafgridpart.hh:319
IndexSetChooserType::IndexSetType IndexSetType
type of the index set
Definition: adaptiveleafgridpart.hh:294
AdaptiveLeafIndexSetChooser<-1, onlyCodimensionZero > IndexSetChooserType
Definition: adaptiveleafgridpart.hh:290
GridType::CollectiveCommunication CollectiveCommunicationType
Definition: adaptiveleafgridpart.hh:268
static const InterfaceType indexSetInterfaceType
Definition: adaptiveleafgridpart.hh:297
GridType::LeafGridView::IntersectionIterator IntersectionIteratorType
Definition: adaptiveleafgridpart.hh:300
static const PartitionIteratorType indexSetPartitionType
Definition: adaptiveleafgridpart.hh:296
TwistUtility< GridType > TwistUtilityType
The type of the corresponding TwistUtility.
Definition: adaptiveleafgridpart.hh:266
Definition: adaptiveleafgridpart.hh:275
AdaptiveLeafIndexSet< GridPartType > IndexSetType
Definition: adaptiveleafgridpart.hh:278
static const PartitionIteratorType indexSetPartitionType
Definition: adaptiveleafgridpart.hh:276
static const InterfaceType indexSetInterfaceType
Definition: adaptiveleafgridpart.hh:277
DGAdaptiveLeafIndexSet< GridPartType > IndexSetType
Definition: adaptiveleafgridpart.hh:286
Definition: adaptiveleafgridpart.hh:304
GridType::template Codim< codim >::Entity EntityType
Definition: adaptiveleafgridpart.hh:308
GridType::template Codim< codim >::Geometry GeometryType
Definition: adaptiveleafgridpart.hh:305
GridType::template Codim< codim >::EntitySeed EntitySeedType
Definition: adaptiveleafgridpart.hh:309
GridType::template Codim< codim >::LocalGeometry LocalGeometryType
Definition: adaptiveleafgridpart.hh:306
Definition: adaptiveleafgridpart.hh:313
GridType::template Codim< codim >::template Partition< pitype >::LeafIterator IteratorType
Definition: adaptiveleafgridpart.hh:314
A grid part with an index set specially designed for adaptive calculations including indices for inte...
Definition: adaptiveleafgridpart.hh:388
IntersectionAdaptiveLeafGridPart(const IntersectionAdaptiveLeafGridPart &other)=default
copy constructor
BaseType ::GridType GridType
Definition: adaptiveleafgridpart.hh:392
IntersectionAdaptiveLeafGridPart(GridType &grid)
Constructor.
Definition: adaptiveleafgridpart.hh:394
IntersectionAdaptiveLeafGridPart(GridType &grid, const KeyType *dummy)
copy constructor (for construction from KeyType, no public use)
Definition: adaptiveleafgridpart.hh:400
A grid part with an index set specially designed for adaptive calculations including indices for inte...
Definition: adaptiveleafgridpart.hh:369
IntersectionAdaptiveLeafGridPart< Grid, idxpitype > GridPartType
type of the grid part , i.e. this type
Definition: adaptiveleafgridpart.hh:372
IntersectionAdaptiveLeafIndexSet< GridPartType > IndexSetType
type of the index set
Definition: adaptiveleafgridpart.hh:375
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set
Definition: adaptiveleafindexset.hh:1336
Definition: adaptiveleafindexset.hh:1407
consecutive, persistent index set for the leaf level based on the grid's hierarchy index set
Definition: adaptiveleafindexset.hh:1477
specialize with 'false' if grid part has no underlying dune grid (default=true)
Definition: gridpart/common/capabilities.hh:18
static const bool v
Definition: gridpart/common/capabilities.hh:19
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: gridpart/common/capabilities.hh:29
static const bool v
Definition: gridpart/common/capabilities.hh:30
static const unsigned int topologyId
Definition: gridpart/common/capabilities.hh:31
specialize with 'true' if the grid part is cartesian (default=false)
Definition: gridpart/common/capabilities.hh:40
static const bool v
Definition: gridpart/common/capabilities.hh:41
specialize with 'true' for all codims that a grid implements entities for (default=false)
Definition: gridpart/common/capabilities.hh:50
static const bool v
Definition: gridpart/common/capabilities.hh:51
specialize with 'true' for all codims that a grid can communicate data on (default=false)
Definition: gridpart/common/capabilities.hh:60
static const bool v
Definition: gridpart/common/capabilities.hh:61
specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition: gridpart/common/capabilities.hh:70
static const bool v
Definition: gridpart/common/capabilities.hh:71
void communicate(CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
corresponding communication method for grid part
Definition: gridpart.hh:247
Default implementation for the GridPart classes.
Definition: gridpart.hh:299
GridType & grid_
Definition: gridpart.hh:326
Traits::template Codim< EntitySeed::codimension >::EntityType entity(const EntitySeed &seed) const
Definition: gridpart.hh:362
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridpart.hh:342
Utility to get twist from IntersectionIterator, if provided by grid (i.e. AlbertaGrid,...
Definition: twistutility.hh:82
Singleton list for key/object pairs.
Definition: singletonlist.hh:54
static void removeObject(const ObjectType &object)
Definition: singletonlist.hh:119