Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1047:d12ab8120d29 feature/first_derivative
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 23 Mar 2022 12:43:03 +0100 |
parents | 7fc8df5157a7 |
children | 157a78959e5d |
comparison
equal
deleted
inserted
replaced
1046:e00eb000346e | 1047:d12ab8120d29 |
---|---|
1 """ | 1 """ |
2 normal_derivative(grid, closure_stencil::Stencil, boundary) | 2 normal_derivative(grid, closure_stencil::Stencil, boundary) |
3 | 3 |
4 Creates the normal derivative boundary operator `d` as a `TensorMapping` | 4 Creates the normal derivative boundary operator `d` as a `LazyTensor` |
5 | 5 |
6 `d` computes the normal derivative of a grid function on `boundary` a `Stencil` `closure_stencil`. | 6 `d` computes the normal derivative of a grid function on `boundary` a `Stencil` `closure_stencil`. |
7 `d'` is the prolongation of the normal derivative of a grid function to the whole grid using the same `closure_stencil`. | 7 `d'` is the prolongation of the normal derivative of a grid function to the whole grid using the same `closure_stencil`. |
8 On a one-dimensional `grid`, `d` is a `BoundaryOperator`. On a multi-dimensional `grid`, `d` is the inflation of | 8 On a one-dimensional `grid`, `d` is a `BoundaryOperator`. On a multi-dimensional `grid`, `d` is the inflation of |
9 a `BoundaryOperator`. | 9 a `BoundaryOperator`. |
10 | 10 |
11 See also: [`boundary_operator`](@ref). | 11 See also: [`boundary_operator`](@ref). |
12 """ | 12 """ |
13 function normal_derivative(grid, closure_stencil::Stencil, boundary) | 13 function normal_derivative(grid, closure_stencil, boundary) |
14 direction = dim(boundary) | 14 direction = dim(boundary) |
15 h_inv = inverse_spacing(grid)[direction] | 15 h_inv = inverse_spacing(grid)[direction] |
16 return SbpOperators.boundary_operator(grid, scale(closure_stencil,h_inv), boundary) | 16 return SbpOperators.boundary_operator(grid, scale(closure_stencil,h_inv), boundary) |
17 end | 17 end |
18 | 18 |
19 """ | 19 """ |
20 normal_derivative(grid, stencil_set, boundary) | 20 normal_derivative(grid, stencil_set, boundary) |
21 | 21 |
22 Creates a `normal_derivative` operator on `grid` given a parsed TOML | 22 Creates a `normal_derivative` operator on `grid` given a `stencil_set`. |
23 `stencil_set`. | |
24 """ | 23 """ |
25 normal_derivative(grid, stencil_set, boundary) = normal_derivative(grid, parse_stencil(stencil_set["d1"]["closure"]), boundary) | 24 normal_derivative(grid, stencil_set::StencilSet, boundary) = normal_derivative(grid, parse_stencil(stencil_set["d1"]["closure"]), boundary) |