changeset 16:c61af27cb67a

Fix compile errors
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 17 Dec 2018 15:05:45 +0100
parents 3d032081832d
children 10a5e7c77fb8 af8469bc1cb3
files grid.jl
diffstat 1 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/grid.jl	Mon Dec 17 14:50:23 2018 +0100
+++ b/grid.jl	Mon Dec 17 15:05:45 2018 +0100
@@ -3,50 +3,45 @@
 abstract type Grid end
 
 function numberOfDimensions(grid::Grid)
-    error("Not yet implemented");
+    error("Not yet implemented")
 end
 
 function numberOfPoints(grid::Grid)
-    error("Not yet implemented");
+    error("Not yet implemented")
 end
 
 function points(grid::Grid)
-    error("Not yet implemented");
+    error("Not yet implemented")
 end
 
 abstract type BoundaryId end
 
 # Move to seperate file.
 struct EquidistantGrid <: Grid
-    numberOfDimensions::UInt;
-    numberOfPoints::Vector(UInt);
-    limits::Vector{Pair{Real, Real}};
+    numberOfDimensions::UInt
+    numberOfPoints::Vector{UInt}
+    limits::Vector{Pair{Real, Real}}
     function EquidistantGrid(nDims, nPoints, lims)
-        @assert nDims == size(nPoints);
-        return new(nDims, nPoints, lims);
+        @assert nDims == size(nPoints)
+        return new(nDims, nPoints, lims)
     end
 end
 
-# Getter functions for public properties?
 function numberOfDimensions(grid::EquidistantGrid)
-    return grid.numberOfDimensions;
+    return grid.numberOfDimensions
 end
 
 function numberOfPoints(grid::EquidistantGrid)
-    return grid.numberOfPoints;
+    return grid.numberOfPoints
 end
 
-
 function points(grid::EquidistantGrid)
-    points::Array{Real,3}(undef, numberOfPoints(grid));
-#    for i ∈ eachindex(points)
-#        points(i) = i/
-#    end
-    return points;
+    points::Matrix{Real,3}(undef, numberOfPoints(grid))
+    return points
 end
 
 function limitsForDimension(grid::EquidistantGrid, dim::UInt)
-    @assert dim <= 3
-    @assert dim >= 1
-    return grid.limits(dim);
+    return grid.limits(dim)
 end
+
+end