From f1482a2af4e6a4cde126ac8e18a0191adc95e642 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 12 Oct 2015 18:10:26 +0000 Subject: [PATCH] fixed buggy behavior in case of non unit-sized geometry --- processing/pre/geom_fromVoronoiTessellation.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 2bfe42921..3c45e964a 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -73,8 +73,8 @@ 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) for i,vec in enumerate(copies): # periodic copies of seed points (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)