Computational modeling of wave phenomena governed by the two-dimensional Helmholtz equation plays a foundational role in geophysical exploration, medical imaging, non-destructive materials testing, and electromagnetic scattering analysis. In frequency-domain inverse problems such as full-waveform inversion, accurate Helmholtz solvers provide the forward-modeling engine required to simulate time-harmonic wave propagation through complex structures. When simulating wavefields in an unbounded medium, truncating the computational domain introduces artificial boundaries that reflect outgoing waves and contaminate numerical solutions unless an absorbing boundary method is applied. The effectiveness of any absorbing formulation depends on factors including incident angle, wave frequency, grid resolution, finite-difference stencil order, and layer thickness. To address these simulation challenges, researchers Sirawit Inpuak, Rungroj Jintamethasawat, Kan Keawhanam, and Chaiwoot Boonyasiriwat have introduced PyHelmholtz, an open-source Python framework designed to provide a unified environment for benchmarking and comparing absorbing boundary methods under consistent numerical conditions.
Existing open-source frequency-domain wave solvers commonly provide only one or a few boundary treatments, most often a standard Perfectly Matched Layer (PML). A comparative survey of established open-source finite-difference Helmholtz software highlights this widespread constraint. For example, the MATLAB packages FDFD_V1.0 and FDFD_ver02 provide implementations limited to standard PML and PML-ABC hybrids. The Fortran and MATLAB code FDFDMATRIX3D similarly offers only a standard PML formulation. In Python, PySIT provides Dirichlet boundary conditions and PML using compiled C and C++ extensions, while j-Wave implements PML within the JAX numerical framework. Because existing tools offer restricted boundary options, researchers wishing to evaluate alternative absorbing boundary methods within the same numerical discretization previously had to implement and validate each approach independently. PyHelmholtz resolves this software limitation by unifying absorbing boundary conditions, absorbing boundary layers, and hybrid formulations within a single modular Python package.
At the core of the framework lies the finite-difference frequency-domain method applied to the two-dimensional variable-wavenumber Helmholtz equation. The governing differential equation relates the Laplacian operator and the squared position-dependent wavenumber to a source excitation function. In this formulation, wavenumber is defined by the angular frequency divided by the spatially varying wave velocity. PyHelmholtz supports internal point sources scaled by source strength as well as plane-wave scattering formulations where the source function depends on background wavenumbers and incident wavefields. Spatial derivatives are discretized using second-order or fourth-order finite-difference schemes. Central stencils are applied across interior grid nodes where supported by neighboring points, whereas asymmetric stencils are introduced near boundary interfaces. The selected finite-difference order is applied systematically across both the interior differential operator and discrete boundary equations, preserving consistent numerical accuracy across the entire domain.
To support comprehensive benchmarking, PyHelmholtz implements multiple absorbing boundary formulations within its unified interface. For local absorbing conditions, the package provides first- and second-order Engquist-Majda formulations, where the first-order condition performs best near normal incidence while the second-order condition improves angular behavior. It also implements the second-order Higdon condition, parameterized by two user-selected incident angles that default to zero and forty-five degrees. For multilayer boundaries, the software includes Ren-Liu hybrid absorbing boundary conditions, which blend the Helmholtz equation with boundary conditions across discrete layer cells using monotonically increasing layer-dependent weights. Furthermore, the framework provides an unsplit-field Perfectly Matched Layer based on complex coordinate stretching with direction-dependent damping profiles. Researchers can also deploy PML-ABC hybrids that surround the interior domain with a Perfectly Matched Layer terminated at its outer boundary by an Engquist-Majda condition, a Higdon condition, or a Dirichlet boundary.
The software architecture follows an object-oriented modular design structured into three computational phases: problem initialization, matrix assembly and solution, and post-processing. Initialization parameters are managed by four principal component classes. The Domain class specifies physical domain extent, spatial grid spacing, coordinate arrays, and wave velocity distributions. The Source class provides the base functionality for wave excitations, with PointSource and PlaneWave subclasses constructing the discrete source vector. The FD class defines the finite-difference order and provides the corresponding computational stencils. The ABM class establishes the matrix-assembly interface, with RenLiu supporting Engquist-Majda, Higdon, and hybrid ABC formulations, and PML handling coordinate stretching and hybrid terminations. These components feed into the central Helmholtz class, which constructs the complex linear system, executes the linear solver, calculates analytical error metrics, and provides visualization routines for velocity models and wavefields. Calling the solve method invokes the internal assembly routine and executes the selected solver backend, while calling the build method directly returns the discretized matrix and source vector, enabling PyHelmholtz to be embedded within larger numerical simulation pipelines.
System construction in PyHelmholtz outputs the discretized linear operator as a sparse complex-valued matrix stored in SciPy compressed sparse row format. The default linear solver backend is SciPy’s sparse direct solver routine spsolve, which utilizes the SuperLU library. For larger complex sparse linear systems, PyHelmholtz provides an optional interface to MUMPS via the PyMUMPS package, utilizing the ZMumpsContext class specifically designed for complex arithmetic. Because matrix construction is decoupled from linear solution, users can directly retrieve the assembled system matrix and source vector to connect alternative sparse solvers or incorporate PyHelmholtz into broader modeling workflows. This separation of concerns also enables researchers to implement custom source functions by subclassing Source or create new boundary formulations through the ABM interface without altering remaining simulation components.
The research team validated the numerical framework using three distinct simulation examples, beginning with a cylindrical wave in free space. In this homogeneous benchmark, a two-gigahertz point source was placed at the center of a two-by-two meter domain with a wave velocity of 2.998 times 10 to the eighth meters per second and a default grid spacing of 0.01 meters, creating a 203 by 203 grid solved with SuperLU. Numerical wavefields were verified against the exact analytical solution given by the two-dimensional Green’s function, measuring relative L2-norm error across the interior domain while excluding a one-wavelength square around the origin to avoid source singularity errors. Grid convergence analysis across four grid spacings—0.02, 0.01, 0.005, and 0.004 meters—demonstrated that boundary formulations dictate overall accuracy. The first-order Engquist-Majda condition failed to attain second- or fourth-order convergence, yielding rates of 1.58 and 0.43. While second-order Engquist-Majda and Higdon conditions achieved second-order convergence with a single boundary cell, their boundary approximations restricted fourth-order stencils to observed rates of 1.71 and 1.95. Ren-Liu hybrids achieved fourth-order convergence with layers between 1.5 and 13 wavelengths, whereas PML and PML-ABC hybrids attained fourth-order convergence rates above 4.07 with an absorbing layer thickness of only 0.5 wavelengths.
A second benchmark simulated plane-wave scattering from a heterogeneous dielectric object embedded in a 12-by-12 millimeter domain. The object consisted of a dielectric box with relative permittivity 1.2, an embedded box with relative permittivity 1.5, and a circular air hole with radius 1.2 millimeters, illuminated by a 0.1-terahertz plane wave incident at thirty degrees. In the absence of an exact analytical solution, the authors computed a numerical reference solution on an expanded 25-by-25 millimeter domain using fourth-order stencils at a fine grid spacing of 0.05 millimeters, terminated by a five-wavelength PML-EM2 layer to minimize boundary reflections. Convergence tests conducted across grid spacings of 0.2, 0.1, and 0.05 millimeters demonstrated that material discontinuities degrade convergence rates across all methods. Engquist-Majda and Higdon ABCs failed to reach fourth-order convergence, while Ren-Liu hybrids and PML variants satisfied the target convergence criterion. Nevertheless, the authors noted that large fitted standard errors—ranging from 1.33 to 1.35—reflect substantial uncertainty due to fitting across only three grid spacings.
The third illustrative benchmark demonstrated the framework’s practical applicability to realistic geological models by simulating seismic wave propagation through the Marmousi velocity model. The Marmousi subsurface structure was loaded directly as a two-dimensional NumPy array into the Domain class constructor and discretized using a spatial grid spacing of twenty meters. Two time-harmonic point sources operating at an acoustic frequency of five hertz were positioned at coordinates (500, 500) meters and (3500, 2000) meters within the model to generate distinct synthetic wavefields. To truncate the complex geological domain effectively, the simulation configured an unsplit-field Perfectly Matched Layer along the outer boundaries. The resulting large, complex-valued sparse linear system was assembled through PyHelmholtz and solved using the MUMPS direct sparse linear solver backend via PyMUMPS. This geophysical test confirmed that PyHelmholtz can efficiently manage complex spatially varying media, integrate external velocity datasets, and leverage high-performance sparse linear algebra solvers for forward modeling in seismic exploration.
Although convergence benchmarks across homogeneous and heterogeneous test cases showed that Perfectly Matched Layer variants generally attain target convergence rates with thinner absorbing layers than Ren-Liu formulations, the researchers emphasized that these findings are strictly restricted to the evaluated numerical parameters. The authors explicitly noted that their numerical results do not represent a comprehensive performance comparison encompassing computational runtime, memory consumption, or linear system matrix condition numbers. PyHelmholtz version 0.2.2 is openly distributed under the permissive MIT license via GitHub, with core dependencies including NumPy, SciPy, and Matplotlib, and optional support for mpi4py, MUMPS, PyMUMPS, and scikit-sparse. Authors Sirawit Inpuak, Rungroj Jintamethasawat, Kan Keawhanam, and Chaiwoot Boonyasiriwat outlined that future software enhancements will focus on implementing compact high-order finite-difference operators and extending the computational framework to coupled wave equations.
Subject of Research: Open-source modular benchmarking of absorbing boundary methods in frequency-domain Helmholtz simulations
Article Title: PyHelmholtz: A modular framework for benchmarking absorbing boundary methods in frequency-domain wave simulations
Article References: Inpuak, S., Jintamethasawat, R., Keawhanam, K., & Boonyasiriwat, C. (2026). PyHelmholtz: A modular framework for benchmarking absorbing boundary methods in frequency-domain wave simulations. SoftwareX, 36, Article 103255. https://doi.org/10.1016/j.softx.2026.103255
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103255
Keywords: PyHelmholtz, Helmholtz equation, absorbing boundary methods, frequency-domain wave modeling, finite-difference frequency-domain, perfectly matched layer, Engquist-Majda condition, Higdon absorbing boundary, Ren-Liu hybrid, wave simulation, full-waveform inversion, sparse linear solver, MUMPS solver, SuperLU, grid convergence analysis, Marmousi model, plane-wave scattering, complex wavefields
Cite Scienmag News
Denise Maddox. (November 26, 2026). Modular Python Framework Benchmarks Absorbing Boundary Methods for Wavefield Simulations. Scienmag. https://scienmag.com/modular-python-framework-benchmarks-absorbing-boundary-methods-for-wavefield-simulations/
Denise Maddox. "Modular Python Framework Benchmarks Absorbing Boundary Methods for Wavefield Simulations." Scienmag, 26 November 2026, https://scienmag.com/modular-python-framework-benchmarks-absorbing-boundary-methods-for-wavefield-simulations/. Accessed 26 November 2026.
Denise Maddox. "Modular Python Framework Benchmarks Absorbing Boundary Methods for Wavefield Simulations." Scienmag. November 26, 2026. https://scienmag.com/modular-python-framework-benchmarks-absorbing-boundary-methods-for-wavefield-simulations/








