Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 970:a52bd2f1126c
Merge feature/laplace_opset
| author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
|---|---|
| date | Mon, 14 Mar 2022 15:58:26 +0100 |
| parents | 365bc4e2a6a2 |
| children | 7bf3121c6864 1ba8a398af9c |
comparison
equal
deleted
inserted
replaced
| 967:84ca744f2f06 | 970:a52bd2f1126c |
|---|---|
| 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 | |
| 1 """ | 4 """ |
| 2 boundary_restriction(grid::EquidistantGrid, closure_stencil::Stencil, boundary::CartesianBoundary) | 5 boundary_restriction(grid, closure_stencil::Stencil, boundary) |
| 3 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil::Stencil, region::Region) | |
| 4 | 6 |
| 5 Creates the boundary restriction operator `e` as a `TensorMapping` | 7 Creates boundary restriction operators `e` as `TensorMapping`s on `boundary` |
| 6 | 8 |
| 7 `e` is the restriction of a grid function to the boundary specified by `boundary` or `region` using some `closure_stencil`. | 9 `e` is the restriction of a grid function to `boundary` using a `Stencil` `closure_stencil`. |
| 8 `e'` is the prolongation of a grid function on the boundary to the whole grid using the same `closure_stencil`. | 10 `e'` is the prolongation of a grid function on `boundary` to the whole grid using the same `closure_stencil`. |
| 9 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of | 11 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of |
| 10 a `BoundaryOperator`. Also see the documentation of `SbpOperators.boundary_operator(...)` for more details. | 12 a `BoundaryOperator`. |
| 13 | |
| 14 See also: [`boundary_operator`](@ref). | |
| 11 """ | 15 """ |
| 12 function boundary_restriction(grid::EquidistantGrid, closure_stencil, boundary::CartesianBoundary) | 16 function boundary_restriction(grid, closure_stencil::Stencil, boundary) |
| 13 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) | 17 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) |
| 14 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) | 18 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) |
| 15 end | 19 end |
| 16 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil, region::Region) = boundary_restriction(grid, closure_stencil, CartesianBoundary{1,typeof(region)}()) | |
| 17 | 20 |
| 18 export boundary_restriction | 21 """ |
| 22 boundary_restriction(grid, stencil_set, boundary) | |
| 23 | |
| 24 Creates a `boundary_restriction` operator on `grid` given a parsed TOML | |
| 25 `stencil_set`. | |
| 26 """ | |
| 27 boundary_restriction(grid, stencil_set, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary) |
