From 5f347648e104bf7f4460327f07d27b9a862e4764 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 27 Jun 2013 15:34:37 +0000 Subject: [PATCH] now understands packed geom structure --- processing/pre/geom_translate.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index 0e1568694..8f3ba2783 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -142,9 +142,15 @@ for file in files: i = 0 for line in content: - d = map(int,line.split()) - s = len(d) - microstructure[i:i+s] = d # read microstructure indices + 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) + + s = len(items) + microstructure[i:i+s] = items # read microstructure indices i += s for i in xrange(N):