Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 512:5a8cfcc0765d feature/boundary_ops
Sketch on boundary_restriction function in 2D, returning an inflated BoundaryRestriction
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 23 Nov 2020 13:11:19 +0100 |
parents | f5f3b832f9c4 |
children | 547639572208 |
comparison
equal
deleted
inserted
replaced
511:f5f3b832f9c4 | 512:5a8cfcc0765d |
---|---|
1 function boundary_restriction(grid::EquidistantGrid{2,T}, closureStencil::Stencil{T,M}, boundary::CartesianBoundary) where {T,M} | |
2 r = region(boundary) | |
3 d = dim(boundary) | |
4 d_orth = 3-d # orthogonal dimension | |
5 e = BoundaryRestriction(restrict(grid, d), closureStencil, r) | |
6 I = IdentityMapping(size(restrict(g,d_orth))) | |
7 if r == Lower | |
8 return e⊗I | |
9 elseif r == Upper | |
10 return I⊗e | |
11 else | |
12 # throw error | |
13 end | |
14 end | |
15 export boundary_restriction | |
16 | |
1 """ | 17 """ |
2 BoundaryRestriction{T,N,R} <: TensorMapping{T,1,1} | 18 BoundaryRestriction{T,N,R} <: TensorMapping{T,1,1} |
3 | 19 |
4 Implements the boundary operator `e` as a TensorMapping | 20 Implements the boundary operator `e` as a TensorMapping |
5 """ | 21 """ |