added verbosity on help messages
This commit is contained in:
parent
33e43b60ea
commit
8b4af554ba
|
@ -52,11 +52,11 @@ Changes the (three-dimensional) canvas of a spectral geometry description.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='string', nargs = 3, \
|
parser.add_option('-g', '--grid', dest='grid', type='string', nargs = 3, metavar='int int int ', \
|
||||||
help='a,b,c grid of hexahedral box [unchanged]')
|
help='a,b,c grid of hexahedral box [unchanged]')
|
||||||
parser.add_option('-o', '--offset', dest='offset', type='int', nargs = 3, \
|
parser.add_option('-o', '--offset', dest='offset', type='int', nargs = 3, metavar='int int int', \
|
||||||
help='a,b,c offset from old to new origin of grid %default')
|
help='a,b,c offset from old to new origin of grid %default')
|
||||||
parser.add_option('-f', '--fill', dest='fill', type='int', \
|
parser.add_option('-f', '--fill', dest='fill', type='int', metavar = 'int', \
|
||||||
help='(background) canvas grain index. "0" selects maximum microstructure index + 1 [%default]')
|
help='(background) canvas grain index. "0" selects maximum microstructure index + 1 [%default]')
|
||||||
|
|
||||||
parser.set_defaults(grid = ['0','0','0'])
|
parser.set_defaults(grid = ['0','0','0'])
|
||||||
|
@ -199,7 +199,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
||||||
|
|
|
@ -36,19 +36,19 @@ Two phases can be discriminated based on threshold value in a given data column.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
parser.add_option('--column', dest='column', type='int', \
|
parser.add_option('--column', dest='column', type='int', metavar = 'int', \
|
||||||
help='data column to discriminate phase 1 from 2 [%default]')
|
help='data column to discriminate phase 1 from 2 [%default]')
|
||||||
parser.add_option('-t','--threshold', dest='threshold', type='float', \
|
parser.add_option('-t','--threshold', dest='threshold', type='float', metavar = 'float', \
|
||||||
help='threshold value to discriminate phase 1 from 2 [%default]')
|
help='threshold value to discriminate phase 1 from 2 [%default]')
|
||||||
parser.add_option('--homogenization', dest='homogenization', type='int', \
|
parser.add_option('--homogenization', dest='homogenization', type='int', metavar = 'int', \
|
||||||
help='homogenization index to be used [%default]')
|
help='homogenization index to be used [%default]')
|
||||||
parser.add_option('--phase', dest='phase', type='int', nargs = 2, \
|
parser.add_option('--phase', dest='phase', type='int', nargs = 2, metavar = 'int int', \
|
||||||
help='two phase indices to be used %default')
|
help='two phase indices to be used %default')
|
||||||
parser.add_option('--crystallite', dest='crystallite', type='int', \
|
parser.add_option('--crystallite', dest='crystallite', type='int', metavar = 'int', \
|
||||||
help='crystallite index to be used [%default]')
|
help='crystallite index to be used [%default]')
|
||||||
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
||||||
help='output material configuration [%default]')
|
help='output material configuration [%default]')
|
||||||
parser.add_option('-a', '--axes', dest='axes', type='string', nargs = 3, \
|
parser.add_option('-a', '--axes', dest='axes', type='string', nargs = 3, metavar = 'string string string', \
|
||||||
help='axes assignement of eulerangles x,y,z = %default')
|
help='axes assignement of eulerangles x,y,z = %default')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -117,9 +117,9 @@ boundaries, triple lines, and quadruple points.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-t','--type', dest='type', action='extend', type='string', \
|
parser.add_option('-t','--type', dest='type', action='extend', type='string', metavar = '<string LIST>', \
|
||||||
help='feature type (%s)'%(', '.join(map(lambda x:', '.join(x['names']),features))))
|
help='feature type (%s) '%(', '.join(map(lambda x:', '.join(x['names']),features))) )
|
||||||
parser.add_option('-n','--neighborhood', dest='neigborhood', choices=neighborhoods.keys(), \
|
parser.add_option('-n','--neighborhood', dest='neigborhood', choices=neighborhoods.keys(), metavar = 'string', \
|
||||||
help='type of neighborhood (%s) [neumann]'%(', '.join(neighborhoods.keys())))
|
help='type of neighborhood (%s) [neumann]'%(', '.join(neighborhoods.keys())))
|
||||||
parser.add_option('-2', '--twodimensional', dest='twoD', action='store_true', \
|
parser.add_option('-2', '--twodimensional', dest='twoD', action='store_true', \
|
||||||
help='output geom file with two-dimensional data arrangement [%default]')
|
help='output geom file with two-dimensional data arrangement [%default]')
|
||||||
|
@ -214,7 +214,7 @@ for file in files:
|
||||||
file['croak'].write('invalid size x y z.\n')
|
file['croak'].write('invalid size x y z.\n')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
new_header.append(scriptID,' '+ ' '.join(sys.argv[1:]) + '\n')
|
new_header.append(scriptID + ' ' + ' '.join(sys.argv[1:]) + '\n')
|
||||||
new_header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
new_header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
||||||
new_header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
new_header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
||||||
new_header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
new_header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
||||||
|
|
|
@ -43,19 +43,19 @@ Generate a geometry file of a bicontinuous structure of given type.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-t','--type', dest='type', choices=minimal_surfaces, \
|
parser.add_option('-t','--type', dest='type', choices=minimal_surfaces, metavar='string', \
|
||||||
help='type of minimal surface (%s) [primitive]' %(','.join(minimal_surfaces)))
|
help='type of minimal surface (%s) [primitive]' %(','.join(minimal_surfaces)))
|
||||||
parser.add_option('-f','--threshold', dest='threshold', type='float', \
|
parser.add_option('-f','--threshold', dest='threshold', type='float', metavar='float', \
|
||||||
help='threshold value defining minimal surface [%default]')
|
help='threshold value defining minimal surface [%default]')
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='int', nargs=3, \
|
parser.add_option('-g', '--grid', dest='grid', type='int', nargs=3, metavar='int int int', \
|
||||||
help='a,b,c grid of hexahedral box %default')
|
help='a,b,c grid of hexahedral box %default')
|
||||||
parser.add_option('-s', '--size', dest='size', type='float', nargs=3, \
|
parser.add_option('-s', '--size', dest='size', type='float', nargs=3, metavar='float float float', \
|
||||||
help='x,y,z size of hexahedral box %default')
|
help='x,y,z size of hexahedral box %default')
|
||||||
parser.add_option('-p', '--periods', dest='periods', type='int', \
|
parser.add_option('-p', '--periods', dest='periods', type='int', metavar= 'int', \
|
||||||
help='number of repetitions of unit cell [%default]')
|
help='number of repetitions of unit cell [%default]')
|
||||||
parser.add_option('--homogenization', dest='homogenization', type='int', \
|
parser.add_option('--homogenization', dest='homogenization', type='int', metavar= 'int', \
|
||||||
help='homogenization index to be used [%default]')
|
help='homogenization index to be used [%default]')
|
||||||
parser.add_option('--m', dest='microstructure', type='int', nargs = 2, \
|
parser.add_option('--m', dest='microstructure', type='int', nargs = 2, metavar= 'int int', \
|
||||||
help='two microstructure indices to be used %default')
|
help='two microstructure indices to be used %default')
|
||||||
parser.add_option('-2', '--twodimensional', dest='twoD', action='store_true', \
|
parser.add_option('-2', '--twodimensional', dest='twoD', action='store_true', \
|
||||||
help='output geom file with two-dimensional data arrangement [%default]')
|
help='output geom file with two-dimensional data arrangement [%default]')
|
||||||
|
@ -101,7 +101,7 @@ if numpy.any(info['size'] <= 0.0):
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
#--- write header ---------------------------------------------------------------------------------
|
#--- write header ---------------------------------------------------------------------------------
|
||||||
header = [scriptID,' ' + ' '.join(sys.argv[1:])+'\n']
|
header = [scriptID + ' ' + ' '.join(sys.argv[1:])+'\n']
|
||||||
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
||||||
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
||||||
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
||||||
|
|
|
@ -36,25 +36,25 @@ Its fiber orientation is oscillating by +/- amplitude within one period.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='int', nargs=2, \
|
parser.add_option('-g', '--grid', dest='grid', type='int', nargs=2, metavar = 'int int', \
|
||||||
help='a,b grid of hexahedral box %default')
|
help='a,b grid of hexahedral box %default')
|
||||||
parser.add_option('-s', '--size', dest='size', type='float', nargs=2, \
|
parser.add_option('-s', '--size', dest='size', type='float', nargs=2, metavar = 'float float', \
|
||||||
help='x,y size of hexahedral box %default')
|
help='x,y size of hexahedral box %default')
|
||||||
parser.add_option('-c', '--canal', dest='canal', type='float', \
|
parser.add_option('-c', '--canal', dest='canal', type='float', metavar = 'float', \
|
||||||
help='Haversian canal radius [%default]')
|
help='Haversian canal radius [%default]')
|
||||||
parser.add_option('-o', '--osteon', dest='osteon', type='float', \
|
parser.add_option('-o', '--osteon', dest='osteon', type='float', metavar = 'float', \
|
||||||
help='osteon radius (horizontal) [%default]')
|
help='osteon radius (horizontal) [%default]')
|
||||||
parser.add_option('-l', '--lamella', dest='period', type='float', \
|
parser.add_option('-l', '--lamella', dest='period', type='float', metavar = 'float', \
|
||||||
help='lamella width [%default]')
|
help='lamella width [%default]')
|
||||||
parser.add_option('-a', '--amplitude', dest='amplitude', type='float', \
|
parser.add_option('-a', '--amplitude', dest='amplitude', type='float', metavar = 'float', \
|
||||||
help='amplitude of twisted plywood wiggle in deg [%default]')
|
help='amplitude of twisted plywood wiggle in deg [%default]')
|
||||||
parser.add_option( '--aspect', dest='aspect', type='float', \
|
parser.add_option( '--aspect', dest='aspect', type='float', metavar = 'float', \
|
||||||
help='osteon aspect ratio (vert/horiz) [%default]')
|
help='osteon aspect ratio (vert/horiz) [%default]')
|
||||||
parser.add_option('-w', '--omega', dest='omega', type='float', \
|
parser.add_option('-w', '--omega', dest='omega', type='float', metavar = 'float', \
|
||||||
help='rotation angle (around normal) of osteon [%default]')
|
help='rotation angle (around normal) of osteon [%default]')
|
||||||
parser.add_option('--homogenization', dest='homogenization', type='int', \
|
parser.add_option('--homogenization', dest='homogenization', type='int', metavar = 'int', \
|
||||||
help='homogenization index to be used [%default]')
|
help='homogenization index to be used [%default]')
|
||||||
parser.add_option('--crystallite', dest='crystallite', type='int', \
|
parser.add_option('--crystallite', dest='crystallite', type='int', metavar = 'int', \
|
||||||
help='crystallite index to be used [%default]')
|
help='crystallite index to be used [%default]')
|
||||||
parser.add_option('--configuration', dest='config', action='store_true', \
|
parser.add_option('--configuration', dest='config', action='store_true', \
|
||||||
help='output material configuration [%default]')
|
help='output material configuration [%default]')
|
||||||
|
@ -175,7 +175,7 @@ if options.config:
|
||||||
betaOfGrain[i]))
|
betaOfGrain[i]))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
header = [scriptID,' ' + ' '.join(sys.argv[1:])+'\n']
|
header = [scriptID + ' ' + ' '.join(sys.argv[1:])+'\n']
|
||||||
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
||||||
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
||||||
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
||||||
|
|
|
@ -36,15 +36,15 @@ Generate geometry description and material configuration from input files used b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
parser.add_option('--column', dest='column', type='int', \
|
parser.add_option('--column', dest='column', type='int', metavar = 'int', \
|
||||||
help='data column to discriminate phase 1 from 2 [%default]')
|
help='data column to discriminate phase 1 from 2 [%default]')
|
||||||
parser.add_option('-t','--treshold', dest='threshold', type='float', \
|
parser.add_option('-t','--treshold', dest='threshold', type='float', metavar = 'float', \
|
||||||
help='threshold value to discriminate phase 1 from 2 [%default]')
|
help='threshold value to discriminate phase 1 from 2 [%default]')
|
||||||
parser.add_option('--homogenization', dest='homogenization', type='int', \
|
parser.add_option('--homogenization', dest='homogenization', type='int', metavar = 'int', \
|
||||||
help='homogenization index to be used [%default]')
|
help='homogenization index to be used [%default]')
|
||||||
parser.add_option('--phase', dest='phase', type='int', nargs = 2, \
|
parser.add_option('--phase', dest='phase', type='int', nargs = 2, metavar = 'int int', \
|
||||||
help='two phase indices to be used %default')
|
help='two phase indices to be used %default')
|
||||||
parser.add_option('--crystallite', dest='crystallite', type='int', \
|
parser.add_option('--crystallite', dest='crystallite', type='int', metavar = 'int', \
|
||||||
help='crystallite index to be used [%default]')
|
help='crystallite index to be used [%default]')
|
||||||
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
||||||
help='output material configuration [%default]')
|
help='output material configuration [%default]')
|
||||||
|
@ -132,7 +132,7 @@ for file in files:
|
||||||
file['output'].write('\n'.join(microstructure) + \
|
file['output'].write('\n'.join(microstructure) + \
|
||||||
'\n'.join(texture))
|
'\n'.join(texture))
|
||||||
else:
|
else:
|
||||||
header = [scriptID,' ' + ' '.join(sys.argv[1:])+'\n']
|
header = [scriptID + ' ' + ' '.join(sys.argv[1:])+'\n']
|
||||||
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
header.append("grid\ta %i\tb %i\tc %i\n"%(info['grid'][0],info['grid'][1],info['grid'][2],))
|
||||||
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
header.append("size\tx %f\ty %f\tz %f\n"%(info['size'][0],info['size'][1],info['size'][2],))
|
||||||
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
header.append("origin\tx %f\ty %f\tz %f\n"%(info['origin'][0],info['origin'][1],info['origin'][2],))
|
||||||
|
|
|
@ -74,15 +74,15 @@ Generate geometry description and material configuration by standard Voronoi tes
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='int', nargs = 3, \
|
parser.add_option('-g', '--grid', dest='grid', type='int', nargs = 3, metavar = 'int int int', \
|
||||||
help='a,b,c grid of hexahedral box [from seeds file]')
|
help='a,b,c grid of hexahedral box [from seeds file]')
|
||||||
parser.add_option('-s', '--size', dest='size', type='float', nargs = 3, \
|
parser.add_option('-s', '--size', dest='size', type='float', nargs = 3, metavar = 'float float float', \
|
||||||
help='x,y,z size of hexahedral box [1.0 along largest grid point number]')
|
help='x,y,z size of hexahedral box [1.0 along largest grid point number]')
|
||||||
parser.add_option('--homogenization', dest='homogenization', type='int', \
|
parser.add_option('--homogenization', dest='homogenization', type='int', metavar = 'int', \
|
||||||
help='homogenization index to be used [%default]')
|
help='homogenization index to be used [%default]')
|
||||||
parser.add_option('--phase', dest='phase', type='int', \
|
parser.add_option('--phase', dest='phase', type='int', metavar = 'int', \
|
||||||
help='phase index to be used [%default]')
|
help='phase index to be used [%default]')
|
||||||
parser.add_option('--crystallite', dest='crystallite', type='int', \
|
parser.add_option('--crystallite', dest='crystallite', type='int', metavar = 'int', \
|
||||||
help='crystallite index to be used [%default]')
|
help='crystallite index to be used [%default]')
|
||||||
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
parser.add_option('-c', '--configuration', dest='config', action='store_true', \
|
||||||
help='output material configuration [%default]')
|
help='output material configuration [%default]')
|
||||||
|
@ -249,7 +249,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
|
@ -57,21 +57,16 @@ The final geometry is assembled by selecting at each voxel that grain index for
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-d', '--distance', dest='d', type='int', \
|
parser.add_option('-d', '--distance', dest='d', type='int', metavar='int', \
|
||||||
help='diffusion distance in voxels [%default]', metavar='float')
|
help='diffusion distance in voxels [%default]')
|
||||||
parser.add_option('-N', '--smooth', dest='N', type='int', \
|
parser.add_option('-N', '--smooth', dest='N', type='int', metavar='int', \
|
||||||
help='N for curvature flow [%default]')
|
help='N for curvature flow [%default]')
|
||||||
parser.add_option('-b', '--black', dest='black', action='extend', type='string', \
|
|
||||||
help='indices of stationary microstructures', metavar='<LIST>')
|
|
||||||
|
|
||||||
parser.set_defaults(d = 1)
|
parser.set_defaults(d = 1)
|
||||||
parser.set_defaults(N = 1)
|
parser.set_defaults(N = 1)
|
||||||
parser.set_defaults(p = [1,1,1])
|
|
||||||
parser.set_defaults(black = [])
|
|
||||||
|
|
||||||
(options, filenames) = parser.parse_args()
|
(options, filenames) = parser.parse_args()
|
||||||
|
|
||||||
options.black = map(int,options.black)
|
|
||||||
|
|
||||||
#--- setup file handles --------------------------------------------------------------------------
|
#--- setup file handles --------------------------------------------------------------------------
|
||||||
files = []
|
files = []
|
||||||
|
@ -162,8 +157,7 @@ for file in files:
|
||||||
microstructure = microstructure.reshape([2 if i == 1 else i for i in info['grid']],order='F')
|
microstructure = microstructure.reshape([2 if i == 1 else i for i in info['grid']],order='F')
|
||||||
|
|
||||||
#--- domain decomposition -------------------------------------------------------------------------
|
#--- domain decomposition -------------------------------------------------------------------------
|
||||||
numProc = int(options.p[0]*options.p[1]*options.p[2])
|
stride = numpy.array([2 if i == 1 else i for i in info['grid']],'i')
|
||||||
stride = numpy.array([2 if i == 1 else i for i in info['grid']],'i')/options.p
|
|
||||||
if numpy.any(numpy.floor(stride) != stride):
|
if numpy.any(numpy.floor(stride) != stride):
|
||||||
file['croak'].write('invalid domain decomposition.\n')
|
file['croak'].write('invalid domain decomposition.\n')
|
||||||
continue
|
continue
|
||||||
|
@ -209,7 +203,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID+ ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
|
@ -122,7 +122,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %e\ty %e\tz %e"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %e\ty %e\tz %e"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %e\ty %e\tz %e"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %e\ty %e\tz %e"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
|
@ -53,13 +53,13 @@ Either absolute values or relative factors (like "0.25x") can be used.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='string', nargs = 3, \
|
parser.add_option('-g', '--grid', dest='grid', type='int', nargs = 3, metavar = 'int int int', \
|
||||||
help='a,b,c grid of hexahedral box [unchanged]')
|
help='a,b,c grid of hexahedral box [unchanged]')
|
||||||
parser.add_option('-s', '--size', dest='size', type='string', nargs = 3, \
|
parser.add_option('-s', '--size', dest='size', type='float', nargs = 3, metavar = 'float float float', \
|
||||||
help='x,y,z size of hexahedral box [unchanged]')
|
help='x,y,z size of hexahedral box [unchanged]')
|
||||||
|
|
||||||
parser.set_defaults(grid = ['0','0','0'])
|
parser.set_defaults(grid = [0,0,0])
|
||||||
parser.set_defaults(size = ['0.0','0.0','0.0'])
|
parser.set_defaults(size = [0.0,0.0,0.0])
|
||||||
|
|
||||||
(options, filenames) = parser.parse_args()
|
(options, filenames) = parser.parse_args()
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
|
@ -52,11 +52,11 @@ translate microstructure indices (shift or substitute) and/or geometry origin.
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-o', '--origin', dest='origin', type='float', nargs = 3, \
|
parser.add_option('-o', '--origin', dest='origin', type='float', nargs = 3, \
|
||||||
help='offset from old to new origin of grid', metavar='<x y z>')
|
help='offset from old to new origin of grid', metavar='float float float')
|
||||||
parser.add_option('-m', '--microstructure', dest='microstructure', type='int', \
|
parser.add_option('-m', '--microstructure', dest='microstructure', type='int', \
|
||||||
help='offset from old to new microstructure indices', metavar='<int>')
|
help='offset from old to new microstructure indices', metavar='int')
|
||||||
parser.add_option('-s', '--substitute', action='extend', dest='substitute', type='string', \
|
parser.add_option('-s', '--substitute', action='extend', dest='substitute', type='string', \
|
||||||
help='substitutions of microstructure indices from,to,from,to,...', metavar='<list>')
|
help='substitutions of microstructure indices from,to,from,to,...', metavar='<string LIST>')
|
||||||
|
|
||||||
parser.set_defaults(origin = [0.0,0.0,0.0])
|
parser.set_defaults(origin = [0.0,0.0,0.0])
|
||||||
parser.set_defaults(microstructure = 0)
|
parser.set_defaults(microstructure = 0)
|
||||||
|
@ -154,11 +154,8 @@ for file in files:
|
||||||
|
|
||||||
#--- do work ------------------------------------------------------------------------------------
|
#--- do work ------------------------------------------------------------------------------------
|
||||||
substituted = numpy.copy(microstructure)
|
substituted = numpy.copy(microstructure)
|
||||||
for k, v in sub.iteritems(): substituted[microstructure==k] = v # substitute microstructure indices
|
for k, v in sub.iteritems(): substituted[microstructure==k] = v # substitute microstructure indices
|
||||||
|
|
||||||
# for i in xrange(N):
|
|
||||||
# if microstructure[i] in sub: microstructure[i] = sub[microstructure[i]] # substitute microstructure indices
|
|
||||||
|
|
||||||
substituted += options.microstructure # shift microstructure indices
|
substituted += options.microstructure # shift microstructure indices
|
||||||
|
|
||||||
newInfo['origin'] = info['origin'] + options.origin
|
newInfo['origin'] = info['origin'] + options.origin
|
||||||
|
@ -174,7 +171,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
||||||
|
|
|
@ -143,7 +143,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %e\ty %e\tz %e"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %e\ty %e\tz %e"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %e\ty %e\tz %e"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %e\ty %e\tz %e"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
|
@ -54,9 +54,9 @@ i.e. within the region close to a grain/phase boundary.
|
||||||
""" + string.replace(scriptID,'\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-v', '--vicinity', dest='vicinity', type='int', \
|
parser.add_option('-v', '--vicinity', dest='vicinity', type='int', metavar='int', \
|
||||||
help='voxel distance checked for presence of other microstructure [%default]')
|
help='voxel distance checked for presence of other microstructure [%default]')
|
||||||
parser.add_option('-m', '--microstructureoffset', dest='offset', type='int', \
|
parser.add_option('-m', '--microstructureoffset', dest='offset', type='int', metavar='int', \
|
||||||
help='offset (positive or negative) for tagged microstructure. '+
|
help='offset (positive or negative) for tagged microstructure. '+
|
||||||
'"0" selects maximum microstructure index [%default]')
|
'"0" selects maximum microstructure index [%default]')
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
scriptID,
|
scriptID + ' ' + ' '.join(sys.argv[1:]),
|
||||||
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(info['grid'][0],info['grid'][1],info['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(info['size'][0],info['size'][1],info['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(info['origin'][0],info['origin'][1],info['origin'][2],),
|
||||||
|
|
Loading…
Reference in New Issue