Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1162:62aaed9cf76b feature/dissipation_operators
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 29 Nov 2022 22:43:57 +0100 |
parents | c0ab81e4c39c |
children | 54c3ed752730 |
comparison
equal
deleted
inserted
replaced
1098:6f51160c7ca7 | 1162:62aaed9cf76b |
---|---|
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: [`BoundaryOperator`](@ref), [`LazyTensors.inflate`](@ref). |
12 """ | 12 """ |
13 function normal_derivative(grid, closure_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 |
17 op = BoundaryOperator(restrict(grid, dim(boundary)), scale(closure_stencil,h_inv), region(boundary)) | |
18 return LazyTensors.inflate(op, size(grid), dim(boundary)) | |
17 end | 19 end |
18 | 20 |
19 """ | 21 """ |
20 normal_derivative(grid, stencil_set, boundary) | 22 normal_derivative(grid, stencil_set, boundary) |
21 | 23 |