Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/derivatives/second_derivative_test.jl @ 1854:654a2b7e6824 tooling/benchmarks
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 11 Jan 2025 10:19:47 +0100 |
parents | 471a948cd2b2 |
children |
comparison
equal
deleted
inserted
replaced
1378:2b5480e2d4bf | 1854:654a2b7e6824 |
---|---|
1 using Test | 1 using Test |
2 | 2 |
3 using Sbplib.SbpOperators | 3 using Diffinitive.SbpOperators |
4 using Sbplib.Grids | 4 using Diffinitive.Grids |
5 using Sbplib.LazyTensors | 5 using Diffinitive.LazyTensors |
6 | 6 |
7 import Sbplib.SbpOperators.VolumeOperator | 7 import Diffinitive.SbpOperators.VolumeOperator |
8 | 8 |
9 # TODO: Refactor these test to look more like the tests in first_derivative_test.jl. | 9 # TODO: Refactor these test to look more like the tests in first_derivative_test.jl. |
10 | 10 |
11 @testset "SecondDerivative" begin | 11 @testset "SecondDerivative" begin |
12 operator_path = sbp_operators_path()*"standard_diagonal.toml" | 12 operator_path = sbp_operators_path()*"standard_diagonal.toml" |
13 stencil_set = read_stencil_set(operator_path; order=4) | 13 stencil_set = read_stencil_set(operator_path; order=4) |
14 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) | 14 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) |
15 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) | 15 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) |
16 Lx = 3.5 | 16 Lx = 3.5 |
17 Ly = 3. | 17 Ly = 3. |
18 g_1D = equidistant_grid(121, 0.0, Lx) | 18 g_1D = equidistant_grid(0.0, Lx, 121) |
19 g_2D = equidistant_grid((121,123), (0.0, 0.0), (Lx, Ly)) | 19 g_2D = equidistant_grid((0.0, 0.0), (Lx, Ly), 121, 123) |
20 | 20 |
21 @testset "Constructors" begin | 21 @testset "Constructors" begin |
22 @testset "1D" begin | 22 @testset "1D" begin |
23 Dₓₓ = second_derivative(g_1D, stencil_set) | 23 Dₓₓ = second_derivative(g_1D, stencil_set) |
24 @test Dₓₓ == second_derivative(g_1D, inner_stencil, closure_stencils) | 24 @test Dₓₓ == second_derivative(g_1D, inner_stencil, closure_stencils) |