diff EquidistantGrid.jl @ 91:c0f33eccd527 cell_based_test

Create types StencilIndex, LowerClosureIndex, UpperClosureIndex and InteriorIndex. First attempt at seperating out interior and closure indices from. Not fully implemented.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 29 Jan 2019 14:32:28 +0100
parents 8d505e9bc715
children 93df72e2b135
line wrap: on
line diff
--- a/EquidistantGrid.jl	Fri Jan 25 15:26:47 2019 +0100
+++ b/EquidistantGrid.jl	Tue Jan 29 14:32:28 2019 +0100
@@ -56,11 +56,11 @@
 # @Input: grid - an EquidistantGrid
 # @Return: points - the points of the grid.
 function points(grid::EquidistantGrid)
+    # Signed grid spacing
     dx̄ = (grid.limit_upper.-grid.limit_lower)./(grid.numberOfPointsPerDim.-1)
-
-    points = Vector{typeof(dx̄)}(undef, numberOfPoints(grid))
     # Compute the points based on their Cartesian indices and the signed
     # grid spacings
+    points = Vector{typeof(dx̄)}(undef, numberOfPoints(grid))
     cartesianIndices = CartesianIndices(grid.numberOfPointsPerDim)
     for i ∈ 1:numberOfPoints(grid)
         ci = Tuple(cartesianIndices[i]) .-1
@@ -80,6 +80,7 @@
     points = range(grid.limit_lower[dim],stop=grid.limit_lower[dim],length=grid.numberOfPointsPerDim[dim])
 end
 
+# TODO: Move to own plotting module.
 using PyPlot, PyCall
 
 function plotgridfunction(grid::EquidistantGrid, gridfunction)