Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 1395:bdcdbd4ea9cd feature/boundary_conditions
Merge with default. Comment out broken tests for boundary_conditions at sat
| author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
|---|---|
| date | Wed, 26 Jul 2023 21:35:50 +0200 |
| parents | 08f06bfacd5c |
| children | 65b2d2c72fbc |
comparison
equal
deleted
inserted
replaced
| 1217:ea2e8254820a | 1395:bdcdbd4ea9cd |
|---|---|
| 1 """ | 1 """ |
| 2 boundary_restriction(grid, closure_stencil::Stencil, boundary) | 2 boundary_restriction(g, stencil_set::StencilSet, boundary) |
| 3 boundary_restriction(g::TensorGrid, stencil_set::StencilSet, boundary::TensorGridBoundary) | |
| 4 boundary_restriction(g::EquidistantGrid, stencil_set::StencilSet, boundary) | |
| 3 | 5 |
| 4 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary` | 6 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary` |
| 5 | 7 |
| 6 `e` is the restriction of a grid function to `boundary` using a `Stencil` `closure_stencil`. | 8 `e` restricts a grid function on `g` to `boundary` using the 'e' stencil |
| 7 `e'` is the prolongation of a grid function on `boundary` to the whole grid using the same `closure_stencil`. | 9 in `stencil_set`. `e'` prolongates a grid function on |
| 8 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 |
| 9 a `BoundaryOperator`. | 11 grid, `e` is a `BoundaryOperator`. On a multi-dimensional grid, `e` is the |
| 12 inflation of a `BoundaryOperator`. | |
| 10 | 13 |
| 11 See also: [`boundary_operator`](@ref). | 14 See also: [`BoundaryOperator`](@ref), [`LazyTensors.inflate`](@ref). |
| 12 """ | 15 """ |
| 13 function boundary_restriction(grid, closure_stencil, boundary) | 16 function boundary_restriction end |
| 14 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil) | 17 |
| 15 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)) | |
| 16 end | 21 end |
| 17 | 22 |
| 18 """ | 23 function boundary_restriction(g::EquidistantGrid, stencil_set::StencilSet, boundary) |
| 19 boundary_restriction(grid, stencil_set, boundary) | 24 closure_stencil = parse_stencil(stencil_set["e"]["closure"]) |
| 20 | 25 converted_stencil = convert(Stencil{eltype(g)}, closure_stencil) |
| 21 Creates a `boundary_restriction` operator on `grid` given a `stencil_set`. | 26 return BoundaryOperator(g, converted_stencil, boundary) |
| 22 """ | 27 end |
| 23 boundary_restriction(grid, stencil_set::StencilSet, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary) |
