Mercurial > repos > public > sbplib_julia
diff diffOp.jl @ 42:c061d1bddba5
Merge latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 10 Jan 2019 16:49:20 +0100 |
parents | bb841977d198 |
children | ef060ab3b035 |
line wrap: on
line diff
--- a/diffOp.jl Thu Jan 10 16:48:49 2019 +0100 +++ b/diffOp.jl Thu Jan 10 16:49:20 2019 +0100 @@ -1,6 +1,6 @@ abstract type DiffOp end -function apply(D::DiffOp, v::AbstractVector) +function apply!(D::DiffOp, u::AbstractVector, v::AbstractVector) error("not implemented") end @@ -35,17 +35,6 @@ h = scaling(L.grid) - for i ∈ 1:N - u[i] = apply(L.op.closureStencils[i], v, i)/h^2 - end - - for i ∈ N+1:M-N - u[i] = apply(L.op.innerStencil, i)/h^2 - end - - for i ∈ M:-1:M-N+1 - u[i] = apply(flip(L.op.closureStencils[M-i+1]), v, i)/h^2 - end - + apply!(L.op, u, v, grid.spacings(L.grid)[1], 1, L.grid.numberOfPointsPerDim, stride=1) return nothing end