diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCGSolver.H b/Src/LinearSolvers/MLMG/AMReX_MLCGSolver.H index c99d7b319bd..da50aae7b89 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCGSolver.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCGSolver.H @@ -98,7 +98,6 @@ MLCGSolverT::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) MF sorig = Lp.make(amrlev, mglev, nghost); MF p = Lp.make(amrlev, mglev, nghost); MF r = Lp.make(amrlev, mglev, nghost); - MF s = Lp.make(amrlev, mglev, nghost); MF rh = Lp.make(amrlev, mglev, nghost); MF v = Lp.make(amrlev, mglev, nghost); MF t = Lp.make(amrlev, mglev, nghost); @@ -166,9 +165,9 @@ MLCGSolverT::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) ret = 2; break; } MF::Saxpy(sol, alpha, ph, 0, 0, ncomp, nghost); // sol += alpha * ph - MF::LinComb(s, RT(1.0), r, 0, -alpha, v, 0, 0, ncomp, nghost); // s = r - alpha * v + MF::Saxpy(r, -alpha, v, 0, 0, ncomp, nghost); // r += -alpha * v - rnorm = norm_inf(s); + rnorm = norm_inf(r); if ( verbose > 2 && ParallelDescriptor::IOProcessor() ) { @@ -180,7 +179,7 @@ MLCGSolverT::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) if ( rnorm < eps_rel*rnorm0 || rnorm < eps_abs ) { break; } - sh.LocalCopy(s,0,0,ncomp,nghost); + sh.LocalCopy(r,0,0,ncomp,nghost); Lp.apply(amrlev, mglev, t, sh, MLLinOpT::BCMode::Homogeneous, MLLinOpT::StateMode::Correction); Lp.normalize(amrlev, mglev, t); // @@ -188,7 +187,7 @@ MLCGSolverT::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) // in the following two dotxy()s. We do that by calculating the "local" // values and then reducing the two local values at the same time. // - RT tvals[2] = { dotxy(t,t,true), dotxy(t,s,true) }; + RT tvals[2] = { dotxy(t,t,true), dotxy(t,r,true) }; BL_PROFILE_VAR("MLCGSolver::ParallelAllReduce", blp_par); ParallelAllReduce::Sum(tvals,2,Lp.BottomCommunicator()); @@ -203,7 +202,7 @@ MLCGSolverT::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) ret = 3; break; } MF::Saxpy(sol, omega, sh, 0, 0, ncomp, nghost); // sol += omega * sh - MF::LinComb(r, RT(1.0), s, 0, -omega, t, 0, 0, ncomp, nghost); // r = s - omega * t + MF::Saxpy(r, -omega, t, 0, 0, ncomp, nghost); // r += -omega * t rnorm = norm_inf(r);