comparison src/SbpOperators/boundaryops/boundary_restriction.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
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 `LazyTensor`s on `boundary` 4 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary`
8 5
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 15
19 op = BoundaryOperator(restrict(grid, dim(boundary)), converted_stencil, region(boundary)) 16 op = BoundaryOperator(restrict(grid, dim(boundary)), converted_stencil, region(boundary))
20 return LazyTensors.inflate(op, size(grid), dim(boundary)) 17 return LazyTensors.inflate(op, size(grid), dim(boundary))
21 end 18 end
22 19
23 """ 20 """
24 boundary_restriction(grid, stencil_set, boundary) 21 boundary_restriction(grid, stencil_set, boundary)
25 22
26 Creates a `boundary_restriction` operator on `grid` given a parsed TOML 23 Creates a `boundary_restriction` operator on `grid` given a `stencil_set`.
27 `stencil_set`.
28 """ 24 """
29 boundary_restriction(grid, stencil_set, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary) 25 boundary_restriction(grid, stencil_set::StencilSet, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary)