Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/boundaryops/boundary_operator.jl @ 1355:102ebdaf7c11 feature/variable_derivatives
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 08 Feb 2023 21:21:28 +0100 |
parents | 5a3281429a48 716e721ce3eb |
children | 49d03d1169ef |
line wrap: on
line diff
--- a/src/SbpOperators/boundaryops/boundary_operator.jl Fri Feb 03 22:50:42 2023 +0100 +++ b/src/SbpOperators/boundaryops/boundary_operator.jl Wed Feb 08 21:21:28 2023 +0100 @@ -1,27 +1,3 @@ -""" - boundary_operator(grid,closure_stencil,boundary) - -Creates a boundary operator on a `Dim`-dimensional grid for the -specified `boundary`. The action of the operator is determined by `closure_stencil`. - -When `Dim=1`, the corresponding `BoundaryOperator` tensor mapping is returned. -When `Dim>1`, the `BoundaryOperator` `op` is inflated by the outer product -of `IdentityTensors` in orthogonal coordinate directions, e.g for `Dim=3`, -the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`. -""" -function boundary_operator(grid::EquidistantGrid, closure_stencil, boundary::CartesianBoundary) - #TODO:Check that dim(boundary) <= Dim? - - d = dim(boundary) - op = BoundaryOperator(restrict(grid, d), closure_stencil, region(boundary)) - - # Create 1D IdentityTensors for each coordinate direction - one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid))) - Is = IdentityTensor{eltype(grid)}.(size.(one_d_grids)) - - return LazyTensors.inflate(op, size(grid), d) -end - """ BoundaryOperator{T,R,N} <: LazyTensor{T,0,1} @@ -36,8 +12,6 @@ size::Int end -BoundaryOperator{R}(stencil::Stencil{T,N}, size::Int) where {T,R,N} = BoundaryOperator{T,R,N}(stencil, size) - """ BoundaryOperator(grid::EquidistantGrid{1}, closure_stencil, region) @@ -50,6 +24,7 @@ """ closure_size(::BoundaryOperator) + The size of the closure stencil. """ closure_size(::BoundaryOperator{T,R,N}) where {T,R,N} = N