Mercurial > repos > public > sbplib_julia
changeset 60:7ab0043aca53 cell_based_test
Only do inner stencil
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 17 Jan 2019 09:41:25 +0100 |
parents | 178a203f3e6d |
children | 17b971a0b852 |
files | diffOp.jl sbpD2.jl |
diffstat | 2 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/diffOp.jl Tue Jan 15 19:51:16 2019 +0100 +++ b/diffOp.jl Thu Jan 17 09:41:25 2019 +0100 @@ -34,7 +34,11 @@ # DiffOp must have a grid!!! function apply!(D::DiffOp, u::AbstractVector, v::AbstractVector) - for i ∈ 1:Grid.numberOfPoints(D.grid) + li = LinearIndices(D.grid.numberOfPointsPerDim) + + Nx, Ny = D.grid.numberOfPointsPerDim + + for i ∈ view(li, 5:Nx-4, 5:Ny-4) u[i] = apply(D, v, i) end
--- a/sbpD2.jl Tue Jan 15 19:51:16 2019 +0100 +++ b/sbpD2.jl Thu Jan 17 09:41:25 2019 +0100 @@ -4,13 +4,7 @@ cSize = closureSize(op) N = length(v) - if i ∈ range(1; length=cSize) - uᵢ = apply(op.closureStencils[i], v, i)/h^2 - elseif i ∈ range(N - cSize+1, length=cSize) - uᵢ = Int(op.parity)*apply(flip(op.closureStencils[N-i+1]), v, i)/h^2 - else - uᵢ = apply(op.innerStencil, v, i)/h^2 - end + uᵢ = apply(op.innerStencil, v, i)/h^2 return uᵢ end