Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1100:157a78959e5d refactor/sbpoperators/inflation
Bring up to date
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 10 May 2022 20:34:20 +0200 |
parents | 05a25a5063bb 7fc8df5157a7 |
children | c0ab81e4c39c |
comparison
equal
deleted
inserted
replaced
1099:05a25a5063bb | 1100:157a78959e5d |
---|---|
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 | 16 |
17 op = BoundaryOperator(restrict(grid, dim(boundary)), scale(closure_stencil,h_inv), region(boundary)) | 17 op = BoundaryOperator(restrict(grid, dim(boundary)), scale(closure_stencil,h_inv), region(boundary)) |
18 return LazyTensors.inflate(op, size(grid), dim(boundary)) | 18 return LazyTensors.inflate(op, size(grid), dim(boundary)) |
19 end | 19 end |
20 | 20 |
21 """ | 21 """ |
22 normal_derivative(grid, stencil_set, boundary) | 22 normal_derivative(grid, stencil_set, boundary) |
23 | 23 |
24 Creates a `normal_derivative` operator on `grid` given a parsed TOML | 24 Creates a `normal_derivative` operator on `grid` given a `stencil_set`. |
25 `stencil_set`. | |
26 """ | 25 """ |
27 normal_derivative(grid, stencil_set, boundary) = normal_derivative(grid, parse_stencil(stencil_set["d1"]["closure"]), boundary) | 26 normal_derivative(grid, stencil_set::StencilSet, boundary) = normal_derivative(grid, parse_stencil(stencil_set["d1"]["closure"]), boundary) |