labeling vectors and values independenty in addSpectralDecomposition

This commit is contained in:
Martin Diehl 2017-08-13 02:14:34 +02:00
parent 72da494370
commit 95c0179945
2 changed files with 9 additions and 5 deletions

View File

@ -72,6 +72,7 @@ for name in filenames:
table.head_write() table.head_write()
# ------------------------------------------ process data ------------------------------------------ # ------------------------------------------ process data ------------------------------------------
outputAlive = True outputAlive = True
while outputAlive and table.data_read(): # read next data line of ASCII table while outputAlive and table.data_read(): # read next data line of ASCII table
F = np.array(map(float,table.data[column[options.defgrad]:column[options.defgrad]+9]),'d').reshape(3,3) F = np.array(map(float,table.data[column[options.defgrad]:column[options.defgrad]+9]),'d').reshape(3,3)

View File

@ -43,7 +43,8 @@ for name in filenames:
table.head_read() table.head_read()
# ------------------------------------------ sanity checks ----------------------------------------
# ------------------------------------------ assemble header 1 ------------------------------------
items = { items = {
'tensor': {'dim': 9, 'shape': [3,3], 'labels':options.tensor, 'column': []}, 'tensor': {'dim': 9, 'shape': [3,3], 'labels':options.tensor, 'column': []},
@ -57,8 +58,10 @@ for name in filenames:
if dim != data['dim']: remarks.append('column {} is not a {}...'.format(what,type)) if dim != data['dim']: remarks.append('column {} is not a {}...'.format(what,type))
else: else:
items[type]['column'].append(table.label_index(what)) items[type]['column'].append(table.label_index(what))
table.labels_append(['{}_eigval({})'.format(i+1,what) for i in range(3)]) # extend ASCII header with new labels table.labels_append(['eigval{}({})'.format(t,what) for t in ['Min','Mid','Max']])
table.labels_append(['{}_eigvec({})'.format(i+1,what) for i in range(9)]) # extend ASCII header with new labels table.labels_append(['{}_eigvec{}({})'.format(i+1,t,what) for t in ['Min','Mid','Max'] for i in range(3)])
# ------------------------------------------ sanity checks ----------------------------------------
if remarks != []: damask.util.croak(remarks) if remarks != []: damask.util.croak(remarks)
if errors != []: if errors != []:
@ -66,12 +69,12 @@ for name in filenames:
table.close(dismiss = True) table.close(dismiss = True)
continue continue
# ------------------------------------------ assemble header -------------------------------------- # ------------------------------------------ assemble header 2 ------------------------------------
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
table.head_write() table.head_write()
# ------------------------------------------ process data ------------------------------------------ # ------------------------------------------ process data -----------------------------------------
outputAlive = True outputAlive = True
while outputAlive and table.data_read(): # read next data line of ASCII table while outputAlive and table.data_read(): # read next data line of ASCII table