k-Wave is an open source toolbox originally written MATLAB designed for the time-domain simulation of propagating acoustic waves in 1D, 2D, or 3D. The toolbox has a wide range of functionality, but at its heart is an numerical model that can account for both linear or nonlinear wave propagation, an arbitrary distribution of heterogeneous material parameters, and power law acoustic absorption. See the k-Wave website for further details.
This project builds on the great work of the original k-Wave authors: B. E. Treeby, J. Jaros, A. P. Rendell, and B. T. Cox, and the SC@FIT Research Group at Brno University of Technology who developed the original C++ implementations.
This project is a unified C++ implementation of the k-Wave toolbox that accelerates 2D/3D simulations using optimized implementations.
All five platform/backend variants live in-tree under repos/:
repos/kspaceFirstOrder-cuda-linux/— Linux CUDArepos/kspaceFirstOrder-cuda-windows/— Windows CUDArepos/kspaceFirstOrder-openmp-linux/— Linux OpenMPrepos/kspaceFirstOrder-openmp-windows/— Windows OpenMPrepos/kspaceFirstOrder-openmp-darwin/— macOS OpenMP
Each used to be a separate mirror repo, consolidated here as git subtrees (with history preserved). See plans/ROADMAP.md for what's next.
All five variants build via .github/workflows/ci-multi-platform.yml — that workflow is the canonical reference for the exact CMake invocations, dependency setup, and platform pinning per build.
Worked example. Reproduces the CI windows-openmp job locally:
-
Install Visual Studio 2022 (Desktop development with C++ workload), Ninja, and bootstrap vcpkg (for example into
C:\vcpkg). -
Configure the build, pointing CMake at the Windows OpenMP tree and the vcpkg toolchain:
cmake -S repos/kspaceFirstOrder-openmp-windows -B build/openmp-windows ` -G "Ninja" ` -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` -DUSE_MKL=OFF ` -DENABLE_OPENMP=ON ` -DARCH=avx2
The manifest automatically pulls FFTW, HDF5 (with zlib + szip), and zlib through vcpkg—no manual
vcpkg installcommands are required. -
Build the executable:
cmake --build build/openmp-windows --config Release --parallel
The resulting binary (kspaceFirstOrder-OMP.exe) is emitted in build/openmp-windows/.
This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE.md file for details.