▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄
▐░▌ ▐░░░░░░░░░░▌ ▐░▌ ▐░▌▐░░░░░░░░▌▐░░░░░░░░░░░▌
▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌
▄▄▄▄█░█▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌
▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌
▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀
Immersed boundary lattice Green's function flow solver.
This code solves the incompressible Naiver-Stokes equations on unbounded domains using a mimetic finite volume approach and lattice Green's functions on adaptively refined meshes.
- [1] Liska S. & Colonius T. (2016) A fast lattice Green’s function method for solving viscous incompressible flows on unbounded domains. Journal of Computational Physics 316: 360-384.
- [2] Dorschner B., Yu K., Mengaldo G. & Colonius T. (2020). A fast multi-resolution lattice Green's function method for elliptic difference equations. Journal of Computational Physics: 109270.
The following external libraries need to be installed on your system. All packages should be available through standard package manager. Be sure to install all libraries with mpi support.
- C++ compiler with c++17-support or above (tested with gcc-7 or above, intel 2018 or above)
- Mpi implementation such as OpenMpi
- Cmake
- Boost (required libraries: system, filesystem, serialization,mpi)
- FFTW
- HDF5 (Mpi support needed. The cxx binding are NOT needed.)
- Blas
- xTensor
- xTensor-Blas
- xtl
- xsimd
$ ./bootstrap.sh --prefix=/opt/boost
In the file inproject-config.jam, insert
$ using mpi ;
or
$ using mpi : CC : <define>DAMNITB2JUSTUSECC ;
Then
$ ./b2 -j --prefix=/opt/boost --target=shared,static
$ ./b2 install
For convenience, this repository provides a helper script docker_iblgf.sh that launches the project inside the prebuilt Docker image used by the lab (ccardina/my-app:cpu) and adds a lightweight Python environment on top.
The script automatically:
- pulls the base Docker image if needed,
- builds a local Python-enabled image (cached after the first run),
- mounts the current repository into the container,
- optionally limits the number of CPUs available to Docker.
From the repository root:
$ ./docker_iblgf.sh
This launches an interactive shell inside the Docker container with the repository mounted at /workspace2.
Once inside Docker, you can run the usual workflow.
On laptops or shared machines, it is often desirable to limit how many CPU cores Docker can use.
To restrict the container to N CPU cores, use:
$ ./docker_iblgf.sh -c N
Example (limit Docker to 4 cores):
$ ./docker_iblgf.sh -c 4
You can verify the limit inside Docker with:
$ nproc
For convenience, this repository provides a wrapper script iblgf.sh that automates configuration, building, and testing. It replaces the need to manually create a build directory and invoke CMake commands by hand.
From the repository root:
$ ./iblgf.sh build
Builds the project using all available CPU cores by default.
$ ./iblgf.sh test
Builds the project (if needed) and then runs the test suite.
The number of CPU cores used for building and testing can be controlled independently.
Build parallelism (compilation)
$ ./iblgf.sh build -j N
Build using N parallel compilation jobs. If -j is not specified, the script automatically uses the number of cores available on the machine.
Test parallelism (ctest)
$ ./iblgf.sh test -j N
Run up to N tests concurrently.
If -j is not specified, tests are run sequentially (safe default).
To run a specific test with a chosen configuration:
$ ./iblgf.sh run-test <test_name> <config_name_or_path>
Example:
$ ./iblgf.sh run-test ns_amr_lgf configFile_0
By default, the test is run with a small number of MPI ranks. This can be overridden explicitly:
$ ./iblgf.sh run-test ns_amr_lgf configFile_0 -n N
Each run is executed in a timestamped directory under runs/, and standard output, error logs, and metadata are recorded for reproducibility.
When running a test, you can set the options 'write-restart' and 'use-restart' to true in its config file to make the test support restart/checkpointing. This allows a simulation to be interrupted and later resumed were if left off. This is useful for long-running tests, debugging, or situations where a run is stopped due to time limits.
When a test is running, it periodically writes restart files (e.g. restart_field.hdf5, tree_info.bin) into its run directory.
To resume the most recent run of a specific test:
$ ./iblgf.sh run-test <test_name> <config_name_or_path> --resume
Example:
$ ./iblgf.sh run-test ns_amr_lgf configFile_0 --resume -n 4
This reuses the latest run directory under runs/<test_name>/ and continues the simulation from the last available restart checkpoint.
To resume a specific previous run explicitly:
$ ./iblgf.sh run-test <test_name> <config_name_or_path> --resume runs/<test_name>/<timestamp>
Example:
$ ./iblgf.sh run-test ns_amr_lgf configFile_0 --resume runs/ns_amr_lgf/2026-01-25_20-12-09 -n 4
IBLGF uses the CMake integrated configuration and build system. Within the parent directory do the following steps:
$ mkdir build
$ cd build
$ ccmake .. (adjust system depended paths to external dependencies if not detected automatically)
$ make (alternatively $ make -j<N> )
$ make test
Benedikt Dorschner
Ke Yu
Marcus Lee
Wei Hou