comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 925:6b47a9ee1632 feature/laplace_opset

Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 21 Feb 2022 13:13:37 +0100
parents 86776d06b883
children 22c80fb36400
comparison
equal deleted inserted replaced
924:12e8e431b43c 925:6b47a9ee1632
1 """ 1 """
2 boundary_restriction(grid::EquidistantGrid, closure_stencil::Stencil, boundary::CartesianBoundary) 2 boundary_restriction(grid, closure_stencil::Stencil, boundary)
3 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil::Stencil, region::Region)
4 3
5 Creates the boundary restriction operator `e` as a `TensorMapping` 4 Creates boundary restriction operators `e` as `TensorMapping`s on `boundary`
6 5
7 `e` is the restriction of a grid function to the boundary specified by `boundary` or `region` using some `closure_stencil`. 6 `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`. 7 `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 8 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. 9 a `BoundaryOperator`. See also [`SbpOperators.boundary_operator`](@ref).
11 """ 10 """
12 function boundary_restriction(grid::EquidistantGrid, closure_stencil, boundary::CartesianBoundary) 11 function boundary_restriction(grid, closure_stencil::Stencil, boundary)
13 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) 12 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil)
14 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) 13 return SbpOperators.boundary_operator(grid, converted_stencil, boundary)
15 end 14 end
16 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil, region::Region) = boundary_restriction(grid, closure_stencil, CartesianBoundary{1,typeof(region)}()) 15
16 """
17 boundary_restriction(grid, stencil_set, boundary)
18
19 Creates a `boundary_restriction` operator on `grid` given a parsed TOML
20 `stencil_set`.
21 """
22 boundary_restriction(grid, stencil_set, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary)