Mercurial > repos > public > sbplib_julia
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 2087:ebf0c1686eba | 2088:438dc7664c1f |
|---|---|
| 8 by `direction`. | 8 by `direction`. |
| 9 """ | 9 """ |
| 10 function second_derivative_variable end | 10 function second_derivative_variable end |
| 11 | 11 |
| 12 function second_derivative_variable(g::TensorGrid, coeff, stencil_set, direction::Int) | 12 function second_derivative_variable(g::TensorGrid, coeff, stencil_set, direction::Int) |
| 13 if direction ∉ Interval(0, ndims(g)) | 13 if direction ∉ 1:ndims(g) |
| 14 throw(DomainError(direction, "Direction must be inside [0, $(ndims(g))].")) | 14 throw(DomainError(direction, "Direction must be inside [0, $(ndims(g))].")) |
| 15 end | 15 end |
| 16 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) | 16 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) |
| 17 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) | 17 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) |
| 18 | 18 |
