Mercurial > repos > public > sbplib_julia
changeset 46:50c6c252d954
Fix issue in plotgridfunction in 2d. Remove 3d case. Will be added later
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 10 Jan 2019 17:39:42 +0100 |
parents | 56722ba36604 |
children | 8c4cfa680e5a 614b56a017b9 |
files | grid.jl plotDerivative.jl |
diffstat | 2 files changed, 7 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/grid.jl Thu Jan 10 16:51:52 2019 +0100 +++ b/grid.jl Thu Jan 10 17:39:42 2019 +0100 @@ -120,21 +120,15 @@ if numberOfDimensions(grid) == 1 plot(pointsalongdim(grid,1), gridfunction, linewidth=2.0) elseif numberOfDimensions(grid) == 2 - x = pointsalongdim(grid,1) - X = repeat(x,1,grid.numberOfPointsPerDim[2]) - y = pointsalongdim(grid,2) - Y = repeat(y,1,grid.numberOfPointsPerDim[1])' - surface(X,Y,reshape(gridfunction)) - elseif numberOfDimensions(grid) == 3 + mx = grid.numberOfPointsPerDim[1]; + my = grid.numberOfPointsPerDim[2]; x = pointsalongdim(grid,1) - X = repeat(x,1,grid.numberOfPointsPerDim[2]) - y = pointsalongdim(grid,2) - Y = repeat(y,1,grid.numberOfPointsPerDim[1])' + X = repeat(x,1,my) y = pointsalongdim(grid,2) - Y = repeat(y,1,grid.numberOfPointsPerDim[1])' - surface(X,Y,gridfunction) + Y = repeat(y,1,mx)' + surface(X,Y,reshape(gridfunction,mx,my)) else - error(string("Plot not implemented for dimension ", string(dim))) + error(string("Plot not implemented for dimension ", string(numberOfDimensions(grid)))) end end
--- a/plotDerivative.jl Thu Jan 10 16:51:52 2019 +0100 +++ b/plotDerivative.jl Thu Jan 10 17:39:42 2019 +0100 @@ -1,4 +1,4 @@ -g = sbp.grid.EquidistantGrid(200,(0, 1)) +g = sbp.grid.EquidistantGrid(200,(0, 2pi)) op =sbp.readOperator("d2_4th.txt","h_4th.txt") Laplace = sbp.Laplace1D(g,1,op) @@ -10,4 +10,3 @@ @show u sbp.grid.plotgridfunction(g,u) -