From 3caad0bdf4208f38b2fa7d305714c8adcb77ad23 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Mar 2020 06:00:42 +0100 Subject: [PATCH] store microstructure indices as integers --- processing/pre/seeds_fromGeom.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/processing/pre/seeds_fromGeom.py b/processing/pre/seeds_fromGeom.py index 438615369..80dc0d6f5 100755 --- a/processing/pre/seeds_fromGeom.py +++ b/processing/pre/seeds_fromGeom.py @@ -54,17 +54,16 @@ for name in filenames: np.in1d(microstructure,options.blacklist,invert=True) if options.blacklist else \ np.full(geom.grid.prod(),True,dtype=bool)) - seeds = np.concatenate((damask.grid_filters.cell_coord0(geom.grid,geom.size).reshape(-1,3), - microstructure), - axis=1)[mask] + seeds = damask.grid_filters.cell_coord0(geom.grid,geom.size).reshape(-1,3) comments = geom.comments \ + [scriptID + ' ' + ' '.join(sys.argv[1:]), - "grid\ta {}\tb {}\tc {}".format(*geom.grid), - "size\tx {}\ty {}\tz {}".format(*geom.size), - "origin\tx {}\ty {}\tz {}".format(*geom.origin), - "homogenization\t{}".format(geom.homogenization)] + 'grid\ta {}\tb {}\tc {}'.format(*geom.grid), + 'size\tx {}\ty {}\tz {}'.format(*geom.size), + 'origin\tx {}\ty {}\tz {}'.format(*geom.origin), + 'homogenization\t{}'.format(geom.homogenization)] - table = damask.Table(seeds,{'pos':(3,),'microstructure':(1,)},comments) + table = damask.Table(seeds[mask],{'pos':(3,)},comments) + table.add('microstructure',microstructure[mask]) table.to_ASCII(sys.stdout if name is None else \ os.path.splitext(name)[0]+'.seeds')