no need to loop over files

will procude the same file over and over again
This commit is contained in:
Martin Diehl 2019-05-30 09:31:14 +02:00
parent c5daa7e577
commit f30eda0267
3 changed files with 21 additions and 24 deletions

View File

@ -70,12 +70,10 @@ parser.set_defaults(type = minimal_surfaces[0],
microstructure = (1,2),
)
(options,filenames) = parser.parse_args()
(options,filename) = parser.parse_args()
if filenames == []: filenames = [None]
for name in filenames:
name = None if filename == [] else filename[0]
damask.util.report(scriptName,name)
X = options.periods*2.0*np.pi*(np.arange(options.grid[0])+0.5)/options.grid[0]

View File

@ -1,4 +1,3 @@
import math
from io import StringIO
import numpy as np
@ -193,7 +192,7 @@ class Geom():
"""Writes to file"""
header = self.get_header()
grid = self.get_grid()
format_string = '%{}i'.format(int(math.floor(math.log10(self.microstructure.max())+1))) if self.microstructure.dtype == int \
format_string = '%{}i'.format(1+int(np.floor(np.log10(np.nanmax(self.microstructure)-1)))) if self.microstructure.dtype == int \
else '%g'
np.savetxt(fname,
self.microstructure.reshape([grid[0],np.prod(grid[1:])],order='F').T,