Mercurial > repos > public > sbplib_julia
changeset 937:025a506ca2fa feature/variable_derivatives
Fix dispatch bug for 1D grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 02 Mar 2022 10:54:39 +0100 |
parents | 863287577ad4 |
children | d8da3a1060b7 |
files | src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Tue Feb 22 07:24:22 2022 +0100 +++ b/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Wed Mar 02 10:54:39 2022 +0100 @@ -27,7 +27,7 @@ return SecondDerivativeVariable{dir, dimension(grid)}(scaled_inner_stencil, scaled_closure_stencils, size(grid), coeff) end -function SecondDerivativeVariable(grid::EquidistantGrid{1}, coeff::AbstractVector, inner_stencil, closure_stencils) +function SecondDerivativeVariable(grid::EquidistantGrid{1}, coeff::AbstractVector, inner_stencil::NestedStencil, closure_stencils) return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, 1) end
--- a/test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl Tue Feb 22 07:24:22 2022 +0100 +++ b/test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl Wed Mar 02 10:54:39 2022 +0100 @@ -16,13 +16,17 @@ @testset "1D" begin g = EquidistantGrid(11, 0., 1.) - c = [ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66] + c = [ 1., 3., 6., 10., 15., 21., 28., 36., 45., 55., 66.] @testset "Constructors" begin @test SecondDerivativeVariable(g, c, interior_stencil, closure_stencils) isa TensorMapping D₂ᶜ = SecondDerivativeVariable(g, c, interior_stencil, closure_stencils) @test range_dim(D₂ᶜ) == 1 @test domain_dim(D₂ᶜ) == 1 + + + stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order = 2) + @test SecondDerivativeVariable(g, c, stencil_set, 1) isa SecondDerivativeVariable end @testset "sizes" begin @@ -74,6 +78,9 @@ D₂ᶜ = SecondDerivativeVariable(g, c, interior_stencil, closure_stencils,1) @test range_dim(D₂ᶜ) == 2 @test domain_dim(D₂ᶜ) == 2 + + stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order = 2) + @test SecondDerivativeVariable(g, c, stencil_set, 1) isa SecondDerivativeVariable end @testset "sizes" begin