comparison test/SbpOperators/volumeops/laplace/laplace_test.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 e96ee7d7ac9c 43aaf710463e
children 19cdec9c21cb
comparison
equal deleted inserted replaced
1591:615eeb6e662e 1594:d68d02dd882f
7 7
8 @testset "Laplace" begin 8 @testset "Laplace" begin
9 # Default stencils (4th order) 9 # Default stencils (4th order)
10 operator_path = sbp_operators_path()*"standard_diagonal.toml" 10 operator_path = sbp_operators_path()*"standard_diagonal.toml"
11 stencil_set = read_stencil_set(operator_path; order=4) 11 stencil_set = read_stencil_set(operator_path; order=4)
12 g_1D = equidistant_grid(101, 0.0, 1.) 12 g_1D = equidistant_grid(0.0, 1., 101)
13 g_3D = equidistant_grid((51,101,52), (0.0, -1.0, 0.0), (1., 1., 1.)) 13 g_3D = equidistant_grid((0.0, -1.0, 0.0), (1., 1., 1.), 51, 101, 52)
14 14
15 @testset "Constructors" begin 15 @testset "Constructors" begin
16 @testset "1D" begin 16 @testset "1D" begin
17 @test Laplace(g_1D, stencil_set) == Laplace(laplace(g_1D, stencil_set), stencil_set) 17 @test Laplace(g_1D, stencil_set) == Laplace(laplace(g_1D, stencil_set), stencil_set)
18 @test Laplace(g_1D, stencil_set) isa LazyTensor{Float64,1,1} 18 @test Laplace(g_1D, stencil_set) isa LazyTensor{Float64,1,1}
68 end 68 end
69 69
70 @testset "laplace" begin 70 @testset "laplace" begin
71 operator_path = sbp_operators_path()*"standard_diagonal.toml" 71 operator_path = sbp_operators_path()*"standard_diagonal.toml"
72 stencil_set = read_stencil_set(operator_path; order=4) 72 stencil_set = read_stencil_set(operator_path; order=4)
73 g_1D = equidistant_grid(101, 0.0, 1.) 73 g_1D = equidistant_grid(0.0, 1., 101)
74 g_3D = equidistant_grid((51,101,52), (0.0, -1.0, 0.0), (1., 1., 1.)) 74 g_3D = equidistant_grid((0.0, -1.0, 0.0), (1., 1., 1.), 51, 101, 52)
75 75
76 @testset "1D" begin 76 @testset "1D" begin
77 Δ = laplace(g_1D, stencil_set) 77 Δ = laplace(g_1D, stencil_set)
78 @test Δ == second_derivative(g_1D, stencil_set) 78 @test Δ == second_derivative(g_1D, stencil_set)
79 @test Δ isa LazyTensor{Float64,1,1} 79 @test Δ isa LazyTensor{Float64,1,1}