AMReX-Codes / amrex

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

HYPRE example? #381

Closed mattbement closed 5 years ago

mattbement commented 5 years ago

Is there a HYPRE example available? The discussion in the documentation is a bit brief.

WeiqunZhang commented 5 years ago

HYPRE can be used as a bottom solver in AMReX MLMG. See Tutorials/LinearSolvers/ABecLaplacian_C for an example. By default, we coarse as much as we can before calling HYPRE. But you can change it with LPInfo::setMaxCoarseningLevel. You can set it to zero and pass the LPInfo object to the linear operator constructor, if you want HYPRE to solve the whole problem.

mattbement commented 5 years ago

Ok. Even dumber question (as a someone more familiar with Cmake, and not at all familiar with GNU make). When building the ABecLaplacian_C example, how do I tell it where I have HYPRE installed?

asalmgren commented 5 years ago

You need to set HYPRE_DIR=/path/to/hypre/

I do it as an environment variable.

On Thu, Apr 11, 2019 at 9:26 AM mattbement notifications@github.com wrote:

Ok. Even dumber question (as a someone more familiar with Cmake, and not at all familiar with GNU make). When building the ABecLaplacian_C example, how do I tell it where I have HYPRE installed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Codes/amrex/issues/381#issuecomment-482186314, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYgbxYcyBAm2Z5bVbG_GDzMRcl9S5ks5vf2IxgaJpZM4ZDWFm .

mattbement commented 5 years ago

Thanks- I was trying HYPRE_HOME, which obviously didn't work.

mattbement commented 5 years ago

Still having trouble. Getting the following error message:

use amrex_hypre_fort_module, only : hypre_int
      1
Fatal Error: Can't open module file 'amrex_hypre_fort_module.mod' for reading at (1): No such file or directory
compilation terminated.

Here's my GNUmakefile, and I building with make DIM=3 HYPRE_DIR=/home/bement/truchasdir/hypre/install_x86

DEBUG = FALSE

USE_MPI  = TRUE
USE_OMP  = FALSE

USE_HYPRE = TRUE
USE_PETSC = FALSE

COMP = gnu

DIM = 3

AMREX_HOME ?= ../../..

include $(AMREX_HOME)/Tools/GNUMake/Make.defs

include ./Make.package

Pdirs   := Base Boundary AmrCore LinearSolvers/C_CellMG LinearSolvers/MLMG

ifeq ($(USE_HYPRE),TRUE)
    Pdirs += Extern/HYPRE
endif

ifeq ($(USE_PETSC),TRUE)
    Pdirs += Extern/PETSc
endif

Ppack   += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package)

include $(Ppack)

include $(AMREX_HOME)/Tools/GNUMake/Make.rules
WeiqunZhang commented 5 years ago

Could you do make realclean; make DIM=3 HYPRE_DIR=/home/bement/truchasdir/hypre/install_x86 >& make.ou and show us the make.ou file?

mattbement commented 5 years ago

Doing make realclean worked. I should've tried that before bugging y'all. Apologies!

chaw0023 commented 5 years ago

As a note to future users compiling this example with hypre version 2.11.0-44 or lower, HYPRE_BoomerAMGSetOldDefault called in Src/Extern/HYPRE/AMReX_HypreABecLap2.cpp Src/Extern/HYPRE/AMReX_HypreABecLap3.cpp and Src/Extern/HYPRE/AMReX_HypreNodeLap.cpp does not exist in this version. Instead this must be called: HYPRE_BoomerAMGSetCoarsenType(solver, 6) for Falgout coarsening.

See ex5 in hypre for reference.