diff benchmark/benchmark_laplace.jl @ 1594:d68d02dd882f feature/boundary_conditions

Merge with default
author Vidar Stiernström <vidar.stiernstrom@gmail.com>
date Sat, 25 May 2024 16:07:10 -0700
parents 43aaf710463e
children 471a948cd2b2
line wrap: on
line diff
--- a/benchmark/benchmark_laplace.jl	Tue Jan 23 20:48:25 2024 +0100
+++ b/benchmark/benchmark_laplace.jl	Sat May 25 16:07:10 2024 -0700
@@ -10,7 +10,7 @@
 
 function benchmark_const_coeff_1d(;N = 100, order = 4)
     stencil_set = read_stencil_set(operator_path; order=order)
-    g = equidistant_grid(N, 0., 1.)
+    g = equidistant_grid(0., 1., N)
     D = second_derivative(g, stencil_set)
     u = rand(size(g)...)
     u_xx = rand(size(g)...)
@@ -25,7 +25,7 @@
 
 function benchmark_var_coeff_1d(;N = 100, order = 4)
     stencil_set = read_stencil_set(operator_path; order=order)
-    g = equidistant_grid(N, 0., 1.)
+    g = equidistant_grid(0., 1., N)
     c = rand(size(g)...)
     c_lz = eval_on(g, x -> 0.5)
     D = second_derivative_variable(g, c, stencil_set)
@@ -49,7 +49,7 @@
 
 function benchmark_const_coeff_2d(;N = 100, order = 4)
     stencil_set = read_stencil_set(operator_path; order=order)
-    g = equidistant_grid((N,N), (0.,0.,),(1.,1.))
+    g = equidistant_grid((0.,0.,),(1.,1.), N, N)
     D = Laplace(g, stencil_set)
     u = rand(size(g)...)
     u_xx = rand(size(g)...)
@@ -71,7 +71,7 @@
 
 function benchmark_var_coeff_2d(;N = 100, order = 4)
     stencil_set = read_stencil_set(operator_path; order=order)
-    g = equidistant_grid((N,N), (0.,0.,),(1.,1.))
+    g = equidistant_grid((0.,0.,),(1.,1.), N, N)
     c = rand(size(g)...)
     c_lz = eval_on(g, x-> 0.5)
     D = second_derivative_variable(g, c, stencil_set, 1) + second_derivative_variable(g, c, stencil_set, 2)
@@ -217,4 +217,4 @@
     for I ∈ @view CartesianIndices(u)[end-clz_sz+1:end,end-clz_sz+1:end]
         u_xx[I] = tm[Index{Upper}(I[1]),Index{Upper}(I[2])]
     end
-end
\ No newline at end of file
+end