AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
540 stars 344 forks source link

Add `set_fixed_iter` to Fortran multigrid interface #739

Closed zjibben closed 4 years ago

zjibben commented 4 years ago

I would like to use AMReX's MLMG as a preconditioner, or use it as an interface to Hypre's BoomerAMG as a preconditioner, if possible. It looks like I should be able to do the latter by setting max_coarsening_level=0 on my linear operator (abeclaplacian), which the documentation indicates would disable geometric multigrid.

However, the Fortran interface has no set_fixed_iter method in amrex_multigrid, which would interface to MLMG::setFixedIter. I thought I might be able to workaround by choosing set_max_iter and setting my tolerances to 0.0 to force a fixed number of iterations, but this results in a call to amrex::Abort. Would you add set_fixed_iter to the Fortran interface so I can set up a preconditioner? Thanks!

WeiqunZhang commented 4 years ago

Could you try the latest development?

zjibben commented 4 years ago

This seems to be the case in the current master. I'm looking here for a set_fixed_iter method:

https://github.com/AMReX-Codes/amrex/blob/1838cd8525e01550861ca753d41a577b497286bc/Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90#L19-L50

There doesn't seem to be a Fortran interface to the C++ method MLMG::setFixedIter:

https://github.com/AMReX-Codes/amrex/blob/1838cd8525e01550861ca753d41a577b497286bc/Src/LinearSolvers/MLMG/AMReX_MLMG.H#L76

Perhaps I'm looking in the wrong place?

WeiqunZhang commented 4 years ago

It's in the development branch, but not in masteryet. We merge from development to master at the beginning of each month.

https://github.com/AMReX-Codes/amrex/blob/development/Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90

zjibben commented 4 years ago

Oh perfect, thanks! I built and it's doing exactly what I need. If I run into any issues I'll let you know.