Skip to content

Commit

Permalink
Change the interface of LinOp::postSolve so that it's for it to be ca…
Browse files Browse the repository at this point in the history
…lled
  • Loading branch information
WeiqunZhang committed Dec 20, 2024
1 parent d546b81 commit 7e0a088
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public:
Array4<Real const> const& bfab) const override;
#endif

void postSolve (Vector<MultiFab>& sol) const override;
void postSolve (Vector<MultiFab*> const& sol) const override;

private:
GpuArray<Real,AMREX_SPACEDIM> m_sigma{{AMREX_D_DECL(1_rt,1_rt,1_rt)}};
Expand Down
4 changes: 2 additions & 2 deletions Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ MLEBNodeFDLaplacian::fillRHS (MFIter const& /*mfi*/, Array4<int const> const& /*
#endif

void
MLEBNodeFDLaplacian::postSolve (Vector<MultiFab>& sol) const
MLEBNodeFDLaplacian::postSolve (Vector<MultiFab*> const& sol) const
{
#ifdef AMREX_USE_EB
if (this->m_precond_mode) { return; }
Expand All @@ -766,7 +766,7 @@ MLEBNodeFDLaplacian::postSolve (Vector<MultiFab>& sol) const
if (!factory) { return; }
auto const& levset_mf = factory->getLevelSet();
auto const& levset_ar = levset_mf.const_arrays();
MultiFab& mf = sol[amrlev];
MultiFab& mf = *sol[amrlev];
auto const& sol_ar = mf.arrays();
if (phieb == std::numeric_limits<Real>::lowest()) {
auto const& phieb_ar = m_phi_eb[amrlev].const_arrays();
Expand Down
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLLinOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public:

virtual void copyNSolveSolution (MF&, MF const&) const {}

virtual void postSolve (Vector<MF>& /*sol*/) const {}
virtual void postSolve (Vector<MF*> const& /*sol*/) const {}

[[nodiscard]] virtual RT normInf (int amrlev, MF const& mf, bool local) const = 0;

Expand Down
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLMG.H
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ MLMGT<MF>::solve (const Vector<AMF*>& a_sol, const Vector<AMF const*>& a_rhs,
timer[iter_time] = amrex::second() - iter_start_time;
}

linop.postSolve(sol);
linop.postSolve(GetVecOfPtrs(sol));

IntVect ng_back = final_fill_bc ? IntVect(1) : IntVect(0);
if (linop.hasHiddenDimension()) {
Expand Down

0 comments on commit 7e0a088

Please sign in to comment.