Mercurial > repos > public > sbplib_julia
view plotDerivative.jl @ 123:5df4ccb19476 cell_based_test
Undo changes of 3560f54e3eb3 and change to result a little bit to avoid allocations.
Trying different signatres reveals some strange interactions with julias dispatch:
allocate: getrange(gridsize::Integer, closuresize::Integer, region::Type{<:Region})
no allocate: getrange(gridsize::Integer, closuresize::Integer, region::R) where R
allocate: getrange(gridsize::Integer, closuresize::Integer, region::R) where R <: Type{<:Region}
no allocate: getrange(gridsize::Integer, closuresize::Integer, region::DataType)
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 13 Feb 2019 10:58:57 +0100 |
parents | 8d505e9bc715 |
children |
line wrap: on
line source
g = sbp.Grid.EquidistantGrid((200,), (0.0,), (2pi,)) op =sbp.readOperator("d2_4th.txt","h_4th.txt") Laplace = sbp.Laplace(g,1.0,op) init(x) = cos(x) v = sbp.Grid.evalOn(g,init) u = zeros(length(v)) sbp.apply!(Laplace,u,v) @show u sbp.Grid.plotgridfunction(g,u)