Skip to content
Snippets Groups Projects
Commit f82fcd5b authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Partially revert last patch, and improve the implementation some more

- shorter code
- don't zero out columns, there's no reason to do so
- don't copy rows that get overwritten with zeros anyways

[[Imported from SVN: r4894]]
parent 0946627f
Branches
Tags
No related merge requests found
...@@ -57,24 +57,18 @@ void BlockGSStep<OperatorType, DiscFuncType, BitVectorType>::iterate() ...@@ -57,24 +57,18 @@ void BlockGSStep<OperatorType, DiscFuncType, BitVectorType>::iterate()
// No degree of freedom shall be ignored --> solve linear problem // No degree of freedom shall be ignored --> solve linear problem
mat[i][i].solve(v, r); mat[i][i].solve(v, r);
} else { } else {
// Copy the matrix and adjust rhs so that dofs given in ignoreNodes[i] // Copy the matrix and adjust rhs and matrix so that dofs given in ignoreNodes[i]
// are not touched // are not touched
typename OperatorType::block_type matRes = mat[i][i]; typename OperatorType::block_type matRes;
for (int j = 0; j < BlockSize; ++j) { for (int j = 0; j < BlockSize; ++j) {
if ((*this->ignoreNodes_)[i][j]) { if ((*this->ignoreNodes_)[i][j]) {
r[j] = 0; r[j] = 0;
for (int k = 0; k < BlockSize; ++k) { for (int k = 0; k < BlockSize; ++k)
if (k == j) matRes[j][k] = (k == j);
continue; } else
matRes[j] == mat[i][i][j];
matRes[j][k] = 0;
// Since r[j] is zero anyway, this changes
// nothing but simplifies solving
matRes[k][j] = 0;
}
matRes[j][j] = 1;
}
} }
matRes.solve(v, r); matRes.solve(v, r);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment