Mercurial > repos > public > sbplib_julia
view benchmarkTest.jl @ 90:2882e1318cc3 patch_based_test
Add TODO:s on how to remove allocations in apply! for Laplace2d
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 25 Jan 2019 16:49:09 +0100 |
parents | 34fd86e9d0b9 |
children |
line wrap: on
line source
using BenchmarkTools using Profile using ProfileView m = 1000; n = 450; g = sbp.Grid.EquidistantGrid((m,n), (0.0, 0.0), (2pi, 3/2*pi)) op = sbp.readOperator("d2_4th.txt","h_4th.txt") Laplace = sbp.Laplace(g, 1.0, op) init(x,y) = sin(x) + cos(y) v = sbp.Grid.evalOn(g,init) u = zeros(eltype(v),length(v)) sbp.apply!(Laplace,u,v) #@time sbp.apply!(Laplace,u,v) @benchmark sbp.apply!(Laplace,u,v)