more fixing of old .labels use

This commit is contained in:
Philip Eisenlohr 2016-05-17 11:12:26 -04:00
parent 0c1657693f
commit a8765a963d
2 changed files with 14 additions and 18 deletions

View File

@ -138,7 +138,7 @@ def principalStrs_Der(p, (s1, s2, s3, s4, s5, s6), dim, Karafillis=False):
return np.array([np.dot(dSdI[:,:,i],dIdc[:,:,i]).T for i in xrange(num)]).T return np.array([np.dot(dSdI[:,:,i],dIdc[:,:,i]).T for i in xrange(num)]).T
def invariant(sigmas): def invariant(sigmas):
I=np.zeros(3) I = np.zeros(3)
s11,s22,s33,s12,s23,s31 = sigmas s11,s22,s33,s12,s23,s31 = sigmas
I[0] = s11 + s22 + s33 I[0] = s11 + s22 + s33
I[1] = s11*s22 + s22*s33 + s33*s11 - s12**2 - s23**2 - s31**2 I[1] = s11*s22 + s22*s33 + s33*s11 - s12**2 - s23**2 - s31**2
@ -1271,13 +1271,12 @@ def doSim(thread):
table = damask.ASCIItable(refFile,readonly=True) table = damask.ASCIItable(refFile,readonly=True)
table.head_read() table.head_read()
if options.fitting =='equivalentStrain': thresholdKey = {'equivalentStrain':'Mises(ln(V))',
thresholdKey = 'Mises(ln(V))' 'totalshear': 'totalshear',
elif options.fitting =='totalshear': }[options.fitting]
thresholdKey = 'totalshear'
for l in [thresholdKey,'1_Cauchy']: for l in [thresholdKey,'1_Cauchy']:
if l not in table.labels: damask.util.croak('%s not found'%l) if l not in table.labels(raw = True): damask.util.croak('%s not found'%l)
s.release() s.release()
table.data_readArray(['%i_Cauchy'%(i+1) for i in xrange(9)]+[thresholdKey]+['%i_ln(V)'%(i+1) for i in xrange(9)]) table.data_readArray(['%i_Cauchy'%(i+1) for i in xrange(9)]+[thresholdKey]+['%i_ln(V)'%(i+1) for i in xrange(9)])

View File

@ -29,16 +29,15 @@ parser.add_option('-a', '--add','--table',
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try: table = damask.ASCIItable(name = name,
table = damask.ASCIItable(name = name,
buffered = False) buffered = False)
except: continue except: continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
tables = [] tables = []
for addTable in options.table: for addTable in options.table:
try: try: tables.append(damask.ASCIItable(name = addTable,
tables.append(damask.ASCIItable(name = addTable,
buffered = False, buffered = False,
readonly = True) readonly = True)
) )
@ -47,15 +46,13 @@ for name in filenames:
# ------------------------------------------ read headers ------------------------------------------ # ------------------------------------------ read headers ------------------------------------------
table.head_read() table.head_read()
for addTable in tables: for addTable in tables: addTable.head_read()
addTable.head_read()
# ------------------------------------------ assemble header -------------------------------------- # ------------------------------------------ assemble header --------------------------------------
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
for addTable in tables: for addTable in tables: table.labels_append(addTable.labels(raw = True)) # extend ASCII header with new labels
table.labels_append(addTable.labels) # extend ASCII header with new labels
table.head_write() table.head_write()