Skip to content

Commit

Permalink
Consistent RT casting
Browse files Browse the repository at this point in the history
  • Loading branch information
eebasso committed Nov 17, 2023
1 parent 175b99d commit 59d1e2a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Src/LinearSolvers/MLMG/AMReX_MLCGSolver.H
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ MLCGSolverT<MF>::solve_cg (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs)
amrex::Print() << "MLCGSolver_CG: Initial error (error0) : " << rnorm0 << '\n';
}

RT rho_1 = 0;
RT rho_1 = RT(0.0);
int ret = 0;
iter = 1;

if ( rnorm0 == 0 || rnorm0 < eps_abs )
if ( rnorm0 == RT(0.0) || rnorm0 < eps_abs )
{
if ( verbose > 0 ) {
amrex::Print() << "MLCGSolver_CG: niter = 0,"
Expand All @@ -302,7 +302,7 @@ MLCGSolverT<MF>::solve_cg (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs)

RT rho = dotxy(z,r);

if ( rho == 0 )
if ( rho == RT(0.0) )
{
ret = 1; break;
}
Expand All @@ -317,16 +317,12 @@ MLCGSolverT<MF>::solve_cg (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs)
}
Lp.apply(amrlev, mglev, q, p, MLLinOpT<MF>::BCMode::Homogeneous, MLLinOpT<MF>::StateMode::Correction);

RT alpha;
RT pw = dotxy(p,q);
if ( pw != RT(0.0))
{
alpha = rho/pw;
}
else
if ( pw == RT(0.0))
{
ret = 1; break;
}
RT alpha = rho/pw;

if ( verbose > 2 )
{
Expand Down

0 comments on commit 59d1e2a

Please sign in to comment.