using library function
This commit is contained in:
parent
a2b21abcba
commit
233642ed08
|
@ -196,8 +196,6 @@ parser.set_defaults(pos = 'pos',
|
||||||
)
|
)
|
||||||
|
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filenames) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if filenames == []: filenames = [None]
|
if filenames == []: filenames = [None]
|
||||||
|
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
|
@ -258,20 +256,14 @@ for name in filenames:
|
||||||
eulers = table.data[:,table.label_indexrange(options.eulers)] if hasEulers \
|
eulers = table.data[:,table.label_indexrange(options.eulers)] if hasEulers \
|
||||||
else np.zeros(3*len(coords))
|
else np.zeros(3*len(coords))
|
||||||
grains = table.data[:,table.label_indexrange(options.microstructure)].astype(int) if hasGrains \
|
grains = table.data[:,table.label_indexrange(options.microstructure)].astype(int) if hasGrains \
|
||||||
else 1+np.arange(len(coords))
|
else np.arange(len(coords))+1
|
||||||
weights = table.data[:,table.label_indexrange(options.weight)] if hasWeights \
|
weights = table.data[:,table.label_indexrange(options.weight)] if hasWeights \
|
||||||
else np.zeros(len(coords))
|
else np.zeros(len(coords))
|
||||||
grainIDs = np.unique(grains).astype('i')
|
grainIDs = np.unique(grains).astype('i')
|
||||||
NgrainIDs = len(grainIDs)
|
NgrainIDs = len(grainIDs)
|
||||||
|
|
||||||
# --- tessellate microstructure ------------------------------------------------------------
|
# --- tessellate microstructure ------------------------------------------------------------
|
||||||
|
grid = damask.grid_filters.cell_coord0(info['grid'],info['size']).reshape(-1,3)
|
||||||
x = (np.arange(info['grid'][0])+0.5)*info['size'][0]/info['grid'][0]
|
|
||||||
y = (np.arange(info['grid'][1])+0.5)*info['size'][1]/info['grid'][1]
|
|
||||||
z = (np.arange(info['grid'][2])+0.5)*info['size'][2]/info['grid'][2]
|
|
||||||
X,Y,Z = np.meshgrid(x, y, z,indexing='ij')
|
|
||||||
grid = np.stack((X,Y,Z),axis=-1).reshape((np.prod(info['grid']),3),order='F')
|
|
||||||
|
|
||||||
damask.util.croak('tessellating...')
|
damask.util.croak('tessellating...')
|
||||||
indices = laguerreTessellation(grid, coords, weights, grains, options.periodic, options.cpus)
|
indices = laguerreTessellation(grid, coords, weights, grains, options.periodic, options.cpus)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue