diff benchmark/benchmarks.jl @ 2082:87157cfca640 feature/sbp_operators/laplace_curvilinear

Add benchmarks for laplace on a bunch of different grids
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 25 Feb 2026 14:33:42 +0100
parents 471a948cd2b2
children
line wrap: on
line diff
--- a/benchmark/benchmarks.jl	Wed Feb 25 10:43:46 2026 +0100
+++ b/benchmark/benchmarks.jl	Wed Feb 25 14:33:42 2026 +0100
@@ -6,6 +6,7 @@
 using Diffinitive.LazyTensors
 
 using LinearAlgebra
+using StaticArrays
 
 const SUITE = BenchmarkGroup()
 
@@ -18,6 +19,14 @@
 g2 = equidistant_grid(ll(2), lu(2), sz(2)...)
 g3 = equidistant_grid(ll(3), lu(3), sz(3)...)
 
+
+c = Chart(unitsquare()) do (ξ,η)
+    @SVector[2ξ + η*(1-η), 3η+(1+η/2)*ξ^2]
+end
+Grids.jacobian(c::typeof(c), (ξ,η)) = @SMatrix[2 1-2η; (2+η)*ξ 3+ξ^2/2]
+
+g2_curved = equidistant_grid(c, sz(2)...)
+
 v1 = rand(sz(1)...)
 v2 = rand(sz(2)...)
 v3 = rand(sz(3)...)
@@ -95,6 +104,21 @@
 
 
 
+SUITE["derivatives"]["laplace"] = BenchmarkGroup()
+
+Δ = laplace(g1, stencil_set)
+SUITE["derivatives"]["laplace"]["1D"] = @benchmarkable $u1 .= $Δ*$v1
+
+Δ = laplace(g2, stencil_set)
+SUITE["derivatives"]["laplace"]["2D"] = @benchmarkable $u2 .= $Δ*$v2
+
+Δ = laplace(g2_curved, stencil_set)
+SUITE["derivatives"]["laplace"]["2D_curved"] = @benchmarkable $u2 .= $Δ*$v2
+
+Δ = laplace(g3, stencil_set)
+SUITE["derivatives"]["laplace"]["3D"] = @benchmarkable $u3 .= $Δ*$v3
+
+
 
 SUITE["derivatives"]["addition"] = BenchmarkGroup()