output complete microstructure and texture info instead of limiting to grainIDs used in geometry
This commit is contained in:
parent
0c1fe236b4
commit
4dfd59a9e2
|
@ -276,10 +276,10 @@ for name in filenames:
|
||||||
grid = np.vstack(meshgrid2(x, y, z)).reshape(3,-1).T
|
grid = np.vstack(meshgrid2(x, y, z)).reshape(3,-1).T
|
||||||
indices = laguerreTessellation(grid, coords, weights, grains, options.nonperiodic, options.cpus)
|
indices = laguerreTessellation(grid, coords, weights, grains, options.nonperiodic, options.cpus)
|
||||||
|
|
||||||
# --- write header ---------------------------------------------------------------------------------
|
# --- write header ------------------------------------------------------------------------
|
||||||
|
|
||||||
grainIDs = np.intersect1d(grainIDs,indices)
|
usedGrainIDs = np.intersect1d(grainIDs,indices)
|
||||||
info['microstructures'] = len(grainIDs)
|
info['microstructures'] = len(usedGrainIDs)
|
||||||
|
|
||||||
if info['homogenization'] == 0: info['homogenization'] = options.homogenization
|
if info['homogenization'] == 0: info['homogenization'] = options.homogenization
|
||||||
|
|
||||||
|
@ -292,13 +292,13 @@ for name in filenames:
|
||||||
])
|
])
|
||||||
|
|
||||||
config_header = []
|
config_header = []
|
||||||
formatwidth = 1+int(math.log10(info['microstructures']))
|
formatwidth = 1+int(math.log10(NgrainIDs))
|
||||||
|
|
||||||
phase = options.phase * np.ones(info['microstructures'],'i')
|
phase = options.phase * np.ones(NgrainIDs,'i')
|
||||||
if int(options.secondphase*info['microstructures']) > 0:
|
if int(options.secondphase*info['microstructures']) > 0:
|
||||||
phase[0:int(options.secondphase*info['microstructures'])] += 1
|
phase[0:int(options.secondphase*info['microstructures'])] += 1 # alter fraction 'options.secondphase' of used grainIDs
|
||||||
randomSeed = int(os.urandom(4).encode('hex'), 16) if options.randomSeed is None \
|
randomSeed = options.randomSeed if options.randomSeed \
|
||||||
else options.randomSeed # random seed for second phase
|
else int(os.urandom(4).encode('hex'), 16) # random seed for second phase
|
||||||
np.random.seed(randomSeed)
|
np.random.seed(randomSeed)
|
||||||
np.random.shuffle(phase)
|
np.random.shuffle(phase)
|
||||||
config_header += ['# random seed (phase shuffling): {}'.format(randomSeed)]
|
config_header += ['# random seed (phase shuffling): {}'.format(randomSeed)]
|
||||||
|
|
Loading…
Reference in New Issue