From 019e8d57c6266ce0b26d8eacab984f303442a184 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 5 Nov 2019 23:22:36 +0100 Subject: Add cell index generator method to Geometry class --- boltzgen/geometry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boltzgen/geometry.py b/boltzgen/geometry.py index 443dee2..bf99413 100644 --- a/boltzgen/geometry.py +++ b/boltzgen/geometry.py @@ -28,6 +28,9 @@ class Geometry: for idx in ndindex(self.inner_size(), order=order): yield tuple(map(lambda i: i + 1, idx)) + def cells(self, order='F'): + return ndindex(self.size(), order=order) + def size(self): if self.size_z == 1: return (self.size_x, self.size_y) -- cgit v1.2.3