comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 1355:102ebdaf7c11 feature/variable_derivatives

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 08 Feb 2023 21:21:28 +0100
parents c0ab81e4c39c
children 356ec6a72974
comparison
equal deleted inserted replaced
1210:fa0800591306 1355:102ebdaf7c11
5 5
6 `D2` approximates the second-derivative d²/dξ² on `grid` along the coordinate dimension specified by 6 `D2` approximates the second-derivative d²/dξ² on `grid` along the coordinate dimension specified by
7 `direction`, using the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils` 7 `direction`, using the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils`
8 for the points in the closure regions. 8 for the points in the closure regions.
9 9
10 On a one-dimensional `grid`, `D2` is a `VolumeOperator`. On a multi-dimensional `grid`, `D2` is the outer product of the 10 On a one-dimensional `grid`, `D2` is a `VolumeOperator`. On a multi-dimensional `grid`, `D2` is the inflation of
11 one-dimensional operator with the `IdentityTensor`s in orthogonal coordinate dirrections. 11 a `VolumeOperator`.
12 12
13 See also: [`volume_operator`](@ref). 13 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref).
14 """ 14 """
15 function second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction) 15 function second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction)
16 h_inv = inverse_spacing(grid)[direction] 16 h_inv = inverse_spacing(grid)[direction]
17 return SbpOperators.volume_operator(grid, scale(inner_stencil,h_inv^2), scale.(closure_stencils,h_inv^2), even, direction) 17
18 D₂ = VolumeOperator(restrict(grid, direction), scale(inner_stencil,h_inv^2), scale.(closure_stencils,h_inv^2), even)
19 return LazyTensors.inflate(D₂, size(grid), direction)
18 end 20 end
19 21
20 22
21 """ 23 """
22 second_derivative(grid, inner_stencil, closure_stencils) 24 second_derivative(grid, inner_stencil, closure_stencils)