Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/laplace/laplace_test.jl @ 1529:43aaf710463e refactor/equidistant_grid/signature
Change to signature of equidistant_grid to same style as many array methods.
See for example Array{T}(undef, dims...), zeros(T, dims...), fill(a, dims...) and more.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 11 Apr 2024 22:31:04 +0200 |
parents | 356ec6a72974 |
children | 43e6acbefdd1 d68d02dd882f |
comparison
equal
deleted
inserted
replaced
1528:d641798539c2 | 1529:43aaf710463e |
---|---|
6 | 6 |
7 @testset "Laplace" begin | 7 @testset "Laplace" begin |
8 # Default stencils (4th order) | 8 # Default stencils (4th order) |
9 operator_path = sbp_operators_path()*"standard_diagonal.toml" | 9 operator_path = sbp_operators_path()*"standard_diagonal.toml" |
10 stencil_set = read_stencil_set(operator_path; order=4) | 10 stencil_set = read_stencil_set(operator_path; order=4) |
11 g_1D = equidistant_grid(101, 0.0, 1.) | 11 g_1D = equidistant_grid(0.0, 1., 101) |
12 g_3D = equidistant_grid((51,101,52), (0.0, -1.0, 0.0), (1., 1., 1.)) | 12 g_3D = equidistant_grid((0.0, -1.0, 0.0), (1., 1., 1.), 51, 101, 52) |
13 | 13 |
14 @testset "Constructors" begin | 14 @testset "Constructors" begin |
15 @testset "1D" begin | 15 @testset "1D" begin |
16 @test Laplace(g_1D, stencil_set) == Laplace(laplace(g_1D, stencil_set), stencil_set) | 16 @test Laplace(g_1D, stencil_set) == Laplace(laplace(g_1D, stencil_set), stencil_set) |
17 @test Laplace(g_1D, stencil_set) isa LazyTensor{Float64,1,1} | 17 @test Laplace(g_1D, stencil_set) isa LazyTensor{Float64,1,1} |
67 end | 67 end |
68 | 68 |
69 @testset "laplace" begin | 69 @testset "laplace" begin |
70 operator_path = sbp_operators_path()*"standard_diagonal.toml" | 70 operator_path = sbp_operators_path()*"standard_diagonal.toml" |
71 stencil_set = read_stencil_set(operator_path; order=4) | 71 stencil_set = read_stencil_set(operator_path; order=4) |
72 g_1D = equidistant_grid(101, 0.0, 1.) | 72 g_1D = equidistant_grid(0.0, 1., 101) |
73 g_3D = equidistant_grid((51,101,52), (0.0, -1.0, 0.0), (1., 1., 1.)) | 73 g_3D = equidistant_grid((0.0, -1.0, 0.0), (1., 1., 1.), 51, 101, 52) |
74 | 74 |
75 @testset "1D" begin | 75 @testset "1D" begin |
76 Δ = laplace(g_1D, stencil_set) | 76 Δ = laplace(g_1D, stencil_set) |
77 @test Δ == second_derivative(g_1D, stencil_set) | 77 @test Δ == second_derivative(g_1D, stencil_set) |
78 @test Δ isa LazyTensor{Float64,1,1} | 78 @test Δ isa LazyTensor{Float64,1,1} |