adjusted to changes in table class

This commit is contained in:
Martin Diehl 2019-12-05 13:35:06 +01:00
parent 0eddd8a5c2
commit f475d1a0d0
4 changed files with 25 additions and 26 deletions

View File

@ -47,11 +47,11 @@ for name in filenames:
grid,size = damask.util.coordGridAndSize(table.get_array(options.pos))
for label in options.labels:
field = table.get_array(label)
field = table.get(label)
shape = (3,) if np.prod(field.shape)//np.prod(grid) == 3 else (3,3) # vector or tensor
field = field.reshape(np.append(grid[::-1],shape))
table.add_array('curlFFT({})'.format(label),
damask.grid_filters.curl(size[::-1],field).reshape((-1,np.prod(shape))),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('curlFFT({})'.format(label),
damask.grid_filters.curl(size[::-1],field).reshape((-1,np.prod(shape))),
scriptID+' '+' '.join(sys.argv[1:]))
table.to_ASCII(sys.stdout if name is None else name)

View File

@ -52,23 +52,22 @@ for name in filenames:
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size = damask.util.coordGridAndSize(table.get_array(options.pos))
F = table.get_array(options.f).reshape(np.append(grid[::-1],(3,3)))
F = table.get(options.f).reshape(np.append(grid[::-1],(3,3)))
if options.nodal:
table = damask.Table(damask.grid_filters.coord0_node(grid[::-1],size[::-1]).reshape((-1,3)),
{'pos':(3,)})
table.add_array('avg({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_avg_node(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add_array('fluct({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_fluct_node(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('avg({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_avg_node(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('fluct({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_fluct_node(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.to_ASCII(sys.stdout if name is None else os.path.splitext(name)[0]+'_nodal.txt')
else:
table.add_array('avg({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_avg_cell(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add_array('fluct({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_fluct_cell(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('avg({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_avg_cell(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('fluct({}).{}'.format(options.f,options.pos),
damask.grid_filters.displacement_fluct_cell(size[::-1],F).reshape((-1,3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.to_ASCII(sys.stdout if name is None else name)

View File

@ -47,11 +47,11 @@ for name in filenames:
grid,size = damask.util.coordGridAndSize(table.get_array(options.pos))
for label in options.labels:
field = table.get_array(label)
field = table.get(label)
shape = (3,) if np.prod(field.shape)//np.prod(grid) == 3 else (3,3) # vector or tensor
field = field.reshape(np.append(grid[::-1],shape))
table.add_array('divFFT({})'.format(label),
damask.grid_filters.divergence(size[::-1],field).reshape((-1,np.prod(shape)//3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('divFFT({})'.format(label),
damask.grid_filters.divergence(size[::-1],field).reshape((-1,np.prod(shape)//3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.to_ASCII(sys.stdout if name is None else name)

View File

@ -47,11 +47,11 @@ for name in filenames:
grid,size = damask.util.coordGridAndSize(table.get_array(options.pos))
for label in options.labels:
field = table.get_array(label)
field = table.get(label)
shape = (1,) if np.prod(field.shape)//np.prod(grid) == 1 else (3,) # scalar or vector
field = field.reshape(np.append(grid[::-1],shape))
table.add_array('gradFFT({})'.format(label),
damask.grid_filters.gradient(size[::-1],field).reshape((-1,np.prod(shape)*3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.add('gradFFT({})'.format(label),
damask.grid_filters.gradient(size[::-1],field).reshape((-1,np.prod(shape)*3)),
scriptID+' '+' '.join(sys.argv[1:]))
table.to_ASCII(sys.stdout if name is None else name)