geom Class was updated

This commit is contained in:
Martin Diehl 2019-05-25 11:56:06 +02:00
parent 94f85b7f33
commit c92969787a
1 changed files with 7 additions and 9 deletions

View File

@ -40,32 +40,30 @@ if not set(options.directions).issubset(validDirections):
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
damask.util.report(scriptName,name)
if name is None: if name is None:
virt_file = StringIO(''.join(sys.stdin.read())) virt_file = StringIO(''.join(sys.stdin.read()))
geom = damask.Geom.from_file(virt_file) geom = damask.Geom.from_file(virt_file)
else: else:
geom = damask.Geom.from_file(name) geom = damask.Geom.from_file(name)
damask.util.report(scriptName,name)
microstructure = geom.microstructure microstructure = geom.microstructure
if 'z' in options.directions: if 'z' in options.directions:
microstructure = np.concatenate([microstructure,microstructure[:,:,::-1]],2) microstructure = np.concatenate([microstructure,microstructure[:,:,::-1]],2) # better not double edges
geom.set_size(geom.get_size()*np.array([1,1,2])) geom.set_size(geom.get_size()*np.array([1,1,2]))
if 'y' in options.directions: if 'y' in options.directions:
microstructure = np.concatenate([microstructure,microstructure[:,::-1,:]],1) microstructure = np.concatenate([microstructure,microstructure[:,::-1,:]],1) # better not double edges
geom.set_size(geom.get_size()*np.array([1,2,1])) geom.set_size(geom.get_size()*np.array([1,2,1]))
if 'x' in options.directions: if 'x' in options.directions:
microstructure = np.concatenate([microstructure,microstructure[::-1,:,:]],0) microstructure = np.concatenate([microstructure,microstructure[::-1,:,:]],0) # better not double edges
geom.set_size(geom.get_size()*np.array([2,1,1])) geom.set_size(geom.get_size()*np.array([2,1,1]))
geom.microstructure = microstructure geom.microstructure = microstructure
geom.add_comment(scriptID + ' ' + ' '.join(sys.argv[1:])) geom.add_comment(scriptID + ' ' + ' '.join(sys.argv[1:]))
damask.util.croak('\n'.join(geom.info())) damask.util.croak(geom)
if name is None: if name is None:
sys.stdout.write(str(geom)) sys.stdout.write(str(geom.show()))
else: else:
geom.to_file(name) geom.to_file(name)