diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp index f003cb68915659f06d3bbe1fadf8dbe9c015adea..6638f0fd7495df34a7ae33ec593adb73c4951a53 100644 --- a/Geo/CellComplex.cpp +++ b/Geo/CellComplex.cpp @@ -421,6 +421,17 @@ int CellComplex::coreduction(int dim, int omit, return count; } +int CellComplex::getSize(int dim, bool orig) { + if(dim == -1) { + unsigned int size = 0; + if(!orig) for(int i = 0; i < 4; i++) size += _cells[i].size(); + else for(int i = 0; i < 4; i++) size += _ocells[i].size(); + return size; + } + if(!orig) return _cells[dim].size(); + else return _ocells[dim].size(); +} + int CellComplex::getDomain(Cell* cell, std::string& str) { int domain = 0; diff --git a/Geo/CellComplex.h b/Geo/CellComplex.h index 830e7f4767e31cfa52ab0cd71a1d5ddb52ad3c63..2f2520128ac0a458a68e8d2eb7bd20b23575e3df 100644 --- a/Geo/CellComplex.h +++ b/Geo/CellComplex.h @@ -101,12 +101,9 @@ class CellComplex bool simplicial() const { return _simplicial; } bool relative() const { return _relative; } - - // get the number of certain dimensional cells - int getSize(int dim, bool orig=false){ - if(!orig) return _cells[dim].size(); - else return _ocells[dim].size(); } + // if dim = -1 return the number of all cells + int getSize(int dim, bool orig=false); // get domain of a cell // cell in domain relative to subdomain -> domain = 0 diff --git a/Geo/ChainComplex.cpp b/Geo/ChainComplex.cpp index ff44be42f9ec8971d9deb72aef7914da7a44f22f..114f90766ee80676893d6a313a35048c333e2348 100644 --- a/Geo/ChainComplex.cpp +++ b/Geo/ChainComplex.cpp @@ -661,8 +661,8 @@ void ChainComplex::smoothenChain(std::map<Cell*, int, Less_Cell>& cells) } eraseNullCells(cells); int size = cells.size(); - Msg::Info("Simplified a %d-chain from %d cells to %d cells", - dim, start, size); + Msg::Debug("Simplified a %d-chain from %d cells to %d cells", + dim, start, size); } void ChainComplex::eraseNullCells(std::map<Cell*, int, Less_Cell>& cells) diff --git a/Geo/Homology.cpp b/Geo/Homology.cpp index 2733322dd905df60f3068a9de991e02d759a9bd5..4a42bf3a7747d046b20c4e61d0fd9b9ed3a01973 100644 --- a/Geo/Homology.cpp +++ b/Geo/Homology.cpp @@ -181,9 +181,11 @@ void Homology::findHomologyBasis(std::vector<int> dim) if(_cellComplex == NULL) _createCellComplex(); if(_cellComplex->isReduced()) _cellComplex->restoreComplex(); + Msg::StatusBar(true, "Reducing cell complex..."); double t1 = Cpu(); + double size1 = _cellComplex->getSize(-1); _cellComplex->reduceComplex(_combine, _omit); if(_combine > 1 && !_smoothen) { @@ -195,7 +197,9 @@ void Homology::findHomologyBasis(std::vector<int> dim) } double t2 = Cpu(); - Msg::StatusBar(true, "Done reducing cell complex (%g s)", t2 - t1); + double size2 = _cellComplex->getSize(-1); + Msg::StatusBar(true, "Done reducing cell complex (%g s, %g \%)", + t2 - t1, (1.-size2/size1)*100.); Msg::Info("%d volumes, %d faces, %d edges, and %d vertices", _cellComplex->getSize(3), _cellComplex->getSize(2), _cellComplex->getSize(1), _cellComplex->getSize(0)); @@ -265,9 +269,10 @@ void Homology::findCohomologyBasis(std::vector<int> dim) if(_cellComplex == NULL) _createCellComplex(); if(_cellComplex->isReduced()) _cellComplex->restoreComplex(); - Msg::StatusBar(true, "Reducing cell complex..."); + Msg::StatusBar(true, "Reducing cell complex..."); double t1 = Cpu(); + double size1 = _cellComplex->getSize(-1); _cellComplex->coreduceComplex(_combine, _omit, _heuristic); @@ -281,8 +286,10 @@ void Homology::findCohomologyBasis(std::vector<int> dim) } double t2 = Cpu(); + double size2 = _cellComplex->getSize(-1); - Msg::StatusBar(true, "Done reducing cell complex (%g s)", t2 - t1); + Msg::StatusBar(true, "Done reducing cell complex (%g s, %g \%)", + t2 - t1, (1.-size2/size1)*100.); Msg::Info("%d volumes, %d faces, %d edges, and %d vertices", _cellComplex->getSize(3), _cellComplex->getSize(2), _cellComplex->getSize(1), _cellComplex->getSize(0)); @@ -521,11 +528,15 @@ void Homology::findBettiNumbers() Msg::StatusBar(true, "Reducing cell complex..."); double t1 = Cpu(); + double size1 = _cellComplex->getSize(-1); _cellComplex->bettiReduceComplex(); double t2 = Cpu(); - Msg::StatusBar(true, "Done reducing cell complex (%g s)", t2 - t1); + double size2 = _cellComplex->getSize(-1); + + Msg::StatusBar(true, "Done reducing cell complex (%g s, %g \%)", + t2 - t1, (1.-size2/size1)*100.); Msg::Info("%d volumes, %d faces, %d edges, and %d vertices", _cellComplex->getSize(3), _cellComplex->getSize(2), _cellComplex->getSize(1), _cellComplex->getSize(0));