Bug: Detecting isolated/dirichlet nodes in AMG
In the pre
method of the AMG I found the following code:
for(RowIter row=mat.begin(); row!=mat.end(); ++row) {
bool isDirichlet = true;
bool hasDiagonal = false;
Block diagonal;
for(ColIter col=row->begin(); col!=row->end(); ++col) {
if(row.index()==col.index()) {
diagonal = *col;
hasDiagonal = false;
}else{
if(*col!=zero)
isDirichlet = false;
}
}
if(isDirichlet && hasDiagonal)
diagonal.solve(x[row.index()], b[row.index()]);
}
I guess hasDiagonal
should be set to true
, if the diagonal entry has been found? Otherwise the last if
would never match?!