bugfix + more verbose reporting
This commit is contained in:
parent
39a75c2015
commit
339b86f784
|
@ -59,7 +59,9 @@ for filename in options.filenames:
|
||||||
print('Output step {}/{}'.format(i+1,len(results.increments)))
|
print('Output step {}/{}'.format(i+1,len(results.increments)))
|
||||||
vtk_data = []
|
vtk_data = []
|
||||||
results.active['increments'] = [inc]
|
results.active['increments'] = [inc]
|
||||||
|
|
||||||
for label in options.con:
|
for label in options.con:
|
||||||
|
|
||||||
for o in results.c_output_types:
|
for o in results.c_output_types:
|
||||||
results.active['c_output_types'] = [o]
|
results.active['c_output_types'] = [o]
|
||||||
if o != 'generic':
|
if o != 'generic':
|
||||||
|
|
|
@ -99,22 +99,25 @@ class DADF5():
|
||||||
with h5py.File(self.filename,'r') as f:
|
with h5py.File(self.filename,'r') as f:
|
||||||
for i in self.active['increments']:
|
for i in self.active['increments']:
|
||||||
group_inc = 'inc{:05}'.format(i['inc'])
|
group_inc = 'inc{:05}'.format(i['inc'])
|
||||||
|
|
||||||
for c in self.active['constituents']:
|
for c in self.active['constituents']:
|
||||||
group_constituent = group_inc+'/constituent/'+c
|
group_constituent = group_inc+'/constituent/'+c
|
||||||
for t in self.active['c_output_types']:
|
for t in self.active['c_output_types']:
|
||||||
try:
|
try:
|
||||||
f[group_constituent+'/'+t+'/'+label]
|
f[group_constituent+'/'+t+'/'+label]
|
||||||
path.append(group_constituent+'/'+t+'/'+label)
|
path.append(group_constituent+'/'+t+'/'+label)
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print('unable to locate constituents dataset: '+ str(e))
|
||||||
for m in self.active['materialpoints']:
|
|
||||||
|
for m in []: #self.active['materialpoints']:
|
||||||
group_materialpoint = group_inc+'/materialpoint/'+m
|
group_materialpoint = group_inc+'/materialpoint/'+m
|
||||||
for t in self.active['m_output_types']:
|
for t in self.active['m_output_types']:
|
||||||
try:
|
try:
|
||||||
f[group_materialpoint+'/'+t+'/'+label]
|
f[group_materialpoint+'/'+t+'/'+label]
|
||||||
path.append(group_materialpoint+'/'+t+'/'+label)
|
path.append(group_materialpoint+'/'+t+'/'+label)
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print('unable to locate materialpoints dataset: '+ str(e))
|
||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,9 +139,9 @@ class DADF5():
|
||||||
a = np.array(f[pa])
|
a = np.array(f[pa])
|
||||||
if len(a.shape) == 1:
|
if len(a.shape) == 1:
|
||||||
a=a.reshape([a.shape[0],1])
|
a=a.reshape([a.shape[0],1])
|
||||||
dataset
|
dataset[p,:] = a[u,:]
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print('unable to read constituent: '+ str(e))
|
||||||
try:
|
try:
|
||||||
p = np.where(f['mapping/cellResults/materialpoint']['Name'] == str.encode(label))[0]
|
p = np.where(f['mapping/cellResults/materialpoint']['Name'] == str.encode(label))[0]
|
||||||
u = (f['mapping/cellResults/materialpoint'][p.tolist()]['Position'])
|
u = (f['mapping/cellResults/materialpoint'][p.tolist()]['Position'])
|
||||||
|
@ -146,8 +149,8 @@ class DADF5():
|
||||||
if len(a.shape) == 1:
|
if len(a.shape) == 1:
|
||||||
a=a.reshape([a.shape[0],1])
|
a=a.reshape([a.shape[0],1])
|
||||||
dataset[p,:] = a[u,:]
|
dataset[p,:] = a[u,:]
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print('unable to read materialpoint: '+ str(e))
|
||||||
|
|
||||||
return dataset
|
return dataset
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue