Mercurial > repos > public > sbplib_julia
changeset 580:0779713f95a2 feature/boundary_ops
Add constructor that infers T and N
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 01 Dec 2020 17:47:14 +0100 |
parents | cd7d3949f692 |
children | aa44edea36fc |
files | src/SbpOperators/boundaryops/boundary_restriction.jl test/testSbpOperators.jl |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/boundaryops/boundary_restriction.jl Tue Dec 01 17:43:13 2020 +0100 +++ b/src/SbpOperators/boundaryops/boundary_restriction.jl Tue Dec 01 17:47:14 2020 +0100 @@ -35,6 +35,8 @@ end export BoundaryRestriction +BoundaryRestriction{R}(stencil::Stencil{T,N}, size::Int) where {T,R,N} = BoundaryRestriction{T,R,N}(stencil, size) + function BoundaryRestriction(grid::EquidistantGrid{1}, closureStencil::Stencil{T,N}, region::Region) where {T,N} return BoundaryRestriction{T,typeof(region),N}(closureStencil,size(grid)[1]) end
--- a/test/testSbpOperators.jl Tue Dec 01 17:43:13 2020 +0100 +++ b/test/testSbpOperators.jl Tue Dec 01 17:47:14 2020 +0100 @@ -180,12 +180,12 @@ @testset "Constructors" begin @testset "1D" begin - e_l = BoundaryRestriction{Float64,Lower,4}(op.eClosure,size(g_1D)[1]) + e_l = BoundaryRestriction{Lower}(op.eClosure,size(g_1D)[1]) @test e_l == BoundaryRestriction(g_1D,op.eClosure,Lower()) @test e_l == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Lower}()) @test e_l isa TensorMapping{T,0,1} where T - e_r = BoundaryRestriction{Float64,Upper,4}(op.eClosure,size(g_1D)[1]) + e_r = BoundaryRestriction{Upper}(op.eClosure,size(g_1D)[1]) @test e_r == BoundaryRestriction(g_1D,op.eClosure,Upper()) @test e_r == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Upper}()) @test e_r isa TensorMapping{T,0,1} where T