Skip to content
Snippets Groups Projects
Commit 188ca293 authored by Christian Engwer's avatar Christian Engwer
Browse files

enable/disable checks according to capabilities

[[Imported from SVN: r3163]]
parent abaef92c
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
#include <algorithm>
#include <dune/common/fvector.hh>
#include <dune/common/capabilities.hh>
#include <dune/grid/common/referenceelements.hh>
......@@ -29,8 +30,9 @@ namespace Dune {
return comp;
}
// check som functionality of grid
template <int codim, class GridType, class IndexSetType, class OutputStreamImp >
// check some functionality of grid
template <int codim, class GridType,
class IndexSetType, class OutputStreamImp >
void checkIndexSetForCodim ( const GridType &grid , const IndexSetType & lset,
OutputStreamImp & sout )
{
......@@ -287,21 +289,36 @@ namespace Dune {
}
template <class GridType, class IndexSetType, class OutputStreamImp , int codim>
template <class GridType, class IndexSetType, class OutputStreamImp,
int codim, bool hasCodim>
struct CheckIndexSet
{
static void checkIndexSet( const GridType &grid ,
const IndexSetType & iset, OutputStreamImp & sout )
{
checkIndexSetForCodim<codim> (grid,iset,sout);
CheckIndexSet<GridType,IndexSetType,OutputStreamImp,codim-1> ::
CheckIndexSet<GridType,IndexSetType,OutputStreamImp,
codim-1, Dune::Capabilities::hasEntity<GridType, codim-1>::v > ::
checkIndexSet( grid, iset, sout );
}
};
template <class GridType, class IndexSetType, class OutputStreamImp,
int codim>
struct CheckIndexSet<GridType,IndexSetType,OutputStreamImp,codim,false>
{
static void checkIndexSet( const GridType &grid ,
const IndexSetType & iset, OutputStreamImp & sout )
{
CheckIndexSet<GridType,IndexSetType,OutputStreamImp,
codim-1, Dune::Capabilities::hasEntity<GridType, codim-1>::v > ::
checkIndexSet( grid, iset, sout );
}
};
// end loop over codim by specialisation
template <class GridType, class IndexSetType, class OutputStreamImp>
struct CheckIndexSet<GridType,IndexSetType,OutputStreamImp,0>
struct CheckIndexSet<GridType,IndexSetType,OutputStreamImp,0,true>
{
static void checkIndexSet( const GridType &grid ,
const IndexSetType & iset, OutputStreamImp & sout )
......@@ -314,7 +331,8 @@ namespace Dune {
void checkIndexSet( const GridType &grid , const IndexSetType & iset,
OutputStreamImp & sout )
{
CheckIndexSet<GridType,IndexSetType,OutputStreamImp,GridType::dimension> ::
CheckIndexSet<GridType,IndexSetType,OutputStreamImp,
GridType::dimension, true> ::
checkIndexSet (grid,iset,sout);
}
......
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