Skip to content

Commit

Permalink
solve_cg: use linop.make instead of MF constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
eebasso committed Nov 13, 2023
1 parent d364631 commit cc13294
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 @@ -265,17 +265,13 @@ MLCGSolverT<MF>::solve_cg (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs)

const int ncomp = sol.nComp();

const BoxArray& ba = sol.boxArray();
const DistributionMapping& dm = sol.DistributionMap();
const auto& factory = sol.Factory();

MF p(ba, dm, ncomp, sol.nGrowVect(), MFInfo(), factory);
MF p = Lp.make(amrlev, mglev, sol.nGrowVect());
p.setVal(RT(0.0));

MF sorig(ba, dm, ncomp, nghost, MFInfo(), factory);
MF r (ba, dm, ncomp, nghost, MFInfo(), factory);
MF z (ba, dm, ncomp, nghost, MFInfo(), factory);
MF q (ba, dm, ncomp, nghost, MFInfo(), factory);
MF sorig = Lp.make(amrlev, mglev, nghost);
MF r = Lp.make(amrlev, mglev, nghost);
MF z = Lp.make(amrlev, mglev, nghost);
MF q = Lp.make(amrlev, mglev, nghost);

sorig.LocalCopy(sol,0,0,ncomp,nghost);

Expand Down

0 comments on commit cc13294

Please sign in to comment.