comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 1099:05a25a5063bb refactor/sbpoperators/inflation

Try to remove volume_operator and boundary_operator methods
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 21 Mar 2022 12:51:39 +0100
parents 1ba8a398af9c
children 157a78959e5d
comparison
equal deleted inserted replaced
1024:5be17f647018 1099:05a25a5063bb
12 12
13 See also: [`volume_operator`](@ref). 13 See also: [`volume_operator`](@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 second_derivative(grid::EquidistantGrid{1}, inner_stencil::Stencil, closure_stencils) = second_derivative(grid,inner_stencil,closure_stencils,1) 21 second_derivative(grid::EquidistantGrid{1}, inner_stencil::Stencil, closure_stencils) = second_derivative(grid,inner_stencil,closure_stencils,1)
20 22
21 """ 23 """
22 second_derivative(grid, stencil_set, direction) 24 second_derivative(grid, stencil_set, direction)