From 406ca39b2c12f65dd154613c693ec1cfa5545fd2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Nov 2019 21:23:43 +0100 Subject: [PATCH] ASCII table unable to handle inhomogeneous situations --- processing/post/DADF5_postResults.py | 50 ++++++++++++++-------------- processing/post/DADF5_vtk_cells.py | 1 - 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/processing/post/DADF5_postResults.py b/processing/post/DADF5_postResults.py index a16ef147c..88e4d777a 100755 --- a/processing/post/DADF5_postResults.py +++ b/processing/post/DADF5_postResults.py @@ -59,35 +59,35 @@ for filename in options.filenames: data = np.concatenate((data,coords),1) header+=' 1_pos 2_pos 3_pos' + results.set_visible('materialpoints',False) + results.set_visible('constituents', True) for label in options.con: - for p in results.iter_visible('con_physics'): - for c in results.iter_visible('constituents'): - x = results.get_dataset_location(label) - if len(x) == 0: - continue - array = results.read_dataset(x,0,plain=True) - d = int(np.product(np.shape(array)[1:])) - data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1) - - if d>1: - header+= ''.join([' {}_{}'.format(j+1,label) for j in range(d)]) - else: - header+=' '+label + x = results.get_dataset_location(label) + if len(x) == 0: + continue + array = results.read_dataset(x,0,plain=True) + d = np.product(np.shape(array)[1:]) + data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1) + if d>1: + header+= ''.join([' {}_{}'.format(j+1,label) for j in range(d)]) + else: + header+=' '+label + + results.set_visible('constituents', False) + results.set_visible('materialpoints',True) for label in options.mat: - for p in results.iter_visible('mat_physics'): - for m in results.iter_visible('materialpoints'): - x = results.get_dataset_location(label) - if len(x) == 0: - continue - array = results.read_dataset(x,0,plain=True) - d = int(np.product(np.shape(array)[1:])) - data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1) + x = results.get_dataset_location(label) + if len(x) == 0: + continue + array = results.read_dataset(x,0,plain=True) + d = np.product(np.shape(array)[1:]) + data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1) - if d>1: - header+= ''.join([' {}_{}'.format(j+1,label) for j in range(d)]) - else: - header+=' '+label + if d>1: + header+= ''.join([' {}_{}'.format(j+1,label) for j in range(d)]) + else: + header+=' '+label dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir)) if not os.path.isdir(dirname): diff --git a/processing/post/DADF5_vtk_cells.py b/processing/post/DADF5_vtk_cells.py index 1f5cc6686..9cd982e50 100755 --- a/processing/post/DADF5_vtk_cells.py +++ b/processing/post/DADF5_vtk_cells.py @@ -74,7 +74,6 @@ for filename in options.filenames: results.set_visible('materialpoints',False) results.set_visible('constituents', True) for label in options.con: - for p in results.iter_visible('con_physics'): if p != 'generic': for c in results.iter_visible('constituents'):