Mercurial > repos > public > sbplib_julia
view plotDerivative.jl @ 129:1aaeb46ba5f4 cell_based_test
Improve efficiency of apply by the following:
- Remove divisions in interior loop by storing and multiplying by the reciprocal of grid spacing instead.
- Add @inline to apply(::Laplace
- Remove initialization of w = 0 in apply(::Stencil) by manually unrolling first iteration of the loop.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 14 Feb 2019 16:25:22 +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)