comparison test/SbpOperators/volumeops/derivatives/dissipation_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 43aaf710463e
children 8e28cadfefb3
comparison
equal deleted inserted replaced
1591:615eeb6e662e 1594:d68d02dd882f
25 end 25 end
26 x^k/factorial(k) 26 x^k/factorial(k)
27 end 27 end
28 28
29 @testset "undivided_skewed04" begin 29 @testset "undivided_skewed04" begin
30 g = equidistant_grid(20, 0., 11.) 30 g = equidistant_grid(0., 11., 20)
31 D,Dᵀ = undivided_skewed04(g, 1) 31 D,Dᵀ = undivided_skewed04(g, 1)
32 32
33 @test D isa LazyTensor{Float64,1,1} 33 @test D isa LazyTensor{Float64,1,1}
34 @test Dᵀ isa LazyTensor{Float64,1,1} 34 @test Dᵀ isa LazyTensor{Float64,1,1}
35 35
36 @testset "Accuracy conditions" begin 36 @testset "Accuracy conditions" begin
37 N = 20 37 N = 20
38 g = equidistant_grid(N, 0//1,2//1) 38 g = equidistant_grid(0//1, 2//1, N)
39 h = only(spacing(g)) 39 h = only(spacing(g))
40 @testset "D_$p" for p ∈ [1,2,3,4] 40 @testset "D_$p" for p ∈ [1,2,3,4]
41 D,Dᵀ = undivided_skewed04(g, p) 41 D,Dᵀ = undivided_skewed04(g, p)
42 42
43 @testset "x^$k" for k ∈ 0:p 43 @testset "x^$k" for k ∈ 0:p
65 end 65 end
66 66
67 return Dmat 67 return Dmat
68 end 68 end
69 69
70 g = equidistant_grid(11, 0., 1.) 70 g = equidistant_grid(0., 1., 11)
71 @testset "D_$p" for p ∈ [1,2,3,4] 71 @testset "D_$p" for p ∈ [1,2,3,4]
72 D,Dᵀ = undivided_skewed04(g, p) 72 D,Dᵀ = undivided_skewed04(g, p)
73 73
74 D̄ = get_matrix(D) 74 D̄ = get_matrix(D)
75 D̄ᵀ = get_matrix(Dᵀ) 75 D̄ᵀ = get_matrix(Dᵀ)
78 end 78 end
79 end 79 end
80 80
81 @testset "2D" begin 81 @testset "2D" begin
82 N = 20 82 N = 20
83 g = equidistant_grid((N,2N), (0,0), (2,1)) 83 g = equidistant_grid((0,0), (2,1), N, 2N)
84 h = spacing.(g.grids) 84 h = spacing.(g.grids)
85 85
86 D,Dᵀ = undivided_skewed04(g, 3, 2) 86 D,Dᵀ = undivided_skewed04(g, 3, 2)
87 87
88 v = eval_on(g, x->monomial(x[1],4)*monomial(x[2],3)) 88 v = eval_on(g, x->monomial(x[1],4)*monomial(x[2],3))