bugfix + more verbose reporting

This commit is contained in:
Martin Diehl 2019-05-16 11:44:03 +02:00
parent 39a75c2015
commit 339b86f784
3 changed files with 16 additions and 11 deletions

View File

@ -78,7 +78,7 @@ for filename in options.filenames:
else:
header+=' '+label
for label in options.mat:
for label in options.mat:
for o in results.m_output_types:
results.active['m_output_types'] = [o]
for m in results.materialpoints:

View File

@ -59,7 +59,9 @@ for filename in options.filenames:
print('Output step {}/{}'.format(i+1,len(results.increments)))
vtk_data = []
results.active['increments'] = [inc]
for label in options.con:
for o in results.c_output_types:
results.active['c_output_types'] = [o]
if o != 'generic':

View File

@ -99,22 +99,25 @@ class DADF5():
with h5py.File(self.filename,'r') as f:
for i in self.active['increments']:
group_inc = 'inc{:05}'.format(i['inc'])
for c in self.active['constituents']:
group_constituent = group_inc+'/constituent/'+c
for t in self.active['c_output_types']:
try:
f[group_constituent+'/'+t+'/'+label]
path.append(group_constituent+'/'+t+'/'+label)
except:
pass
for m in self.active['materialpoints']:
except Exception as e:
print('unable to locate constituents dataset: '+ str(e))
for m in []: #self.active['materialpoints']:
group_materialpoint = group_inc+'/materialpoint/'+m
for t in self.active['m_output_types']:
try:
f[group_materialpoint+'/'+t+'/'+label]
path.append(group_materialpoint+'/'+t+'/'+label)
except:
pass
except Exception as e:
print('unable to locate materialpoints dataset: '+ str(e))
return path
@ -136,9 +139,9 @@ class DADF5():
a = np.array(f[pa])
if len(a.shape) == 1:
a=a.reshape([a.shape[0],1])
dataset
except:
pass
dataset[p,:] = a[u,:]
except Exception as e:
print('unable to read constituent: '+ str(e))
try:
p = np.where(f['mapping/cellResults/materialpoint']['Name'] == str.encode(label))[0]
u = (f['mapping/cellResults/materialpoint'][p.tolist()]['Position'])
@ -146,8 +149,8 @@ class DADF5():
if len(a.shape) == 1:
a=a.reshape([a.shape[0],1])
dataset[p,:] = a[u,:]
except:
pass
except Exception as e:
print('unable to read materialpoint: '+ str(e))
return dataset