API Reference
Discretization
HelmholtzBenchmark.discretize_helmholtz — Functiondiscretize_helmholtz(n::Int, k::Real) -> (A::SparseMatrixCSC{Float64,Int}, b::Vector{Float64})Discretize the Helmholtz equation $(-∇²-k²)u = f$ on $[0,1]$ using second-order finite differences. Uses $n$ interior points (resulting in an $n \times n$ matrix). $f$ is set to a delta function at $x = 1/2$. Returns the system matrix A and the right-hand side vector b.
Solvers
HelmholtzBenchmark.solve_helmholtz_direct — Functionsolve_helmholtz_direct(A::AbstractMatrix, b::AbstractVector) -> Vector{Float64}Solve the Helmholtz system using the LinearSolve.jl interface to the UMFPACK direct solver.
HelmholtzBenchmark.solve_helmholtz_iterative — Functionsolve_helmholtz_iterative(A::AbstractMatrix, b::AbstractVector;
tol::Real=1e-6, maxiter::Int=100) -> Vector{Float64}Solve the Helmholtz system using the LinearSolve.jl interface to the GMRES iterative solver provided by Krylov.jl.
Benchmarking
HelmholtzBenchmark.run_benchmark — Functionrun_benchmark(k_values::Vector{<:Real}, dim::Int = 1, n::Int = 100)Compare direct (UMFPACK) and iterative (GMRES) solvers for the Helmholtz equation for a number of wave numbers k_values.
HelmholtzBenchmark.run_comparison — Functionrun_comparison(k::Real, dim::Int = 1, n::Int = 100)Compare direct (UMFPACK) and iterative (GMRES) solvers for the Helmholtz equation for a single wave number k.
HelmholtzBenchmark.verify_solution — Functionverify_solution()Verify the implementation by comparing with the exact solution for $k=0$ and $f=1$, where $u(x) = (1/2)x(1-x)$.