small fixes
This commit is contained in:
parent
0f677ac3ec
commit
27532cfa4e
|
@ -70,7 +70,7 @@ for filename in options.filenames:
|
|||
pass
|
||||
|
||||
o = h5py.File(dirname + '/' + os.path.splitext(filename)[0] \
|
||||
+ 'inc_{}.dream3D'.format(inc[3:].zfill(N_digits)),'w')
|
||||
+ '_inc_{}.dream3D'.format(inc[3:].zfill(N_digits)),'w')
|
||||
o.attrs['DADF5toDREAM3D'] = '1.0'
|
||||
o.attrs['FileVersion'] = '7.0'
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import sys
|
|||
from io import StringIO
|
||||
from optparse import OptionParser
|
||||
|
||||
import numpy as np
|
||||
|
||||
import damask
|
||||
|
||||
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import os
|
||||
import sys
|
||||
import multiprocessing
|
||||
from io import StringIO
|
||||
from optparse import OptionParser,OptionGroup
|
||||
|
||||
import numpy as np
|
||||
|
@ -15,7 +16,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
|||
scriptID = ' '.join([scriptName,damask.version])
|
||||
|
||||
|
||||
def Laguerre_tessellation(grid, seeds, weights, grains, periodic = True, cpus = 2):
|
||||
def Laguerre_tessellation(grid, seeds, grains, size, periodic, weights, cpus):
|
||||
|
||||
def findClosestSeed(fargs):
|
||||
point, seeds, myWeights = fargs
|
||||
|
@ -52,10 +53,10 @@ def Laguerre_tessellation(grid, seeds, weights, grains, periodic = True, cpus =
|
|||
[ -1, 1, 1 ],
|
||||
[ 0, 1, 1 ],
|
||||
[ 1, 1, 1 ],
|
||||
]).astype(float)*info['size'] if periodic else \
|
||||
],dtype=np.float)*size if periodic else \
|
||||
np.array([
|
||||
[ 0, 0, 0 ],
|
||||
]).astype(float)
|
||||
],dtype=np.float)
|
||||
|
||||
repeatweights = np.tile(weights,len(copies)).flatten(order='F') # Laguerre weights (1,2,3,1,2,3,...,1,2,3)
|
||||
for vec in copies: # periodic copies of seed points ...
|
||||
|
@ -237,7 +238,8 @@ for name in filenames:
|
|||
|
||||
damask.util.croak('tessellating...')
|
||||
if options.laguerre:
|
||||
indices = Laguerre_tessellation(coords,seeds,table.get(options.weight),grains,options.periodic,options.cpus)
|
||||
indices = Laguerre_tessellation(coords,seeds,grains,size,options.periodic,
|
||||
table.get(options.weight),options.cpus)
|
||||
else:
|
||||
indices = Voronoi_tessellation (coords,seeds,grains,size,options.periodic)
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
import os
|
||||
try:
|
||||
import tkinter
|
||||
except:
|
||||
tkinter = None
|
||||
|
||||
class Environment:
|
||||
|
||||
def __init__(self):
|
||||
"""Read and provide values of DAMASK configuration."""
|
||||
self.options = self._get_options()
|
||||
if tkinter:
|
||||
try:
|
||||
tk = tkinter.Tk()
|
||||
self.screen_width = tk.winfo_screenwidth()
|
||||
self.screen_height = tk.winfo_screenheight()
|
||||
tk.destroy()
|
||||
else:
|
||||
except tkinter.TclError:
|
||||
self.screen_width = 1024
|
||||
self.screen_height = 768
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ class VTK:
|
|||
Spatial origin.
|
||||
|
||||
"""
|
||||
|
||||
geom = vtk.vtkRectilinearGrid()
|
||||
geom.SetDimensions(*(grid+1))
|
||||
geom.SetXCoordinates(np_to_vtk(np.linspace(origin[0],origin[0]+size[0],grid[0]+1),deep=True))
|
||||
|
|
Loading…
Reference in New Issue