-
Notifications
You must be signed in to change notification settings - Fork 622
Compiling FDS with HYPRE
The steps to include the HYPRE library of linear solvers from Lawrence Livermore National Labs in your FDS build are:
- Clone the hypre repo
- Build and install hypre
- Modify your startup script
The hypre repo can be obtained here. Clone (or first fort, then clone) this repo to your local system.
Change directories to the $HYPRE_repo/src/
directory and create a file called confmake.sh
, then give this file executable permissions. Note: If you have built hypre previously, it is a good idea to make distclean
before rerunning your confmake.sh
.
cd <hypre>/src/
touch confmake.sh
chmod +x confmake.sh
Edit this file with the following depending on your build:
Make sure you have OneAPI installed on your system (see Compiling FDS with Intel oneAPI).
./configure CC=mpiicx FC=mpiifort CFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" FFLAGS="-O3 -fno-unsafe-math-optimizations -fp-model=precise" \
--prefix=/path/to/hypre/intel/install
make install
Make sure you have gcc and openmpi installed on your system.
./configure CC=mpicc FC=mpifort CFLAGS="-O3" FFLAGS="-O3" \
--prefix=/path/to/hypre/gnu/install
make install
Next, run make clean
and then confmake.sh
.
make distclean
./confmake.sh
Make the test cases and run.
make test
cd test/
./ij
If all goes well, you should have an installation of hypre in, for example, /path/to/hypre/gnu/install
.
Add the following to your ~/.bashrc
(Linux). This example uses the GNU build, modify as needed for Intel.
#HYPRE:
export HYPRE_HOME=/path/to/hypre/gnu/install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HYPRE_HOME/lib
Then restart your terminal for the changes to take effect.
With $HYPRE_HOME
defined, the FDS makefile will link the hypre. This then allows the 'ULMAT HYPRE' solver to be used as the pressure solver. For example, in your input file you would do,
&PRES SOLVER='ULMAT HYPRE'/