Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 980:f885e1de6dc4 feature/variable_derivatives
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 15 Mar 2022 21:38:55 +0100 |
parents | 2ae62dbaf839 |
children | 7bf3121c6864 1ba8a398af9c |
comparison
equal
deleted
inserted
replaced
971:bc12be1b1ae5 | 980:f885e1de6dc4 |
---|---|
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 outer product of the |
11 one-dimensional operator with the `IdentityMapping`s in orthogonal coordinate dirrections. | 11 one-dimensional operator with the `IdentityMapping`s in orthogonal coordinate dirrections. |
12 Also see the documentation of `SbpOperators.volume_operator(...)` for more details. | 12 |
13 See also: [`volume_operator`](@ref). | |
13 """ | 14 """ |
14 function second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction) | 15 function second_derivative(grid::EquidistantGrid, inner_stencil, closure_stencils, direction) |
15 h_inv = inverse_spacing(grid)[direction] | 16 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 return SbpOperators.volume_operator(grid, scale(inner_stencil,h_inv^2), scale.(closure_stencils,h_inv^2), even, direction) |
17 end | 18 end |
18 second_derivative(grid::EquidistantGrid{1}, inner_stencil, closure_stencils) = second_derivative(grid,inner_stencil,closure_stencils,1) | 19 second_derivative(grid::EquidistantGrid{1}, inner_stencil::Stencil, closure_stencils) = second_derivative(grid,inner_stencil,closure_stencils,1) |
19 export second_derivative | 20 |
21 """ | |
22 second_derivative(grid, stencil_set, direction) | |
23 | |
24 Creates a `second_derivative` operator on `grid` along coordinate dimension `direction` given a parsed TOML | |
25 `stencil_set`. | |
26 """ | |
27 function second_derivative(grid::EquidistantGrid, stencil_set, direction) | |
28 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) | |
29 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) | |
30 second_derivative(grid,inner_stencil,closure_stencils,direction); | |
31 end |