use 1_ip instead of ip.x

Old format still as fallback option to support legacy files
This commit is contained in:
Martin Diehl 2015-03-09 12:52:43 +00:00
parent 6b0a2ed5a4
commit 271c9eed8b
8 changed files with 48 additions and 34 deletions

View File

@ -58,9 +58,12 @@ for file in files:
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate data (%s.x) found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
coords = [{},{},{}]
@ -101,7 +104,7 @@ for file in files:
# ------------------------------------------ read deformation gradient field -----------------------
table.data_rewind()
F = np.array([0.0 for i in xrange(N*9)]).reshape([3,3]+list(grid))
F = np.zeros(N*9,'d').reshape([3,3]+list(grid))
idx = 0
while table.data_read():
(x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count

View File

@ -62,9 +62,12 @@ for file in files:
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate data (%s.x) found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
coords = [{},{},{}]

View File

@ -24,11 +24,8 @@ parser.add_option('-c','--coordinates', dest='coords', metavar='string',
help='column heading for coordinates [%default]')
parser.add_option('-f','--defgrad', dest='defgrad', metavar='string',
help='heading of columns containing tensor field values')
parser.add_option('-l', '--linear', dest='linearreconstruction', action='store_true',
help='use linear reconstruction of geometry [%default]')
parser.set_defaults(coords = 'ip')
parser.set_defaults(defgrad = 'f' )
parser.set_defaults(linearreconstruction = False)
(options,filenames) = parser.parse_args()
@ -55,9 +52,12 @@ for file in files:
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate data (%s.x) found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
coords = [{},{},{}]
@ -106,9 +106,6 @@ for file in files:
# ------------------------------------------ calculate coordinates ---------------------------------
Favg = damask.core.math.tensorAvg(F)
if options.linearreconstruction:
centroids = damask.core.mesh.deformedCoordsLin(size,F,Favg)
else:
centroids = damask.core.mesh.deformedCoordsFFT(size,F,Favg)
# ------------------------------------------ process data ------------------------------------------

View File

@ -78,9 +78,9 @@ for file in files:
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
try:
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords)
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
coords = [{},{},{}]

View File

@ -133,11 +133,14 @@ for file in files:
table.head_read() # read ASCII header info
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
# --------------- figure out position of labels and coordinates ------------------------------------
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate data (%s.x) found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
if options.id not in table.labels:

View File

@ -59,10 +59,12 @@ for file in files:
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
elemCol = table.labels.index('elem')
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate (%s.x) and/or elem data found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
if (any(options.grid)==0 or any(options.size)==0.0):

View File

@ -54,10 +54,13 @@ for file in files:
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
elemCol = table.labels.index('elem')
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
file['croak'].write('no coordinate (%s.x) and/or elem data found...\n'%options.coords)
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate (1_%s/%s.x) and/or elem data found...\n'%(options.coords,options.coords))
continue
if (any(options.grid)==0 or any(options.size)==0.0):

View File

@ -73,11 +73,14 @@ for file in files:
'\t' + ' '.join(sys.argv[1:]))
# --------------- figure out size and grid ---------------------------------------------------------
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data
elemCol = table.labels.index('elem') # columns containing location data
locationCol = table.labels.index('1_%s'%options.coords) # columns containing location data
except ValueError:
print 'no coordinate data or element data found...'
try:
locationCol = table.labels.index('%s.x'%options.coords) # columns containing location data (legacy naming scheme)
except ValueError:
file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.coords,options.coords))
continue
if (any(options.resolution)==0 or any(options.dimension)==0.0):