comparison test/SbpOperators/volumeops/derivatives/dissipation_test.jl @ 1069:c89c6b63c7f4 feature/dissipation_operators

Fix typo
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 23 Mar 2022 21:58:04 +0100
parents ceda69b8f27a
children 423a6442efc3
comparison
equal deleted inserted replaced
1045:0e31b9901160 1069:c89c6b63c7f4
24 return zero(x) 24 return zero(x)
25 end 25 end
26 x^k/factorial(k) 26 x^k/factorial(k)
27 end 27 end
28 28
29 @testset "undevided_dissipation" begin 29 @testset "undivided_dissipation" begin
30 g = EquidistantGrid(20, 0., 11.) 30 g = EquidistantGrid(20, 0., 11.)
31 D,Dᵀ = undevided_dissipation(g, 1) 31 D,Dᵀ = undivided_dissipation(g, 1)
32 32
33 @test D isa LazyTensor{Float64,1,1} where T 33 @test D isa LazyTensor{Float64,1,1} where T
34 @test Dᵀ isa LazyTensor{Float64,1,1} where T 34 @test Dᵀ isa LazyTensor{Float64,1,1} where T
35 35
36 @testset "Accuracy conditions" begin 36 @testset "Accuracy conditions" begin
37 N = 20 37 N = 20
38 g = EquidistantGrid(N, 0//1,2//1) 38 g = EquidistantGrid(N, 0//1,2//1)
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ᵀ = undevided_dissipation(g, p) 41 D,Dᵀ = undivided_dissipation(g, p)
42 42
43 @testset "x^$k" for k ∈ 0:p 43 @testset "x^$k" for k ∈ 0:p
44 v = evalOn(g, x->monomial(x,k)) 44 v = evalOn(g, x->monomial(x,k))
45 vₚₓ = evalOn(g, x->monomial(x,k-p)) 45 vₚₓ = evalOn(g, x->monomial(x,k-p))
46 46
67 return Dmat 67 return Dmat
68 end 68 end
69 69
70 g = EquidistantGrid(11, 0., 1.) 70 g = EquidistantGrid(11, 0., 1.)
71 @testset "D_$p" for p ∈ [1,2,3,4] 71 @testset "D_$p" for p ∈ [1,2,3,4]
72 D,Dᵀ = undevided_dissipation(g, p) 72 D,Dᵀ = undivided_dissipation(g, p)
73 73
74 D̄ = get_matrix(D) 74 D̄ = get_matrix(D)
75 D̄ᵀ = get_matrix(Dᵀ) 75 D̄ᵀ = get_matrix(Dᵀ)
76 76
77 @test D̄ == D̄ᵀ' 77 @test D̄ == D̄ᵀ'