Skip to content
Snippets Groups Projects
Commit 67669c1c authored by Peter Bastian's avatar Peter Bastian
Browse files

updated index sets to new interface

[[Imported from SVN: r2925]]
parent 1ec1d1b2
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,9 @@ namespace Dune {
UGGridHierarchicIterator,
UGGridLeafIterator,
UGGridLevelIndexSet< UGGrid<dim,dimworld> >,
UGGridLevelIndexSetTypes< UGGrid<dim,dimworld> >,
UGGridLeafIndexSet< UGGrid<dim,dimworld> >,
UGGridLeafIndexSetTypes< UGGrid<dim,dimworld> >,
UGGridGlobalIdSet< UGGrid<dim,dimworld> >,
unsigned int,
UGGridLocalIdSet< UGGrid<dim,dimworld> >,
......
......@@ -13,10 +13,27 @@
namespace Dune {
template <class GridImp>
struct UGGridLevelIndexSetTypes
{
//! The types
template<int cd>
struct Codim
{
template<PartitionIteratorType pitype>
struct Partition
{
typedef typename GridImp::Traits::template Codim<cd>::template Partition<pitype>::LevelIterator Iterator;
};
};
};
template<class GridImp>
class UGGridLevelIndexSet : public IndexSet<GridImp,UGGridLevelIndexSet<GridImp> >
class UGGridLevelIndexSet : public IndexSet<GridImp,UGGridLevelIndexSet<GridImp>,UGGridLevelIndexSetTypes<GridImp> >
{
enum {dim = GridImp::dimension};
typedef IndexSet<GridImp,UGGridLevelIndexSet<GridImp>,UGGridLevelIndexSetTypes<GridImp> > Base;
public:
......@@ -74,11 +91,25 @@ namespace Dune {
}
/** \brief Deliver all geometry types used in this grid */
const std::vector<GeometryType>& geomTypes () const
const std::vector<GeometryType>& geomTypes (int codim) const
{
return myTypes_;
}
//! one past the end on this level
template<int cd, PartitionIteratorType pitype>
typename Base::template Codim<cd>::template Partition<pitype>::Iterator begin () const
{
return grid_.template lbegin<cd,pitype>(level_);
}
//! Iterator to one past the last entity of given codim on level for partition type
template<int cd, PartitionIteratorType pitype>
typename Base::template Codim<cd>::template Partition<pitype>::Iterator end () const
{
return grid_.template lend<cd,pitype>(level_);
}
//private:
void update(const GridImp& grid, int level) {
......@@ -155,9 +186,26 @@ namespace Dune {
std::vector<GeometryType> myTypes_;
};
template <class GridImp>
struct UGGridLeafIndexSetTypes
{
//! The types
template<int cd>
struct Codim
{
template<PartitionIteratorType pitype>
struct Partition
{
typedef typename GridImp::Traits::template Codim<cd>::template Partition<pitype>::LeafIterator Iterator;
};
};
};
template<class GridImp>
class UGGridLeafIndexSet : public IndexSet<GridImp,UGGridLeafIndexSet<GridImp> >
class UGGridLeafIndexSet : public IndexSet<GridImp,UGGridLeafIndexSet<GridImp>,UGGridLeafIndexSetTypes<GridImp> >
{
typedef IndexSet<GridImp,UGGridLeafIndexSet<GridImp>,UGGridLeafIndexSetTypes<GridImp> > Base;
public:
//friend class UGGrid<dim,dim>;
......@@ -210,11 +258,25 @@ namespace Dune {
}
/** deliver all geometry types used in this grid */
const std::vector<GeometryType>& geomTypes () const
const std::vector<GeometryType>& geomTypes (int codim) const
{
return myTypes_;
}
//! one past the end on this level
template<int cd, PartitionIteratorType pitype>
typename Base::template Codim<cd>::template Partition<pitype>::Iterator begin () const
{
return grid_.template leafbegin<cd,pitype>();
}
//! Iterator to one past the last entity of given codim on level for partition type
template<int cd, PartitionIteratorType pitype>
typename Base::template Codim<cd>::template Partition<pitype>::Iterator end () const
{
return grid_.template leafend<cd,pitype>();
}
//private:
void update() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment