diff test/SbpOperators/volumeops/derivatives/first_derivative_test.jl @ 2080:0f949681d3d3 refactor/sbp_operators/direction_check tip

Check that direction of first/second derivative operators is within the dimension of the grid. Add 1D functions for first/second derivative operators that take a direction.
author Vidar Stiernström <vidar.stiernstrom@gmail.com>
date Fri, 20 Feb 2026 12:01:05 +0100
parents 471a948cd2b2
children
line wrap: on
line diff
--- a/test/SbpOperators/volumeops/derivatives/first_derivative_test.jl	Wed Feb 18 21:33:00 2026 +0100
+++ b/test/SbpOperators/volumeops/derivatives/first_derivative_test.jl	Fri Feb 20 12:01:05 2026 +0100
@@ -16,6 +16,9 @@
         
         @test first_derivative(g₁, stencil_set) isa LazyTensor{Float64,1,1}
         @test first_derivative(g₂, stencil_set, 2) isa LazyTensor{Float64,2,2}
+        
+        @test first_derivative(g₁, stencil_set) == first_derivative(g₁, stencil_set, 1)
+        @test_throws DomainError(3, "Direction must be inside [0, 1].") first_derivative(g₁, stencil_set, 3)
 
         interior_stencil = CenteredStencil(-1,0,1)
         closure_stencils = [Stencil(-1,1, center=1)]