diff +multiblock/Grid.m @ 233:b8ee5212f651 feature/beams

multiblock: Added a function to return number of points in each block for a mbGrid. Fixed a bug in DiffOp.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 12 Jul 2016 17:08:15 +0200
parents 8b10476b9bb7
children 819345fe7ff1
line wrap: on
line diff
--- a/+multiblock/Grid.m	Tue Jul 12 16:32:36 2016 +0200
+++ b/+multiblock/Grid.m	Tue Jul 12 17:08:15 2016 +0200
@@ -34,11 +34,20 @@
             n = length(obj.grids);
         end
 
-        % n returns the number of points in the grid
+        % N returns the number of points in the grid
         function o = N(obj)
             o = obj.nPoints;
         end
 
+        % Ns returns the number of points in each sub grid as a vector
+        function o = Ns(obj)
+            ns = zeros(1,obj.nBlocks);
+            for i = 1:obj.nBlocks;
+                ns(i) = obj.grids{i}.N();
+            end
+            o = ns;
+        end
+
         function n = nBlocks(obj)
             n = length(obj.grids);
         end