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

more bug fixes.

[[Imported from SVN: r3277]]
parent 35076fe8
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,12 @@ namespace Dune {
myCodim_ = codim;
}
// set codim, because we can't use constructor
int myCodim () const
{
return myCodim_;
}
//! reallocate the vector for new size
void resize ( int newSize )
{
......@@ -466,7 +472,10 @@ namespace Dune {
const EntityType & en , int num , bool (&cdUsed)[ncodim] )
{
enum { codim = 2 };
assert( cls[codim].myCodim () == codim );
if(!cdUsed[codim]) ls.template setUpCodimSet<codim> ();
assert( cdUsed[codim] );
assert(cls[codim].index ( hset.template subIndex<codim>( en , num ) ) >= 0 );
return cls[codim].index ( hset.template subIndex<codim>( en , num ) );
}
......@@ -599,12 +608,14 @@ namespace Dune {
AdaptiveLeafIndexSet (const GridType & grid)
: DefaultGridIndexSetBase <GridType> (grid) ,
hIndexSet_( grid.hierarchicIndexSet() ) ,
marked_ (false) , markAllU_ (false) , higherCodims_ (false)
//marked_ (false) , markAllU_ (false) , higherCodims_ (false)
marked_ (false) , markAllU_ (false) , higherCodims_ (true)
{
// codim 0 is used by default
codimUsed_[0] = true;
// all higher codims are not used by default
for(int i=1; i<ncodim; i++) codimUsed_[i] = false;
//for(int i=1; i<ncodim; i++) codimUsed_[i] = false;
for(int i=1; i<ncodim; i++) codimUsed_[i] = true;
// set the codim of each Codim Set.
for(int i=0; i<ncodim; i++) codimLeafSet_[i].setCodim( i );
......@@ -646,8 +657,8 @@ namespace Dune {
{
// this IndexWrapper provides specialisations for each codim
// see this class above
return IndexWrapper<MyType,HIndexSetType,CodimLeafIndexSet,EntityCodim0Type,
EntityCodim0Type::codimension,cd>::
enum { enCodim = 0 }; // codim of entity is 0
return IndexWrapper<MyType,HIndexSetType,CodimLeafIndexSet,EntityCodim0Type,enCodim, cd>::
index(*this, hIndexSet_, codimLeafSet_, en , num , codimUsed_);
}
......@@ -900,6 +911,7 @@ namespace Dune {
template <int codim>
void setUpCodimSet () const
{
//std::cout << "Setting up codim " << codim << "\n";
// resize if necessary
codimLeafSet_[codim].resize( hIndexSet_.size(codim) );
......@@ -911,6 +923,8 @@ namespace Dune {
{
codimLeafSet_[codim].insert( hIndexSet_.index ( *it ) );
}
//codimLeafSet_[codim].print("setup codim");
codimUsed_[codim] = true;
higherCodims_ = true;
}
......
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