comparison test/SbpOperators/volumeops/derivatives/first_derivative_test.jl @ 1043:c16116e403e2

Merge refactor/lazy_tensors
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Mar 2022 14:33:13 +0100
parents 7fc8df5157a7
children d12ab8120d29
comparison
equal deleted inserted replaced
1039:696a3307b6a4 1043:c16116e403e2
25 stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order=2) 25 stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order=2)
26 26
27 g₁ = EquidistantGrid(11, 0., 1.) 27 g₁ = EquidistantGrid(11, 0., 1.)
28 g₂ = EquidistantGrid((11,14), (0.,1.), (1.,3.)) 28 g₂ = EquidistantGrid((11,14), (0.,1.), (1.,3.))
29 29
30 @test first_derivative(g₁, stencil_set, 1) isa TensorMapping{Float64,1,1} 30 @test first_derivative(g₁, stencil_set, 1) isa LazyTensor{Float64,1,1}
31 @test first_derivative(g₂, stencil_set, 2) isa TensorMapping{Float64,2,2} 31 @test first_derivative(g₂, stencil_set, 2) isa LazyTensor{Float64,2,2}
32 @test first_derivative(g₁, stencil_set, 1) == first_derivative(g₁, stencil_set) 32 @test first_derivative(g₁, stencil_set, 1) == first_derivative(g₁, stencil_set)
33 33
34 interior_stencil = CenteredStencil(-1,0,1) 34 interior_stencil = CenteredStencil(-1,0,1)
35 closure_stencils = [Stencil(-1,1, center=1)] 35 closure_stencils = [Stencil(-1,1, center=1)]
36 36
37 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) isa TensorMapping{Float64,1,1} 37 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) isa LazyTensor{Float64,1,1}
38 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) isa VolumeOperator 38 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) isa VolumeOperator
39 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) == first_derivative(g₁, interior_stencil, closure_stencils) 39 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) == first_derivative(g₁, interior_stencil, closure_stencils)
40 @test first_derivative(g₂, interior_stencil, closure_stencils, 2) isa TensorMapping{Float64,2,2} 40 @test first_derivative(g₂, interior_stencil, closure_stencils, 2) isa LazyTensor{Float64,2,2}
41 end 41 end
42 42
43 @testset "Accuracy conditions" begin 43 @testset "Accuracy conditions" begin
44 N = 20 44 N = 20
45 g = EquidistantGrid(N, 0//1,2//1) 45 g = EquidistantGrid(N, 0//1,2//1)