Simplify GMRES dot products; fix convergence errors
This commit amends Cheb_2dmg::resid_dot (dot-product of residual vectors in the context of the 2D GMRES/multigrid iteration) to perform the dot-product in the simplest way, as a sum over grid elements. Before this, the code (which is left in the file but disabled by #if 1 / #else) tried to be clever and evenly-weight contributions from the interior, the boundary conditions, and the mean-pressure error (if the problem was indeterminate). This evidently caused the long-standing problem of the GMRES inner iteration being far more optimistic about error (as reported by LAPACK) than would be computed by directly measuring the residual error. This problem was ultimately discovered when the doc_map_iwave case broke. Even though this broken residual code has been in SPINS since before it was version-controlled via GIT, the map_iwave case would still converge (and relatively quickly) when the multigrid iteration had a relatively large coarse-solve size. Git bisect pinned the broken documentation case on the change that reduced the coase-grid size, which reduced the GMRES convergence rates enough that the errors caused by *this* problem broke convergence. Since this change replaces the error norm calculations used by GMRES, it should be treated with caution and mapped-grid cases should have a mark-1-eyeball inspection of results for a while. -- Additionally, for debugging utility this change also includes crude residual/basis output for the 2D GMRES solver. All current uses are commented out.
Showing with 48 additions and 7 deletions