Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/derivatives/first_derivative_test.jl @ 983:5bfc03cf3ba7 feature/first_derivative
Add testing for VolumeOperator
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 16 Mar 2022 14:27:37 +0100 |
parents | b90446eb5f27 |
children | 7bf3121c6864 1ba8a398af9c e00eb000346e |
comparison
equal
deleted
inserted
replaced
979:b90446eb5f27 | 983:5bfc03cf3ba7 |
---|---|
3 | 3 |
4 using Sbplib.SbpOperators | 4 using Sbplib.SbpOperators |
5 using Sbplib.Grids | 5 using Sbplib.Grids |
6 using Sbplib.LazyTensors | 6 using Sbplib.LazyTensors |
7 | 7 |
8 using Sbplib.SbpOperators: closure_size, Stencil | 8 using Sbplib.SbpOperators: closure_size, Stencil, VolumeOperator |
9 | 9 |
10 """ | 10 """ |
11 monomial(x,k) | 11 monomial(x,k) |
12 | 12 |
13 Evaluates ``x^k/k!` with the convetion that it is ``0`` for all ``k<0``. | 13 Evaluates ``x^k/k!` with the convetion that it is ``0`` for all ``k<0``. |
24 @testset "Constructors" begin | 24 @testset "Constructors" begin |
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 TensorMapping{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 TensorMapping{Float64,2,2} |
32 | 32 |
33 interior_stencil = CenteredStencil(-1,0,1) | 33 interior_stencil = CenteredStencil(-1,0,1) |
34 closure_stencils = [Stencil(-1,1, center=1)] | 34 closure_stencils = [Stencil(-1,1, center=1)] |
35 | 35 |
36 @test first_derivative(g₁, interior_stencil, closure_stencils, 1) isa TensorMapping{Float64,1,1} | 36 @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 VolumeOperator | |
37 @test first_derivative(g₂, interior_stencil, closure_stencils, 2) isa TensorMapping{Float64,2,2} | 38 @test first_derivative(g₂, interior_stencil, closure_stencils, 2) isa TensorMapping{Float64,2,2} |
38 end | 39 end |
39 | 40 |
40 @testset "Accuracy conditions" begin | 41 @testset "Accuracy conditions" begin |
41 N = 20 | 42 N = 20 |