Skip to content
Snippets Groups Projects
Commit 98415c15 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

ALUGrid id sets now inherit from IdSet.

[[Imported from SVN: r2866]]
parent 2656a252
Branches
Tags
No related merge requests found
......@@ -194,21 +194,29 @@ namespace Dune {
friend class Conversion< ALU3dGrid<dim,dimworld,elementType> , HasObjectStream > ;
friend class Conversion< const ALU3dGrid<dim,dimworld,elementType> , HasObjectStream > ;
//! my Traits class
typedef typename ALU3dGridFamily < dim , dimworld , elType > :: Traits Traits;
//! Type of the hierarchic index set
typedef ALU3dGridHierarchicIndexSet<dim,dimworld,elType> HierarchicIndexSet;
//! Type of the global id set
typedef ALU3dGridGlobalIdSet<dim,dimworld,elType> GlobalIdSet;
typedef ALU3dGridGlobalIdSet<dim,dimworld,elType> GlobalIdSetImp;
//! Type of the local id set
typedef ALU3dGridLocalIdSet<dim,dimworld,elType> LocalIdSet;
typedef ALU3dGridLocalIdSet<dim,dimworld,elType> LocalIdSetImp;
//! Type of the global id set
typedef typename Traits :: GlobalIdSet GlobalIdSet;
//! Type of the local id set
typedef typename Traits :: LocalIdSet LocalIdSet;
//! Type of the level index set
typedef DefaultLevelIndexSet<MyType> LevelIndexSetImp;
//! Type of the leaf index set
typedef AdaptiveLeafIndexSet<MyType> LeafIndexSetImp;
typedef typename ALU3dGridFamily < dim , dimworld , elType > :: Traits Traits;
//! a standard leaf iterator
typedef ALU3dGridLeafIterator<0, All_Partition, MyType> LeafIteratorImp;
......@@ -470,10 +478,10 @@ namespace Dune {
HierarchicIndexSet hIndexSet_;
// out global id set
GlobalIdSet globalIdSet_;
GlobalIdSetImp globalIdSet_;
// out global id set
LocalIdSet localIdSet_;
LocalIdSetImp localIdSet_;
// the level index set ( default type )
mutable std::vector < LevelIndexSetImp * > levelIndexVec_;
......
......@@ -71,7 +71,10 @@ namespace Dune {
//! hierarchic index set of ALU3dGrid
template <int dim, int dimworld, ALU3dGridElementType elType>
class ALU3dGridGlobalIdSet
class ALU3dGridGlobalIdSet :
public IdSet < ALU3dGrid<dim,dimworld,elType> ,
ALU3dGridGlobalIdSet<dim,dimworld,elType> ,
int >
{
typedef ALU3dGrid<dim,dimworld,elType> GridType;
typedef typename GridType :: HierarchicIndexSet HierarchicIndexSetType;
......@@ -102,6 +105,15 @@ namespace Dune {
return codimStart_[cd] + hset_.index(ep);
}
//! return global id of given entity
template <int codim>
int id (const typename GridType:: template Codim<codim> :: Entity & ep) const
{
//enum { cd = EntityType :: codimension };
assert( hset_.size(codim) < codimMultiplier );
return codimStart_[codim] + hset_.index(ep);
}
//! return subId of given entity
template <int cd>
int subId (const EntityCodim0Type & ep, int i) const
......@@ -121,7 +133,10 @@ namespace Dune {
//! hierarchic index set of ALU3dGrid
template <int dim, int dimworld, ALU3dGridElementType elType>
class ALU3dGridLocalIdSet
class ALU3dGridLocalIdSet :
public IdSet < ALU3dGrid<dim,dimworld,elType> ,
ALU3dGridLocalIdSet<dim,dimworld,elType> ,
int >
{
typedef ALU3dGrid<dim,dimworld,elType> GridType;
typedef typename GridType :: HierarchicIndexSet HierarchicIndexSetType;
......@@ -151,6 +166,15 @@ namespace Dune {
return codimStart_[cd] + hset_.index(ep);
}
//! return global id of given entity
template <int codim>
int id (const typename GridType:: template Codim<codim> :: Entity & ep) const
{
//enum { cd = EntityType :: codimension };
assert( hset_.size(codim) < codimMultiplier );
return codimStart_[codim] + hset_.index(ep);
}
//! return subId of given entity
template <int cd>
int subId (const EntityCodim0Type & ep, int i) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment