Fix IterativeMultiLevelStaticCond tolerance
Related to issue #15 (closed). This makes the default definition of m_rhs_magnitude
in the iterative solver use the function Set_Rhs_Magnitude
.
This way IterativeMultiLevelStaticCond works a lot better, at least for a 2D test I used. It would be nice if someone could test it in a larger 3D case.
The problem I noticed with MultiLevel is that GlobalLinSysIterativeStaticCond::v_PreSolve
is treating level 0 as the last level (this is not true), and calling Set_Rhs_Magnitude
there. I tried fixing this, but then there is a communication issue, since the last level is not the same in all processes.
A couple of other things that could be changed, but I did not to prevent affecting the current implementation of IterativeStaticCond:
- For consistency, remove the call to
Set_Rhs_Magnitude
fromv_PreSolve
and always call it inDoConjugateGradient
. The difference would be between normalizing the residual by the rhs on the original system (as we do now for single-level) vs always normalizing by the rhs of the (condensed) system we are solving. - Maybe we should use
Vmath::Dot2
instead ofVmath::Dot
inSet_Rhs_Magnitude
?