Mercurial > repos > public > sbplib_julia
changeset 1088:62f321caa964 refactor/sbpoperators/inflation
Improve docs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 10 May 2022 20:21:15 +0200 |
parents | f857057e61e6 |
children | 2278730f9cee |
files | src/LazyTensors/lazy_tensor_operations.jl src/SbpOperators/boundaryops/boundary_operator.jl |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Tue Mar 22 22:05:34 2022 +0100 +++ b/src/LazyTensors/lazy_tensor_operations.jl Tue May 10 20:21:15 2022 +0200 @@ -270,11 +270,20 @@ """ - inflate(tm, sz, dir) + inflate(tm::LazyTensor, sz, dir) + +Inflate `tm` such that it gets the size `sz` in all directions except `dir`. +Here `sz[dir]` is ignored and replaced with the range and domains size of +`tm`. -Inflate `tm` with identity tensors in all directions `d` for `d != dir`. +An example of when this operation is useful is when extending a one +dimensional difference operator `D` to a 2D grid of a ceratin size. In that +case we could have -# TODO: Describe when it is useful +```julia +Dx = inflate(D, (10,10), 1) +Dy = inflate(D, (10,10), 2) +``` """ function inflate(tm::LazyTensor, sz, dir) Is = IdentityTensor{eltype(tm)}.(sz)
--- a/src/SbpOperators/boundaryops/boundary_operator.jl Tue Mar 22 22:05:34 2022 +0100 +++ b/src/SbpOperators/boundaryops/boundary_operator.jl Tue May 10 20:21:15 2022 +0200 @@ -21,6 +21,7 @@ return LazyTensors.inflate(op, size(grid), d) end +# TBD: Should the inflation happen here or should we remove this method and do it at the caller instead? """ BoundaryOperator{T,R,N} <: LazyTensor{T,0,1}