Merge branch 'development' of magit1.mpie.de:damask/DAMASK into development
This commit is contained in:
commit
590f42cdb6
|
@ -12,7 +12,6 @@ from .config import Material # noqa
|
||||||
from .colormaps import Colormap, Color # noqa
|
from .colormaps import Colormap, Color # noqa
|
||||||
try:
|
try:
|
||||||
from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa
|
from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa
|
||||||
print("Import Cython version of Orientation module")
|
|
||||||
except:
|
except:
|
||||||
from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa
|
from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa
|
||||||
#from .block import Block # only one class
|
#from .block import Block # only one class
|
||||||
|
|
|
@ -73,18 +73,18 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals
|
||||||
[ 1, 1, 1 ],
|
[ 1, 1, 1 ],
|
||||||
]).astype(float)*info['size']
|
]).astype(float)*info['size']
|
||||||
|
|
||||||
squaredweights = np.power(np.tile(weights,len(copies)),2) # Laguerre weights (squared, size N*n)
|
repeatweights = np.repeat(weights,len(copies),axis=1).flatten(order='F') # Laguerre weights (1,2,3,1,2,3,...,1,2,3)
|
||||||
|
|
||||||
for i,vec in enumerate(copies): # periodic copies of seed points (size N*n)
|
for i,vec in enumerate(copies): # periodic copies of seed points ...
|
||||||
try: seeds = np.append(seeds, coords+vec, axis=0)
|
try: seeds = np.append(seeds, coords+vec, axis=0) # ... (1+a,2+a,3+a,...,1+z,2+z,3+z)
|
||||||
except NameError: seeds = coords+vec
|
except NameError: seeds = coords+vec
|
||||||
|
|
||||||
if all(squaredweights == 0.0): # standard Voronoi (no weights, KD tree)
|
if (repeatweights == 0.0).all(): # standard Voronoi (no weights, KD tree)
|
||||||
myKDTree = spatial.cKDTree(seeds)
|
myKDTree = spatial.cKDTree(seeds)
|
||||||
devNull,closestSeeds = myKDTree.query(undeformed)
|
devNull,closestSeeds = myKDTree.query(undeformed)
|
||||||
else:
|
else:
|
||||||
damask.util.croak('...using {} cpu{}'.format(options.cpus, 's' if options.cpus > 1 else ''))
|
damask.util.croak('...using {} cpu{}'.format(options.cpus, 's' if options.cpus > 1 else ''))
|
||||||
arguments = [[arg] + [seeds,squaredweights] for arg in list(undeformed)]
|
arguments = [[arg] + [seeds,repeatweights] for arg in list(undeformed)]
|
||||||
|
|
||||||
if cpus > 1: # use multithreading
|
if cpus > 1: # use multithreading
|
||||||
pool = multiprocessing.Pool(processes = cpus) # initialize workers
|
pool = multiprocessing.Pool(processes = cpus) # initialize workers
|
||||||
|
|
Loading…
Reference in New Issue