Mercurial > repos > public > sbplib_julia
comparison diffOp.jl @ 70:e4fa13137d12 cell_based_test
Use double view
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 18 Jan 2019 13:51:32 +0100 |
parents | 543b7a5ab831 |
children | fbf7398f8154 45dece5e4928 |
comparison
equal
deleted
inserted
replaced
68:d485da6e3a77 | 70:e4fa13137d12 |
---|---|
67 li = LinearIndices(L.grid.numberOfPointsPerDim) | 67 li = LinearIndices(L.grid.numberOfPointsPerDim) |
68 ci = CartesianIndices(L.grid.numberOfPointsPerDim) | 68 ci = CartesianIndices(L.grid.numberOfPointsPerDim) |
69 I = ci[i] | 69 I = ci[i] |
70 | 70 |
71 # 2nd x-derivative | 71 # 2nd x-derivative |
72 uᵢ = apply(L.op, h[1], view(v, li[:,I[2]]), I[1]) | 72 vx = view(v, view(li,:,I[2])) |
73 uᵢ = apply(L.op, h[1], vx , I[1]) | |
73 # 2nd y-derivative | 74 # 2nd y-derivative |
74 uᵢ += apply(L.op, h[2], view(v, li[I[1],:]), I[2]) | 75 vy = view(v, view(li,I[1],:)) |
76 uᵢ += apply(L.op, h[2], vy, I[2]) | |
75 | 77 |
76 return uᵢ | 78 return uᵢ |
77 end | 79 end |