From 8b5ba9f8f077a446552db0320c5dfc1dae192b9a Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 21 Jun 2013 21:19:14 +0000 Subject: [PATCH] now understands packed geom-files (much faster processing...) --- processing/pre/geom_check.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/processing/pre/geom_check.py b/processing/pre/geom_check.py index 09194333f..08cb441a4 100755 --- a/processing/pre/geom_check.py +++ b/processing/pre/geom_check.py @@ -130,7 +130,14 @@ for file in files: structure = vtk.vtkIntArray() structure.SetName('Microstructures') for line in content: - for item in map(int,line.split()): + items = line.split() + if len(items) > 2: + if items[1].lower() == 'of': items = [int(items[2])]*int(items[0]) + elif items[1].lower() == 'to': items = xrange(int(items[0]),1+int(items[2])) + else: items = map(int,items) + else: items = map(int,items) + + for item in items: structure.InsertNextValue(item) grid.GetCellData().AddArray(structure)