no need to loop over files
will procude the same file over and over again
This commit is contained in:
parent
c5daa7e577
commit
f30eda0267
|
@ -70,12 +70,10 @@ parser.set_defaults(type = minimal_surfaces[0],
|
||||||
microstructure = (1,2),
|
microstructure = (1,2),
|
||||||
)
|
)
|
||||||
|
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filename) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if filenames == []: filenames = [None]
|
name = None if filename == [] else filename[0]
|
||||||
|
|
||||||
for name in filenames:
|
|
||||||
damask.util.report(scriptName,name)
|
damask.util.report(scriptName,name)
|
||||||
|
|
||||||
X = options.periods*2.0*np.pi*(np.arange(options.grid[0])+0.5)/options.grid[0]
|
X = options.periods*2.0*np.pi*(np.arange(options.grid[0])+0.5)/options.grid[0]
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import math
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -193,7 +192,7 @@ class Geom():
|
||||||
"""Writes to file"""
|
"""Writes to file"""
|
||||||
header = self.get_header()
|
header = self.get_header()
|
||||||
grid = self.get_grid()
|
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'
|
else '%g'
|
||||||
np.savetxt(fname,
|
np.savetxt(fname,
|
||||||
self.microstructure.reshape([grid[0],np.prod(grid[1:])],order='F').T,
|
self.microstructure.reshape([grid[0],np.prod(grid[1:])],order='F').T,
|
||||||
|
|
Loading…
Reference in New Issue