changeset 1154:ae006e844870 refactor/sbpoperators/inflation

Remove convenience constructor for BoundaryOperator according to review comments
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 01 Nov 2022 22:10:51 +0100
parents f1bb1b6d85dd
children 716e721ce3eb
files src/SbpOperators/boundaryops/boundary_operator.jl test/SbpOperators/boundaryops/boundary_operator_test.jl
diffstat 2 files changed, 2 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/SbpOperators/boundaryops/boundary_operator.jl	Tue Oct 25 10:33:27 2022 +0200
+++ b/src/SbpOperators/boundaryops/boundary_operator.jl	Tue Nov 01 22:10:51 2022 +0100
@@ -12,13 +12,6 @@
     size::Int
 end
 
-BoundaryOperator{R}(stencil::Stencil{T,N}, size::Int) where {T,R,N} = BoundaryOperator{T,R,N}(stencil, size)
-# TBD: Will the above convenience constructor ever be used?
-# Review: 
-# It should probably be removed. It's kind of weird to have a convenice constructor
-# for a general type if it isnt used by any of the current specializations. And in most cases the 1D constructor
-# can be inflated.
-
 """
     BoundaryOperator(grid::EquidistantGrid{1}, closure_stencil, region)
 
--- a/test/SbpOperators/boundaryops/boundary_operator_test.jl	Tue Oct 25 10:33:27 2022 +0200
+++ b/test/SbpOperators/boundaryops/boundary_operator_test.jl	Tue Nov 01 22:10:51 2022 +0100
@@ -14,14 +14,8 @@
     g_2D = EquidistantGrid((11,15), (0.0, 0.0), (1.0,1.0))
 
     @testset "Constructors" begin
-        # Review: Remove the first line below in case we remove convenience constructor in BoundaryOperator
-        op_l = BoundaryOperator{Lower}(closure_stencil,size(g_1D)[1])
-        @test op_l == BoundaryOperator(g_1D,closure_stencil,Lower())
-        @test op_l isa LazyTensor{T,0,1} where T
-         # Review: Remove the first line below in case we remove convenience constructor in BoundaryOperator
-        op_r = BoundaryOperator{Upper}(closure_stencil,size(g_1D)[1])
-        @test op_r == BoundaryOperator(g_1D,closure_stencil,Upper())
-        @test op_r isa LazyTensor{T,0,1} where T
+        @test BoundaryOperator(g_1D, closure_stencil, Lower()) isa LazyTensor{T,0,1} where T
+        @test BoundaryOperator(g_1D, closure_stencil, Upper()) isa LazyTensor{T,0,1} where T
     end
 
     op_l = BoundaryOperator(g_1D, closure_stencil, Lower())