store microstructure indices as integers
This commit is contained in:
parent
064dabe34b
commit
3caad0bdf4
|
@ -54,17 +54,16 @@ for name in filenames:
|
||||||
np.in1d(microstructure,options.blacklist,invert=True) if options.blacklist else \
|
np.in1d(microstructure,options.blacklist,invert=True) if options.blacklist else \
|
||||||
np.full(geom.grid.prod(),True,dtype=bool))
|
np.full(geom.grid.prod(),True,dtype=bool))
|
||||||
|
|
||||||
seeds = np.concatenate((damask.grid_filters.cell_coord0(geom.grid,geom.size).reshape(-1,3),
|
seeds = damask.grid_filters.cell_coord0(geom.grid,geom.size).reshape(-1,3)
|
||||||
microstructure),
|
|
||||||
axis=1)[mask]
|
|
||||||
|
|
||||||
comments = geom.comments \
|
comments = geom.comments \
|
||||||
+ [scriptID + ' ' + ' '.join(sys.argv[1:]),
|
+ [scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta {}\tb {}\tc {}".format(*geom.grid),
|
'grid\ta {}\tb {}\tc {}'.format(*geom.grid),
|
||||||
"size\tx {}\ty {}\tz {}".format(*geom.size),
|
'size\tx {}\ty {}\tz {}'.format(*geom.size),
|
||||||
"origin\tx {}\ty {}\tz {}".format(*geom.origin),
|
'origin\tx {}\ty {}\tz {}'.format(*geom.origin),
|
||||||
"homogenization\t{}".format(geom.homogenization)]
|
'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 \
|
table.to_ASCII(sys.stdout if name is None else \
|
||||||
os.path.splitext(name)[0]+'.seeds')
|
os.path.splitext(name)[0]+'.seeds')
|
||||||
|
|
Loading…
Reference in New Issue