diff src/SbpOperators/volumeops/derivatives/second_derivative_variable.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_variable.jl	Mon Mar 02 13:52:39 2026 +0100
+++ b/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl	Mon Mar 02 14:06:41 2026 +0100
@@ -10,7 +10,7 @@
 function second_derivative_variable end
 
 function second_derivative_variable(g::TensorGrid, coeff, stencil_set, direction::Int)
-    if direction ∉ Interval(0, ndims(g))
+    if direction ∉ 1:ndims(g)
         throw(DomainError(direction, "Direction must be inside [0, $(ndims(g))]."))
     end
     inner_stencil    = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"])