Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/boundary_restriction.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 # TODO: The type parameter closure_stencil::Stencil is required since there isnt any suitable type | |
2 # for stencil_set. We should consider adding type ::StencilSet and dispatch on that instead. | |
3 # The same goes for other operators | |
4 """ | 1 """ |
5 boundary_restriction(grid, closure_stencil::Stencil, boundary) | 2 boundary_restriction(grid, closure_stencil::Stencil, boundary) |
6 | 3 |
7 Creates boundary restriction operators `e` as `TensorMapping`s on `boundary` | 4 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary` |
8 | 5 |
9 `e` is the restriction of a grid function to `boundary` using a `Stencil` `closure_stencil`. | 6 `e` is the restriction of a grid function to `boundary` using a `Stencil` `closure_stencil`. |
10 `e'` is the prolongation of a grid function on `boundary` to the whole grid using the same `closure_stencil`. | 7 `e'` is the prolongation of a grid function on `boundary` to the whole grid using the same `closure_stencil`. |
11 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of | 8 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of |
12 a `BoundaryOperator`. | 9 a `BoundaryOperator`. |
13 | 10 |
14 See also: [`boundary_operator`](@ref). | 11 See also: [`boundary_operator`](@ref). |
15 """ | 12 """ |
16 function boundary_restriction(grid, closure_stencil::Stencil, boundary) | 13 function boundary_restriction(grid, closure_stencil, boundary) |
17 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) | 14 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) |
18 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) | 15 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) |
19 end | 16 end |
20 | 17 |
21 """ | 18 """ |
22 boundary_restriction(grid, stencil_set, boundary) | 19 boundary_restriction(grid, stencil_set, boundary) |
23 | 20 |
24 Creates a `boundary_restriction` operator on `grid` given a parsed TOML | 21 Creates a `boundary_restriction` operator on `grid` given a `stencil_set`. |
25 `stencil_set`. | |
26 """ | 22 """ |
27 boundary_restriction(grid, stencil_set, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary) | 23 boundary_restriction(grid, stencil_set::StencilSet, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary) |