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

index set changes in onedgrid

compiles again

[[Imported from SVN: r2920]]
parent 2e22cb4b
Branches
Tags
No related merge requests found
......@@ -167,7 +167,9 @@ namespace Dune {
OneDGridHierarchicIterator,
OneDGridLeafIterator,
OneDGridLevelIndexSet< OneDGrid<dim,dimworld> >,
OneDGridLevelIndexSetTypes<OneDGrid<dim,dimworld> >,
OneDGridLeafIndexSet< OneDGrid<dim,dimworld> >,
OneDGridLeafIndexSetTypes<OneDGrid<dim,dimworld> >,
OneDGridIdSet< OneDGrid<dim,dimworld> >,
unsigned int,
OneDGridIdSet< OneDGrid<dim,dimworld> >,
......
......@@ -11,9 +11,26 @@
namespace Dune {
template <class GridImp>
struct OneDGridLevelIndexSetTypes
{
//! 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 OneDGridLevelIndexSet : public IndexSet<GridImp,OneDGridLevelIndexSet<GridImp> >
class OneDGridLevelIndexSet : public IndexSet<GridImp,OneDGridLevelIndexSet<GridImp>,OneDGridLevelIndexSetTypes<GridImp> >
{
typedef IndexSet<GridImp,OneDGridLevelIndexSet<GridImp>,OneDGridLevelIndexSetTypes<GridImp> > Base;
public:
/** \brief Default constructor
......@@ -50,11 +67,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_);
}
/** \todo Should be private */
void update(const GridImp& grid, int level) {
......@@ -93,9 +124,25 @@ namespace Dune {
std::vector<GeometryType> myTypes_;
};
template <class GridImp>
struct OneDGridLeafIndexSetTypes
{
//! 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 OneDGridLeafIndexSet : public IndexSet<GridImp,OneDGridLeafIndexSet<GridImp> >
class OneDGridLeafIndexSet : public IndexSet<GridImp,OneDGridLeafIndexSet<GridImp>,OneDGridLeafIndexSetTypes<GridImp> >
{
typedef IndexSet<GridImp,OneDGridLevelIndexSet<GridImp>,OneDGridLeafIndexSetTypes<GridImp> > Base;
public:
//! constructor stores reference to a grid and level
OneDGridLeafIndexSet (const GridImp& g) : grid_(g)
......@@ -143,6 +190,20 @@ namespace Dune {
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>();
}
/** \todo Should be private */
void update() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment