diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp index ef1e70ab96b7b7a7b80a5e4408925f033da8797e..12c7b6ea6baa850074af0e76a7fd557c91036a04 100644 --- a/Geo/CellComplex.cpp +++ b/Geo/CellComplex.cpp @@ -279,7 +279,6 @@ void CellComplex::removeCell(Cell* cell){ _cells[cell->getDim()].erase(cell); - } void CellComplex::removeCellQset(Cell*& cell, std::set<Cell*, Less_Cell>& Qset){ @@ -353,12 +352,16 @@ int CellComplex::reduction(int dim){ cbd_c = cell->getCoboundary(); if( cbd_c.size() == 1 && inSameDomain(cell, cbd_c.front()) ){ + ++cit; removeCell(cbd_c.front()); removeCell(cell); count++; reduced = true; + } } + + } return count; @@ -694,7 +697,7 @@ int CellComplex::combine(int dim){ int or2 = cbd_c.back().first; Cell* c1 = cbd_c.front().second; Cell* c2 = cbd_c.back().second; - + removeCell(s); bd_c = c1->getBoundary(); diff --git a/Geo/CellComplex.h b/Geo/CellComplex.h index b83d700c7900c3e788ea7d508fbd7b7a9a843517..e407d31ab5e022336c9842b1cc09eaa011553cdb 100644 --- a/Geo/CellComplex.h +++ b/Geo/CellComplex.h @@ -49,6 +49,7 @@ class Cell int _tag; int _index; + // cells on the boundary and on the coboundary of thhis cell std::list< std::pair<int, Cell*> > _boundary; std::list< std::pair<int, Cell*> > _coboundary; @@ -57,6 +58,7 @@ class Cell public: Cell(){ + _bdSize = 0; _cbdSize = 0; } @@ -68,7 +70,7 @@ class Cell virtual int getIndex() const { return _index; }; virtual void setIndex(int index) { _index = index; }; virtual int getNum() { return -1; } - + // get the number of vertices this cell has virtual int getNumVertices() const = 0; virtual MVertex* getVertex(int vertex) const = 0; //{return _vertices.at(vertex);}