updated reference results (visual impression much better now) for geom_fromTable and silenced verbose debug output per default since it's causing problems when piping to file
This commit is contained in:
parent
1691a42994
commit
f61f87e6d0
|
@ -80,16 +80,16 @@ parser.add_option('--crystallite',
|
||||||
dest = 'crystallite',
|
dest = 'crystallite',
|
||||||
type = 'int', metavar = 'int',
|
type = 'int', metavar = 'int',
|
||||||
help = 'crystallite index to be used [%default]')
|
help = 'crystallite index to be used [%default]')
|
||||||
parser.add_option('--debug',
|
parser.add_option('--verbose',
|
||||||
dest = 'debug', action = 'store_true',
|
dest = 'verbose', action = 'store_true',
|
||||||
help = 'output debug info')
|
help = 'output extra info')
|
||||||
|
|
||||||
parser.set_defaults(symmetry = [damask.Symmetry.lattices[-1]],
|
parser.set_defaults(symmetry = [damask.Symmetry.lattices[-1]],
|
||||||
tolerance = 0.0,
|
tolerance = 0.0,
|
||||||
degrees = False,
|
degrees = False,
|
||||||
homogenization = 1,
|
homogenization = 1,
|
||||||
crystallite = 1,
|
crystallite = 1,
|
||||||
debug = False,
|
verbose = False,
|
||||||
)
|
)
|
||||||
|
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filenames) = parser.parse_args()
|
||||||
|
@ -156,10 +156,10 @@ for name in filenames:
|
||||||
|
|
||||||
if coordDim == 2:
|
if coordDim == 2:
|
||||||
table.data = np.insert(table.data,2,np.zeros(len(table.data)),axis=1) # add zero z coordinate for two-dimensional input
|
table.data = np.insert(table.data,2,np.zeros(len(table.data)),axis=1) # add zero z coordinate for two-dimensional input
|
||||||
if options.debug: damask.util.croak('extending to 3D...')
|
if options.verbose: damask.util.croak('extending to 3D...')
|
||||||
if options.phase == None:
|
if options.phase == None:
|
||||||
table.data = np.column_stack((table.data,np.ones(len(table.data)))) # add single phase if no phase column given
|
table.data = np.column_stack((table.data,np.ones(len(table.data)))) # add single phase if no phase column given
|
||||||
if options.debug: damask.util.croak('adding dummy phase info...')
|
if options.verbose: damask.util.croak('adding dummy phase info...')
|
||||||
|
|
||||||
# --------------- figure out size and grid ---------------------------------------------------------
|
# --------------- figure out size and grid ---------------------------------------------------------
|
||||||
|
|
||||||
|
@ -197,13 +197,14 @@ for name in filenames:
|
||||||
|
|
||||||
# --- start background messaging
|
# --- start background messaging
|
||||||
|
|
||||||
bg = damask.util.backgroundMessage()
|
if options.verbose:
|
||||||
bg.start()
|
bg = damask.util.backgroundMessage()
|
||||||
|
bg.start()
|
||||||
|
|
||||||
colPhase = -1 # column of phase data comes last
|
colPhase = -1 # column of phase data comes last
|
||||||
bg.set_message('sorting positions...')
|
if options.verbose: bg.set_message('sorting positions...')
|
||||||
index = np.lexsort((table.data[:,0],table.data[:,1],table.data[:,2])) # index of position when sorting x fast, z slow
|
index = np.lexsort((table.data[:,0],table.data[:,1],table.data[:,2])) # index of position when sorting x fast, z slow
|
||||||
bg.set_message('building KD tree...')
|
if options.verbose: bg.set_message('building KD tree...')
|
||||||
KDTree = scipy.spatial.KDTree((table.data[index,:3]-mincorner) / delta) # build KDTree with dX = dY = dZ = 1 and origin 0,0,0
|
KDTree = scipy.spatial.KDTree((table.data[index,:3]-mincorner) / delta) # build KDTree with dX = dY = dZ = 1 and origin 0,0,0
|
||||||
|
|
||||||
statistics = {'global': 0, 'local': 0}
|
statistics = {'global': 0, 'local': 0}
|
||||||
|
@ -216,14 +217,15 @@ for name in filenames:
|
||||||
myPos = 0 # position (in list) of current grid point
|
myPos = 0 # position (in list) of current grid point
|
||||||
|
|
||||||
tick = time.clock()
|
tick = time.clock()
|
||||||
bg.set_message('assigning grain IDs...')
|
if options.verbose: bg.set_message('assigning grain IDs...')
|
||||||
|
|
||||||
for z in xrange(grid[2]):
|
for z in xrange(grid[2]):
|
||||||
for y in xrange(grid[1]):
|
for y in xrange(grid[1]):
|
||||||
for x in xrange(grid[0]):
|
for x in xrange(grid[0]):
|
||||||
if (myPos+1)%(N/500.) < 1:
|
if (myPos+1)%(N/500.) < 1:
|
||||||
time_delta = (time.clock()-tick) * (N - myPos) / myPos
|
time_delta = (time.clock()-tick) * (N - myPos) / myPos
|
||||||
bg.set_message('(%02i:%02i:%02i) processing point %i of %i (grain count %i)...'%(time_delta//3600,time_delta%3600//60,time_delta%60,myPos,N,nGrains))
|
if options.verbose: bg.set_message('(%02i:%02i:%02i) processing point %i of %i (grain count %i)...'
|
||||||
|
%(time_delta//3600,time_delta%3600//60,time_delta%60,myPos,N,nGrains))
|
||||||
|
|
||||||
myData = table.data[index[myPos]] # read data for current grid point
|
myData = table.data[index[myPos]] # read data for current grid point
|
||||||
myPhase = int(myData[colPhase])
|
myPhase = int(myData[colPhase])
|
||||||
|
@ -288,10 +290,12 @@ for name in filenames:
|
||||||
|
|
||||||
myPos += 1
|
myPos += 1
|
||||||
|
|
||||||
bg.stop()
|
if options.verbose:
|
||||||
bg.join()
|
bg.stop()
|
||||||
|
bg.join()
|
||||||
|
|
||||||
if options.debug: damask.util.croak("{} seconds total.\n{} local and {} global matches.".format(time.clock()-tick,statistics['local'],statistics['global']))
|
if options.verbose: damask.util.croak("{} seconds total.\n{} local and {} global matches.".\
|
||||||
|
format(time.clock()-tick,statistics['local'],statistics['global']))
|
||||||
|
|
||||||
# --- generate header ----------------------------------------------------------------------------
|
# --- generate header ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue