Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 2089:1bc63fa55145 refactor/sbp_operators/direction_check
Change variable name from `direction` to `dim`
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Mon, 02 Mar 2026 14:11:32 +0100 |
| parents | 438dc7664c1f |
| children | 67d8fbbb9e58 |
comparison
equal
deleted
inserted
replaced
| 2088:438dc7664c1f | 2089:1bc63fa55145 |
|---|---|
| 1 """ | 1 """ |
| 2 second_derivative(g::TensorGrid, stencil_set, direction) | 2 second_derivative(g::TensorGrid, stencil_set, dim) |
| 3 second_derivative(g::EquidistantGrid, stencil_set, direction) | 3 second_derivative(g::EquidistantGrid, stencil_set, dim) |
| 4 | 4 |
| 5 Creates the second derivative operator `D2` as a `LazyTensor` | 5 Creates the second derivative operator `D2` as a `LazyTensor` |
| 6 | 6 |
| 7 `D2` approximates the second-derivative d²/dξ² on `g` along the coordinate | 7 `D2` approximates the second-derivative d²/dξ² on `g` along the coordinate |
| 8 dimension specified by `direction`. | 8 dimension specified by `dim`. |
| 9 | 9 |
| 10 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref). | 10 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref). |
| 11 """ | 11 """ |
| 12 function second_derivative(g::TensorGrid, stencil_set, direction) | 12 function second_derivative(g::TensorGrid, stencil_set, dim) |
| 13 if direction ∉ 1:ndims(g) | 13 if dim ∉ 1:ndims(g) |
| 14 throw(DomainError(direction, "Direction must be inside [0, $(ndims(g))].")) | 14 throw(DomainError(dim, "Direction must be inside [0, $(ndims(g))].")) |
| 15 end | 15 end |
| 16 D₂ = second_derivative(g.grids[direction], stencil_set) | 16 D₂ = second_derivative(g.grids[dim], stencil_set) |
| 17 return LazyTensors.inflate(D₂, size(g), direction) | 17 return LazyTensors.inflate(D₂, size(g), dim) |
| 18 end | 18 end |
| 19 | 19 |
| 20 function second_derivative(g::EquidistantGrid, stencil_set::StencilSet, direction) | 20 function second_derivative(g::EquidistantGrid, stencil_set::StencilSet, dim) |
| 21 return second_derivative(TensorGrid(g), stencil_set, direction) | 21 return second_derivative(TensorGrid(g), stencil_set, dim) |
| 22 end | 22 end |
| 23 | 23 |
| 24 """ | 24 """ |
| 25 second_derivative(g::EquidistantGrid, stencil_set::::StencilSet) | 25 second_derivative(g::EquidistantGrid, stencil_set::::StencilSet) |
| 26 | 26 |
