polishing
This commit is contained in:
parent
f961f3590c
commit
67f64b7a7a
|
@ -13,13 +13,14 @@ from scipy import spatial
|
||||||
import damask
|
import damask
|
||||||
|
|
||||||
|
|
||||||
def findClosestSeed(seeds, weights, point):
|
|
||||||
return np.argmin(np.sum((np.broadcast_to(point,(len(seeds),3))-seeds)**2,axis=1) - weights)
|
|
||||||
|
|
||||||
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
||||||
scriptID = ' '.join([scriptName,damask.version])
|
scriptID = ' '.join([scriptName,damask.version])
|
||||||
|
|
||||||
|
|
||||||
|
def findClosestSeed(seeds, weights, point):
|
||||||
|
return np.argmin(np.sum((np.broadcast_to(point,(len(seeds),3))-seeds)**2,axis=1) - weights)
|
||||||
|
|
||||||
|
|
||||||
def Laguerre_tessellation(grid, seeds, grains, size, periodic, weights, cpus):
|
def Laguerre_tessellation(grid, seeds, grains, size, periodic, weights, cpus):
|
||||||
|
|
||||||
if periodic:
|
if periodic:
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import random
|
|
||||||
from optparse import OptionParser,OptionGroup
|
from optparse import OptionParser,OptionGroup
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -139,8 +138,8 @@ for name in filenames:
|
||||||
i = 1
|
i = 1
|
||||||
progress = damask.util._ProgressBar(options.N,'',50)
|
progress = damask.util._ProgressBar(options.N,'',50)
|
||||||
while i < options.N:
|
while i < options.N:
|
||||||
candidates = np.random.choice(unpicked[unpicked.mask==False],replace=False,
|
candidates = np.random.choice(unpicked[not unpicked.mask],replace=False,
|
||||||
size=min(len(unpicked[unpicked.mask==False]),options.numCandidates))
|
size=min(len(unpicked[not unpicked.mask]),options.numCandidates))
|
||||||
tree = spatial.cKDTree(seeds[:i])
|
tree = spatial.cKDTree(seeds[:i])
|
||||||
distances, dev_null = tree.query(coords[candidates])
|
distances, dev_null = tree.query(coords[candidates])
|
||||||
best = distances.argmax()
|
best = distances.argmax()
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# -*- coding: UTF-8 no BOM -*-
|
"""Aggregator for configuration file handling."""
|
||||||
|
|
||||||
"""Aggregator for configuration file handling"""
|
|
||||||
|
|
||||||
from .material import Material # noqa
|
from .material import Material # noqa
|
||||||
|
|
Loading…
Reference in New Issue