Skip to content
Snippets Groups Projects
Commit c4c6d08c authored by Matti Pellika's avatar Matti Pellika
Browse files

Need for info

parent bef6f586
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
......@@ -661,7 +661,7 @@ 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",
Msg::Debug("Simplified a %d-chain from %d cells to %d cells",
dim, start, size);
}
......
......@@ -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));
......@@ -268,6 +272,7 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment