fixed buggy behavior in case of non unit-sized geometry

This commit is contained in:
Martin Diehl 2015-10-12 18:10:26 +00:00
parent d455c5acd8
commit f1482a2af4
1 changed files with 10 additions and 6 deletions

View File

@ -73,7 +73,7 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals
[ -1, 1, 1 ],
[ 0, 1, 1 ],
[ 1, 1, 1 ],
]).astype(float)
]).astype(float)*info['size']
squaredweights = np.power(np.tile(weights,len(copies)),2) # Laguerre weights (squared, size N*n)
@ -258,10 +258,14 @@ for name in filenames:
# ------------------------------------------ read seeds ---------------------------------------
table.data_readArray(labels)
coords = table.data[:,table.label_index(options.position):table.label_index(options.position)+3] * info['size']
eulers = table.data[:,table.label_index(options.eulers ):table.label_index(options.eulers )+3] if hasEulers else np.zeros(3*len(coords))
grains = table.data[:,table.label_index(options.microstructure)].astype('i') if hasGrains else 1+np.arange(len(coords))
weights = table.data[:,table.label_index(options.weight)] if hasWeights else np.zeros(len(coords))
coords = table.data[:,table.label_index(options.position):table.label_index(options.position)+3]\
* info['size']
eulers = table.data[:,table.label_index(options.eulers ):table.label_index(options.eulers )+3]\
if hasEulers else np.zeros(3*len(coords))
grains = table.data[:,table.label_index(options.microstructure)].astype('i')\
if hasGrains else 1+np.arange(len(coords))
weights = table.data[:,table.label_index(options.weight)]\
if hasWeights else np.zeros(len(coords))
grainIDs = np.unique(grains).astype('i')
NgrainIDs = len(grainIDs)