Skip to content

Commit

Permalink
Merge pull request AMReX-Codes#459 from chaw0023/PetscSolveLS
Browse files Browse the repository at this point in the history
Petsc bottom solver in F_interface; update GNUmakefile
  • Loading branch information
WeiqunZhang authored Apr 20, 2019
2 parents 6d834ee + a6fdc77 commit 264d4bf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ endif
Pdirs := Base AmrCore Amr Boundary
ifeq ($(USE_PARTICLES),TRUE)
Pdirs += Particle
ifeq ($(USE_FORTRAN_INTERFACE),TRUE)
Pdirs += F_Interfaces/Particle
endif
endif
ifeq ($(USE_FORTRAN_INTERFACE),TRUE)
Pdirs += F_Interfaces/Base F_Interfaces/Octree F_Interfaces/AmrCore
Expand All @@ -28,6 +31,11 @@ ifeq ($(USE_HYPRE),TRUE)
Pdirs += Extern/HYPRE
endif
endif
ifeq ($(USE_PETSC),TRUE)
ifeq ($(USE_LINEAR_SOLVERS),TRUE)
Pdirs += Extern/PETSc
endif
endif
ifeq ($(USE_SENSEI_INSITU),TRUE)
Pdirs += Extern/SENSEI
endif
Expand Down
2 changes: 2 additions & 0 deletions Src/F_Interfaces/LinearSolvers/AMReX_multigrid_fi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
mlmg->setBottomSolver(MLMG::BottomSolver::cg);
} else if (s == 3) {
mlmg->setBottomSolver(MLMG::BottomSolver::hypre);
} else if (s == 4) {
mlmg->setBottomSolver(MLMG::BottomSolver::petsc);
} else {
amrex::Abort("amrex_fi_multigrid_set_bottom_solver: unknown bottom solver");
}
Expand Down
1 change: 1 addition & 0 deletions Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module amrex_multigrid_module
integer, parameter, public :: amrex_bottom_bicgstab = 1
integer, parameter, public :: amrex_bottom_cg = 2
integer, parameter, public :: amrex_bottom_hypre = 3
integer, parameter, public :: amrex_bottom_petsc = 4
integer, parameter, public :: amrex_bottom_default = 1

private
Expand Down
5 changes: 5 additions & 0 deletions Tools/libamrex/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def configure(argv):
help="Enable Hypre as an option for bottom solver of AMReX linear solvers [default=no]",
choices=["yes","no"],
default="no")
parser.add_argument("--enable-petsc",
help="Enable PETSc as an option for bottom solver of AMReX linear solvers [default=no]",
choices=["yes","no"],
default="no")
parser.add_argument("--enable-eb",
help="Enable AMReX embedded boundary capability [default=no]",
choices=["yes","no"],
Expand Down Expand Up @@ -98,6 +102,7 @@ def configure(argv):
f.write("USE_FORTRAN_INTERFACE = {}\n".format("FALSE" if args.enable_fortran_api == "no" else "TRUE"))
f.write("USE_LINEAR_SOLVERS = {}\n".format("FALSE" if args.enable_linear_solver == "no" else "TRUE"))
f.write("USE_HYPRE = {}\n".format("TRUE" if args.enable_hypre == "yes" else "FALSE"))
f.write("USE_PETSC = {}\n".format("TRUE" if args.enable_petsc == "yes" else "FALSE"))
f.write("USE_EB = {}\n".format("TRUE" if args.enable_eb == "yes" else "FALSE"))
f.write("AMREX_XSDK = {}\n".format("TRUE" if args.enable_xsdk_defaults == "yes" else "FALSE"))
f.write("ALLOW_DIFFERENT_COMP = {}\n".format("FALSE" if args.allow_different_compiler == "no" else "TRUE"))
Expand Down

0 comments on commit 264d4bf

Please sign in to comment.