comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 875:067a322e4f73 laplace_benchmarks

Merge with feature/laplace_opset
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 27 Jan 2022 10:55:08 +0100
parents b4acd25943f4
children 6b47a9ee1632
comparison
equal deleted inserted replaced
874:7e9ebd572deb 875:067a322e4f73
1 """
2 second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction)
3
4 Creates the second-derivative operator `D2` as a `TensorMapping`
5
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`
8 for the points in the closure regions.
9
10 On a one-dimensional `grid`, `D2` is a `VolumeOperator`. On a multi-dimensional `grid`, `D2` is the outer product of the
11 one-dimensional operator with the `IdentityMapping`s in orthogonal coordinate dirrections.
12 Also see the documentation of `SbpOperators.volume_operator(...)` for more details.
13 """
14 function second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction)
15 h_inv = inverse_spacing(grid)[direction]
16 return SbpOperators.volume_operator(grid, scale(inner_stencil,h_inv^2), scale.(closure_stencils,h_inv^2), even, direction)
17 end
18 second_derivative(grid::EquidistantGrid{1}, inner_stencil, closure_stencils) = second_derivative(grid,inner_stencil,closure_stencils,1)
19 export second_derivative