comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 1858:4a9be96f2569 feature/documenter_logo

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 12 Jan 2025 21:18:44 +0100
parents 08f06bfacd5c
children 65b2d2c72fbc
comparison
equal deleted inserted replaced
1857:ffde7dad9da5 1858:4a9be96f2569
1 """ 1 """
2 boundary_restriction(grid::EquidistantGrid, closure_stencil::Stencil, boundary::CartesianBoundary) 2 boundary_restriction(g, stencil_set::StencilSet, boundary)
3 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil::Stencil, region::Region) 3 boundary_restriction(g::TensorGrid, stencil_set::StencilSet, boundary::TensorGridBoundary)
4 boundary_restriction(g::EquidistantGrid, stencil_set::StencilSet, boundary)
4 5
5 Creates the boundary restriction operator `e` as a `TensorMapping` 6 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary`
6 7
7 `e` is the restriction of a grid function to the boundary specified by `boundary` or `region` using some `closure_stencil`. 8 `e` restricts a grid function on `g` to `boundary` using the 'e' stencil
8 `e'` is the prolongation of a grid function on the boundary to the whole grid using the same `closure_stencil`. 9 in `stencil_set`. `e'` prolongates a grid function on
9 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of 10 `boundary` to the whole grid using the same stencil. On a one-dimensional
10 a `BoundaryOperator`. Also see the documentation of `SbpOperators.boundary_operator(...)` for more details. 11 grid, `e` is a `BoundaryOperator`. On a multi-dimensional grid, `e` is the
12 inflation of a `BoundaryOperator`.
13
14 See also: [`BoundaryOperator`](@ref), [`LazyTensors.inflate`](@ref).
11 """ 15 """
12 function boundary_restriction(grid::EquidistantGrid, closure_stencil, boundary::CartesianBoundary) 16 function boundary_restriction end
13 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) 17
14 return SbpOperators.boundary_operator(grid, converted_stencil, boundary) 18 function boundary_restriction(g::TensorGrid, stencil_set::StencilSet, boundary::TensorGridBoundary)
19 op = boundary_restriction(g.grids[grid_id(boundary)], stencil_set, boundary_id(boundary))
20 return LazyTensors.inflate(op, size(g), grid_id(boundary))
15 end 21 end
16 boundary_restriction(grid::EquidistantGrid{1}, closure_stencil, region::Region) = boundary_restriction(grid, closure_stencil, CartesianBoundary{1,typeof(region)}())
17 22
18 export boundary_restriction 23 function boundary_restriction(g::EquidistantGrid, stencil_set::StencilSet, boundary)
24 closure_stencil = parse_stencil(stencil_set["e"]["closure"])
25 converted_stencil = convert(Stencil{eltype(g)}, closure_stencil)
26 return BoundaryOperator(g, converted_stencil, boundary)
27 end