changeset 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
files src/SbpOperators/boundaryops/boundary_restriction.jl
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/SbpOperators/boundaryops/boundary_restriction.jl	Mon Nov 23 13:09:57 2020 +0100
+++ b/src/SbpOperators/boundaryops/boundary_restriction.jl	Mon Nov 23 13:11:19 2020 +0100
@@ -1,3 +1,19 @@
+function boundary_restriction(grid::EquidistantGrid{2,T}, closureStencil::Stencil{T,M}, boundary::CartesianBoundary) where {T,M}
+    r = region(boundary)
+    d = dim(boundary)
+    d_orth = 3-d # orthogonal dimension
+    e = BoundaryRestriction(restrict(grid, d), closureStencil, r)
+    I = IdentityMapping(size(restrict(g,d_orth)))
+    if r == Lower
+        return e⊗I
+    elseif r == Upper
+        return I⊗e
+    else
+        # throw error
+    end
+end
+export boundary_restriction
+
 """
     BoundaryRestriction{T,N,R} <: TensorMapping{T,1,1}