Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/derivatives/dissipation_test.jl @ 1640:8e28cadfefb3 bugfix/warnings
Move `monomial` in tests into a local scope to avoid overwriting warnings
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 25 Jun 2024 20:44:06 +0200 |
parents | 43aaf710463e |
children | 471a948cd2b2 |
comparison
equal
deleted
inserted
replaced
1639:61aacc51d38a | 1640:8e28cadfefb3 |
---|---|
11 using Sbplib.SbpOperators: midpoint, midpoint_transpose | 11 using Sbplib.SbpOperators: midpoint, midpoint_transpose |
12 using Sbplib.SbpOperators: dissipation_lower_closure_size, dissipation_upper_closure_size | 12 using Sbplib.SbpOperators: dissipation_lower_closure_size, dissipation_upper_closure_size |
13 using Sbplib.SbpOperators: dissipation_lower_closure_stencils,dissipation_upper_closure_stencils | 13 using Sbplib.SbpOperators: dissipation_lower_closure_stencils,dissipation_upper_closure_stencils |
14 using Sbplib.SbpOperators: dissipation_transpose_lower_closure_stencils, dissipation_transpose_upper_closure_stencils | 14 using Sbplib.SbpOperators: dissipation_transpose_lower_closure_stencils, dissipation_transpose_upper_closure_stencils |
15 | 15 |
16 """ | |
17 monomial(x,k) | |
18 | |
19 Evaluates ``x^k/k!` with the convetion that it is ``0`` for all ``k<0``. | |
20 Has the property that ``d/dx monomial(x,k) = monomial(x,k-1)`` | |
21 """ | |
22 function monomial(x,k) | |
23 if k < 0 | |
24 return zero(x) | |
25 end | |
26 x^k/factorial(k) | |
27 end | |
28 | 16 |
29 @testset "undivided_skewed04" begin | 17 @testset "undivided_skewed04" begin |
18 monomial(x,k) = k < 0 ? zero(x) : x^k/factorial(k) | |
30 g = equidistant_grid(0., 11., 20) | 19 g = equidistant_grid(0., 11., 20) |
31 D,Dᵀ = undivided_skewed04(g, 1) | 20 D,Dᵀ = undivided_skewed04(g, 1) |
32 | 21 |
33 @test D isa LazyTensor{Float64,1,1} | 22 @test D isa LazyTensor{Float64,1,1} |
34 @test Dᵀ isa LazyTensor{Float64,1,1} | 23 @test Dᵀ isa LazyTensor{Float64,1,1} |