diff src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 2088:438dc7664c1f refactor/sbp_operators/direction_check

Change direction check to use a range
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 02 Mar 2026 14:06:41 +0100
parents 0f949681d3d3
children 1bc63fa55145
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/second_derivative.jl	Mon Mar 02 13:52:39 2026 +0100
+++ b/src/SbpOperators/volumeops/derivatives/second_derivative.jl	Mon Mar 02 14:06:41 2026 +0100
@@ -10,7 +10,7 @@
 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref).
 """
 function second_derivative(g::TensorGrid, stencil_set, direction)
-    if direction āˆ‰ Interval(0, ndims(g))
+    if direction āˆ‰ 1:ndims(g)
         throw(DomainError(direction, "Direction must be inside [0, $(ndims(g))]."))
     end
     Dā‚‚ = second_derivative(g.grids[direction], stencil_set)