changeset 885:1051d211c2d9 feature/variable_derivatives

Wrap 1D tests in a testset
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 28 Jan 2022 10:38:58 +0100
parents d228d1b26729
children 0e170dcc6a9e
files test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl
diffstat 1 files changed, 26 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl	Fri Jan 28 10:37:57 2022 +0100
+++ b/test/SbpOperators/volumeops/derivatives/second_derivative_variable_test.jl	Fri Jan 28 10:38:58 2022 +0100
@@ -16,33 +16,35 @@
         NestedStencil(( 2.,  -1., 0.),(-3., 1.,  0.), (1., 0., 0.), center = 1),
     ]
 
-    @testset "Constructors" begin
-        @test SecondDerivativeVariable(interior_stencil,Tuple(closure_stencils), (4,), c) isa TensorMapping
-        @test SecondDerivativeVariable(g, c, interior_stencil, closure_stencils) isa TensorMapping
-    end
+    @testset "1D" begin
+        @testset "Constructors" begin
+            @test SecondDerivativeVariable(interior_stencil,Tuple(closure_stencils), (4,), c) isa TensorMapping
+            @test SecondDerivativeVariable(g, c, interior_stencil, closure_stencils) isa TensorMapping
+        end
 
-    @testset "sizes" begin
-        D₂ᶜ = SecondDerivativeVariable(g, c, interior_stencil, closure_stencils)
-        @test closure_size(D₂ᶜ) == 1
-        @test range_size(D₂ᶜ) == (11,)
-        @test domain_size(D₂ᶜ) == (11,)
-    end
-
-    @testset "application" begin
-
-        function apply_to_functions(;v,c)
-            g = EquidistantGrid(11, 0., 10.) # h = 1
-            c̄ = evalOn(g,c)
-            v̄ = evalOn(g,v)
-
-            D₂ᶜ = SecondDerivativeVariable(g, c̄, interior_stencil, closure_stencils)
-            return D₂ᶜ*v̄
+        @testset "sizes" begin
+            D₂ᶜ = SecondDerivativeVariable(g, c, interior_stencil, closure_stencils)
+            @test closure_size(D₂ᶜ) == 1
+            @test range_size(D₂ᶜ) == (11,)
+            @test domain_size(D₂ᶜ) == (11,)
         end
 
-        @test apply_to_functions(v=x->1., c=x->-1.) == zeros(11)
-        @test apply_to_functions(v=x->1., c=x->-x) == zeros(11)
-        @test apply_to_functions(v=x->x, c=x-> 1.) == zeros(11)
-        @test apply_to_functions(v=x->x, c=x->-x) == -ones(11)
+        @testset "application" begin
+
+            function apply_to_functions(;v,c)
+                g = EquidistantGrid(11, 0., 10.) # h = 1
+                c̄ = evalOn(g,c)
+                v̄ = evalOn(g,v)
+
+                D₂ᶜ = SecondDerivativeVariable(g, c̄, interior_stencil, closure_stencils)
+                return D₂ᶜ*v̄
+            end
+
+            @test apply_to_functions(v=x->1., c=x->-1.) == zeros(11)
+            @test apply_to_functions(v=x->1., c=x->-x) == zeros(11)
+            @test apply_to_functions(v=x->x, c=x-> 1.) == zeros(11)
+            @test apply_to_functions(v=x->x, c=x->-x) == -ones(11)
+        end
     end
 end