Mercurial > repos > public > sbplib_julia
changeset 1098:6f51160c7ca7 feature/dissipation_operators
Merge refactor/sbpoperators/inflation
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 10 May 2022 21:15:55 +0200 |
parents | 95464a1af340 (current diff) 2278730f9cee (diff) |
children | 62aaed9cf76b |
files | src/LazyTensors/lazy_tensor_operations.jl |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Tue May 10 21:14:38 2022 +0200 +++ b/src/LazyTensors/lazy_tensor_operations.jl Tue May 10 21:15:55 2022 +0200 @@ -269,13 +269,22 @@ LazyOuterProduct(tms::Vararg{LazyTensor}) = foldl(LazyOuterProduct, tms) -# REVIEW: Address TODO below + """ - 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 May 10 21:14:38 2022 +0200 +++ b/src/SbpOperators/boundaryops/boundary_operator.jl Tue May 10 21:15:55 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}