Merge branch '26_autodoc-2' into development

This commit is contained in:
Martin Diehl 2019-02-17 18:51:14 +01:00
commit d2a9f55aaa
50 changed files with 125 additions and 131 deletions

View File

@ -482,24 +482,40 @@ AbaqusStd:
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT abaqus
only: except:
- development - master
- release
Marc: Marc:
stage: createDocumentation stage: createDocumentation
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc
only: except:
- development - master
- release
Spectral: Spectral:
stage: createDocumentation stage: createDocumentation
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral
only: except:
- development - master
- release
Processing:
stage: createDocumentation
script:
- cd $DAMASKROOT/processing/pre
- rm 3DRVEfrom2Dang.py abq_addUserOutput.py marc_addUserOutput.py
- $DAMASKROOT/PRIVATE/documenting/scriptHelpToWiki.py --debug *.py
- cd $DAMASKROOT/processing/post
- rm marc_to_vtk.py vtk2ang.py
- $DAMASKROOT/PRIVATE/documenting/scriptHelpToWiki.py --debug *.py
except:
- master
- release
################################################################################################## ##################################################################################################
backupData: backupData:

@ -1 +1 @@
Subproject commit 18ba1ba6a5e9ba446dc9311acf2acf2781614db1 Subproject commit ddb0dae72af9012cca45d9fa5665da41815e88f7

View File

@ -14,19 +14,14 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Transform X,Y,Z,F APS BeamLine 34 coordinates to x,y,z APS strain coordinates. Transform X,Y,Z,F APS BeamLine 34 coordinates to x,y,z APS strain coordinates.
""", version = scriptID) """, version = scriptID)
parser.add_option('-f', parser.add_option('-f','--frame',dest='frame', metavar='string',
'--frame', help='label of APS X,Y,Z coords')
dest='frame', parser.add_option('--depth', dest='depth', metavar='string',
metavar='string',
help='APS X,Y,Z coords')
parser.add_option('--depth',
dest='depth',
metavar='string',
help='depth') help='depth')
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()

View File

@ -18,7 +18,7 @@ def listify(x):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add or alter column(s) with derived values according to user-defined arithmetic operation between column(s). Add or alter column(s) with derived values according to user-defined arithmetic operation between column(s).
Column labels are tagged by '#label#' in formulas. Use ';' for ',' in functions. Column labels are tagged by '#label#' in formulas. Use ';' for ',' in functions.
Numpy is available as 'np'. Numpy is available as 'np'.
@ -41,10 +41,7 @@ parser.add_option('-f','--formula',
parser.add_option('-c','--condition', parser.add_option('-c','--condition',
dest = 'condition', metavar='string', dest = 'condition', metavar='string',
help = 'condition to alter existing column data') help = 'condition to alter existing column data (optional)')
parser.set_defaults(condition = None,
)
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()

View File

@ -13,8 +13,8 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing Cauchy stress based on given column(s) of deformation gradient and first Piola--Kirchhoff stress. Add column containing Cauchy stress based on deformation gradient and first Piola--Kirchhoff stress.
""", version = scriptID) """, version = scriptID)

View File

@ -209,7 +209,7 @@ def shapeMismatch(size,F,nodes,centres):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options file[s]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing the shape and volume mismatch resulting from given deformation gradient. Add column(s) containing the shape and volume mismatch resulting from given deformation gradient.
Operates on periodic three-dimensional x,y,z-ordered data sets. Operates on periodic three-dimensional x,y,z-ordered data sets.

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add cumulative (sum of first to current row) values for given label(s). Add cumulative (sum of first to current row) values for given label(s).
""", version = scriptID) """, version = scriptID)
@ -22,12 +22,9 @@ parser.add_option('-l','--label',
action = 'extend', metavar = '<string LIST>', action = 'extend', metavar = '<string LIST>',
help = 'columns to cumulate') help = 'columns to cumulate')
parser.set_defaults(label = [],
)
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if len(options.label) == 0: if options.label is None:
parser.error('no data column(s) specified.') parser.error('no data column(s) specified.')
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------

View File

@ -49,14 +49,14 @@ def curlFFT(geomdim,field):
curl_fourier = np.einsum(einsums[n],e,k_s,field_fourier)*TWOPIIMG curl_fourier = np.einsum(einsums[n],e,k_s,field_fourier)*TWOPIIMG
return np.fft.irfftn(curl_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,n]) return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing curl of requested column(s). Add column(s) containing curl of requested column(s).
Operates on periodic ordered three-dimensional data sets Operates on periodic ordered three-dimensional data sets
of vector and tensor fields. of vector and tensor fields.

View File

@ -34,7 +34,7 @@ def derivative(coordinates,what):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing numerical derivative of requested column(s) with respect to given coordinates. Add column(s) containing numerical derivative of requested column(s) with respect to given coordinates.
""", version = scriptID) """, version = scriptID)

View File

@ -20,7 +20,7 @@ def determinant(m):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing determinant of requested tensor column(s). Add column(s) containing determinant of requested tensor column(s).
""", version = scriptID) """, version = scriptID)

View File

@ -23,7 +23,7 @@ def deviator(m,spherical = False):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(2)]', description = """
Add column(s) containing deviator of requested tensor column(s). Add column(s) containing deviator of requested tensor column(s).
""", version = scriptID) """, version = scriptID)

View File

@ -87,7 +87,7 @@ def displacementFluctFFT(F,grid,size,nodal=False,transformed=False):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options] [ASCIItable(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add displacments resulting from deformation gradient field. Add displacments resulting from deformation gradient field.
Operates on periodic three-dimensional x,y,z-ordered data sets. Operates on periodic three-dimensional x,y,z-ordered data sets.
Outputs at cell centers or cell nodes (into separate file). Outputs at cell centers or cell nodes (into separate file).
@ -111,7 +111,6 @@ parser.add_option('--nodal',
parser.set_defaults(defgrad = 'f', parser.set_defaults(defgrad = 'f',
pos = 'pos', pos = 'pos',
nodal = False,
) )
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()

View File

@ -45,7 +45,7 @@ def divFFT(geomdim,field):
div_fourier = np.einsum(einsums[n],k_s,field_fourier)*TWOPIIMG div_fourier = np.einsum(einsums[n],k_s,field_fourier)*TWOPIIMG
return np.fft.irfftn(div_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,n//3]) return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n//3])
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -30,7 +30,7 @@ def E_hkl(stiffness,vec): # stiffness = (c11,c12,c44)
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing directional stiffness based on given cubic stiffness values C11, C12, and C44 in consecutive columns. Add column(s) containing directional stiffness based on given cubic stiffness values C11, C12, and C44 in consecutive columns.
""", version = scriptID) """, version = scriptID)

View File

@ -83,7 +83,7 @@ neighborhoods = {
]) ])
} }
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing Euclidean distance to grain structural features: boundaries, triple lines, and quadruple points. Add column(s) containing Euclidean distance to grain structural features: boundaries, triple lines, and quadruple points.
""", version = scriptID) """, version = scriptID)

View File

@ -15,7 +15,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog option [ASCIItable(s)]', description = """
Add column(s) containing Gaussian filtered values of requested column(s). Add column(s) containing Gaussian filtered values of requested column(s).
Operates on periodic and non-periodic ordered three-dimensional data sets. Operates on periodic and non-periodic ordered three-dimensional data sets.
For details see scipy.ndimage documentation. For details see scipy.ndimage documentation.
@ -34,12 +34,12 @@ parser.add_option('-o','--order',
dest = 'order', dest = 'order',
type = int, type = int,
metavar = 'int', metavar = 'int',
help = 'order of the filter') help = 'order of the filter [%default]')
parser.add_option('--sigma', parser.add_option('--sigma',
dest = 'sigma', dest = 'sigma',
type = float, type = float,
metavar = 'float', metavar = 'float',
help = 'standard deviation') help = 'standard deviation [%default]')
parser.add_option('--periodic', parser.add_option('--periodic',
dest = 'periodic', dest = 'periodic',
action = 'store_true', action = 'store_true',
@ -50,7 +50,6 @@ parser.add_option('--periodic',
parser.set_defaults(pos = 'pos', parser.set_defaults(pos = 'pos',
order = 0, order = 0,
sigma = 1, sigma = 1,
periodic = False,
) )
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()

View File

@ -45,14 +45,14 @@ def gradFFT(geomdim,field):
k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16')
grad_fourier = np.einsum(einsums[n],field_fourier,k_s)*TWOPIIMG grad_fourier = np.einsum(einsums[n],field_fourier,k_s)*TWOPIIMG
return np.fft.irfftn(grad_fourier,s=shapeFFT,axes=(0,1,2)).reshape([N,3*n]) return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog option [ASCIItable(s)]', description = """
Add column(s) containing gradient of requested column(s). Add column(s) containing gradient of requested column(s).
Operates on periodic ordered three-dimensional data sets Operates on periodic ordered three-dimensional data sets
of vector and scalar fields. of vector and scalar fields.

View File

@ -28,9 +28,9 @@ parser.add_option('-d',
help = 'disorientation threshold in degrees [%default]') help = 'disorientation threshold in degrees [%default]')
parser.add_option('-s', parser.add_option('-s',
'--symmetry', '--symmetry',
dest = 'symmetry', dest = 'symmetry', type = 'choice', choices = damask.Symmetry.lattices[1:],
metavar = 'string', metavar = 'string',
help = 'crystal symmetry [%default]') help = 'crystal symmetry [%default] {{{}}} '.format(', '.join(damask.Symmetry.lattices[1:])))
parser.add_option('-o', parser.add_option('-o',
'--orientation', '--orientation',
dest = 'quaternion', dest = 'quaternion',
@ -49,7 +49,7 @@ parser.add_option('--quiet',
parser.set_defaults(disorientation = 5, parser.set_defaults(disorientation = 5,
verbose = True, verbose = True,
quaternion = 'orientation', quaternion = 'orientation',
symmetry = 'cubic', symmetry = damask.Symmetry.lattices[-1],
pos = 'pos', pos = 'pos',
) )

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add RGB color value corresponding to TSL-OIM scheme for inverse pole figures. Add RGB color value corresponding to TSL-OIM scheme for inverse pole figures.
""", version = scriptID) """, version = scriptID)

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add data in column(s) of mapped ASCIItable selected from the row indexed by the value in a mapping column. Add data in column(s) of mapped ASCIItable selected from the row indexed by the value in a mapping column.
Row numbers start at 1. Row numbers start at 1.

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options file[s]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add info lines to ASCIItable header. Add info lines to ASCIItable header.
""", version = scriptID) """, version = scriptID)
@ -23,11 +23,12 @@ parser.add_option('-i',
dest = 'info', action = 'extend', metavar = '<string LIST>', dest = 'info', action = 'extend', metavar = '<string LIST>',
help = 'items to add') help = 'items to add')
parser.set_defaults(info = [],
)
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if options.info is None:
parser.error('no info specified.')
# --- loop over input files ------------------------------------------------------------------------ # --- loop over input files ------------------------------------------------------------------------
if filenames == []: filenames = [None] if filenames == []: filenames = [None]

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add data of selected column(s) from (first) row of linked ASCIItable that shares the linking column value. Add data of selected column(s) from (first) row of linked ASCIItable that shares the linking column value.
""", version = scriptID) """, version = scriptID)

View File

@ -24,7 +24,7 @@ def Mises(what,tensor):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add vonMises equivalent values for symmetric part of requested strains and/or stresses. Add vonMises equivalent values for symmetric part of requested strains and/or stresses.
""", version = scriptID) """, version = scriptID)
@ -38,13 +38,9 @@ parser.add_option('-s','--stress',
action = 'extend', metavar = '<string LIST>', action = 'extend', metavar = '<string LIST>',
help = 'heading(s) of columns containing stress tensors') help = 'heading(s) of columns containing stress tensors')
parser.set_defaults(strain = [],
stress = [],
)
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if len(options.stress+options.strain) == 0: if options.stress is None and options.strain is None:
parser.error('no data column specified...') parser.error('no data column specified...')
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------

View File

@ -9,6 +9,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# definition of element-wise p-norms for matrices # definition of element-wise p-norms for matrices
# ToDo: better use numpy.linalg.norm
def norm(which,object): def norm(which,object):
@ -18,12 +19,14 @@ def norm(which,object):
return math.sqrt(sum([x*x for x in object])) return math.sqrt(sum([x*x for x in object]))
elif which == 'Max': # p = inf elif which == 'Max': # p = inf
return max(map(abs, object)) return max(map(abs, object))
else:
return -1
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing norm of requested column(s) being either vectors or tensors. Add column(s) containing norm of requested column(s) being either vectors or tensors.
""", version = scriptID) """, version = scriptID)
@ -43,6 +46,8 @@ parser.set_defaults(norm = 'frobenius',
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if options.norm.lower() not in normChoices:
parser.error('invalid norm ({}) specified.'.format(options.norm))
if options.label is None: if options.label is None:
parser.error('no data column specified.') parser.error('no data column specified.')

View File

@ -38,7 +38,7 @@ def check_matrix(M):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add quaternion and/or Bunge Euler angle representation of crystal lattice orientation. Add quaternion and/or Bunge Euler angle representation of crystal lattice orientation.
Orientation is given by quaternion, Euler angles, rotation matrix, or crystal frame coordinates Orientation is given by quaternion, Euler angles, rotation matrix, or crystal frame coordinates
(i.e. component vectors of rotation matrix). (i.e. component vectors of rotation matrix).
@ -68,12 +68,12 @@ parser.add_option('-R',
'--labrotation', '--labrotation',
dest='labrotation', dest='labrotation',
type = 'float', nargs = 4, metavar = ' '.join(['float']*4), type = 'float', nargs = 4, metavar = ' '.join(['float']*4),
help = 'angle and axis of additional lab frame rotation') help = 'angle and axis of additional lab frame rotation [%default]')
parser.add_option('-r', parser.add_option('-r',
'--crystalrotation', '--crystalrotation',
dest='crystalrotation', dest='crystalrotation',
type = 'float', nargs = 4, metavar = ' '.join(['float']*4), type = 'float', nargs = 4, metavar = ' '.join(['float']*4),
help = 'angle and axis of additional crystal frame rotation') help = 'angle and axis of additional crystal frame rotation [%default]')
parser.add_option('--eulers', parser.add_option('--eulers',
dest = 'eulers', dest = 'eulers',
metavar = 'string', metavar = 'string',
@ -106,7 +106,6 @@ parser.add_option('-z',
parser.set_defaults(output = [], parser.set_defaults(output = [],
labrotation = (0.,1.,1.,1.), # no rotation about 1,1,1 labrotation = (0.,1.,1.,1.), # no rotation about 1,1,1
crystalrotation = (0.,1.,1.,1.), # no rotation about 1,1,1 crystalrotation = (0.,1.,1.,1.), # no rotation about 1,1,1
degrees = False,
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing Second Piola--Kirchhoff stress based on given column(s) of deformation Add column(s) containing Second Piola--Kirchhoff stress based on given column(s) of deformation
gradient and first Piola--Kirchhoff stress. gradient and first Piola--Kirchhoff stress.

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add coordinates of stereographic projection of given direction (pole) in crystal frame. Add coordinates of stereographic projection of given direction (pole) in crystal frame.
""", version = scriptID) """, version = scriptID)
@ -35,7 +35,6 @@ parser.add_option('-o',
parser.set_defaults(pole = (1.0,0.0,0.0), parser.set_defaults(pole = (1.0,0.0,0.0),
quaternion = 'orientation', quaternion = 'orientation',
polar = False,
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()

View File

@ -103,7 +103,7 @@ slipSystems = {
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add columns listing Schmid factors (and optional trace vector of selected system) for given Euler angles. Add columns listing Schmid factors (and optional trace vector of selected system) for given Euler angles.
""", version = scriptID) """, version = scriptID)
@ -115,7 +115,7 @@ parser.add_option('-l',
help = 'type of lattice structure [%default] {}'.format(latticeChoices)) help = 'type of lattice structure [%default] {}'.format(latticeChoices))
parser.add_option('--covera', parser.add_option('--covera',
dest = 'CoverA', type = 'float', metavar = 'float', dest = 'CoverA', type = 'float', metavar = 'float',
help = 'C over A ratio for hexagonal systems') help = 'C over A ratio for hexagonal systems [%default]')
parser.add_option('-f', parser.add_option('-f',
'--force', '--force',
dest = 'force', dest = 'force',

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing eigenvalues and eigenvectors of requested symmetric tensor column(s). Add column(s) containing eigenvalues and eigenvectors of requested symmetric tensor column(s).
""", version = scriptID) """, version = scriptID)

View File

@ -25,7 +25,7 @@ def operator(stretch,strain,eigenvalues):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Add column(s) containing given strains based on given stretches of requested deformation gradient column(s). Add column(s) containing given strains based on given stretches of requested deformation gradient column(s).
""", version = scriptID) """, version = scriptID)
@ -56,16 +56,15 @@ parser.add_option('-f','--defgrad',
metavar = '<string LIST>', metavar = '<string LIST>',
help = 'heading(s) of columns containing deformation tensor values [%default]') help = 'heading(s) of columns containing deformation tensor values [%default]')
parser.set_defaults(right = False, parser.set_defaults(
left = False,
logarithmic = False,
biot = False,
green = False,
defgrad = ['f'], defgrad = ['f'],
) )
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if len(options.defgrad) > 1:
options.defgrad = options.defgrad[1:]
stretches = [] stretches = []
strains = [] strains = []

View File

@ -12,7 +12,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Append data of ASCIItable(s). Append data of ASCIItable(s).
""", version = scriptID) """, version = scriptID)
@ -24,6 +24,10 @@ parser.add_option('-a', '--add','--table',
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if options.table is None:
parser.error('no table specified.')
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = [None] if filenames == []: filenames = [None]

View File

@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Average each data block of size 'packing' into single values thus reducing the former grid to grid/packing. Average each data block of size 'packing' into single values thus reducing the former grid to grid/packing.
""", version = scriptID) """, version = scriptID)
@ -34,16 +34,14 @@ parser.add_option('--shift',
parser.add_option('-g', '--grid', parser.add_option('-g', '--grid',
dest = 'grid', dest = 'grid',
type = 'int', nargs = 3, metavar = 'int int int', type = 'int', nargs = 3, metavar = 'int int int',
help = 'grid in x,y,z [autodetect]') help = 'grid in x,y,z (optional)')
parser.add_option('-s', '--size', parser.add_option('-s', '--size',
dest = 'size', dest = 'size',
type = 'float', nargs = 3, metavar = 'float float float', type = 'float', nargs = 3, metavar = 'float float float',
help = 'size in x,y,z [autodetect]') help = 'size in x,y,z (optional)')
parser.set_defaults(pos = 'pos', parser.set_defaults(pos = 'pos',
packing = (2,2,2), packing = (2,2,2),
shift = (0,0,0), shift = (0,0,0),
grid = (0,0,0),
size = (0.0,0.0,0.0),
) )
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
@ -92,7 +90,7 @@ for name in filenames:
table.data_readArray() table.data_readArray()
if (any(options.grid) == 0 or any(options.size) == 0.0): if (options.grid is None or options.size is None):
grid,size = damask.util.coordGridAndSize(table.data[:,table.label_indexrange(options.pos)]) grid,size = damask.util.coordGridAndSize(table.data[:,table.label_indexrange(options.pos)])
else: else:
grid = np.array(options.grid,'i') grid = np.array(options.grid,'i')

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Produces a binned grid of two columns from an ASCIItable, i.e. a two-dimensional probability density map. Produces a binned grid of two columns from an ASCIItable, i.e. a two-dimensional probability density map.
""", version = scriptID) """, version = scriptID)
@ -37,15 +37,15 @@ parser.add_option('-t','--type',
parser.add_option('-x','--xrange', parser.add_option('-x','--xrange',
dest = 'xrange', dest = 'xrange',
type = 'float', nargs = 2, metavar = 'float float', type = 'float', nargs = 2, metavar = 'float float',
help = 'min max value in x direction [autodetect]') help = 'min max limits in x direction (optional)')
parser.add_option('-y','--yrange', parser.add_option('-y','--yrange',
dest = 'yrange', dest = 'yrange',
type = 'float', nargs = 2, metavar = 'float float', type = 'float', nargs = 2, metavar = 'float float',
help = 'min max value in y direction [autodetect]') help = 'min max limits in y direction (optional)')
parser.add_option('-z','--zrange', parser.add_option('-z','--zrange',
dest = 'zrange', dest = 'zrange',
type = 'float', nargs = 2, metavar = 'float float', type = 'float', nargs = 2, metavar = 'float float',
help = 'min max value in z direction [autodetect]') help = 'min max limits in z direction (optional)')
parser.add_option('-i','--invert', parser.add_option('-i','--invert',
dest = 'invert', dest = 'invert',
action = 'store_true', action = 'store_true',
@ -64,9 +64,6 @@ parser.set_defaults(bins = (10,10),
xrange = (0.0,0.0), xrange = (0.0,0.0),
yrange = (0.0,0.0), yrange = (0.0,0.0),
zrange = (0.0,0.0), zrange = (0.0,0.0),
invert = False,
normRow = False,
normCol = False,
) )
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Blows up each value to a surrounding data block of size 'packing' thus increasing the former resolution Blows up each value to a surrounding data block of size 'packing' thus increasing the former resolution
to resolution*packing. to resolution*packing.
@ -27,10 +27,10 @@ parser.add_option('-p','--packing',
help = 'dimension of packed group [%default]') help = 'dimension of packed group [%default]')
parser.add_option('-g','--grid', parser.add_option('-g','--grid',
dest = 'resolution', type = 'int', nargs = 3, metavar = 'int int int', dest = 'resolution', type = 'int', nargs = 3, metavar = 'int int int',
help = 'resolution in x,y,z [autodetect]') help = 'grid in x,y,z (optional)')
parser.add_option('-s','--size', parser.add_option('-s','--size',
dest = 'dimension', type = 'float', nargs = 3, metavar = 'int int int', dest = 'dimension', type = 'float', nargs = 3, metavar = 'int int int',
help = 'dimension in x,y,z [autodetect]') help = 'size in x,y,z (optional)')
parser.set_defaults(pos = 'pos', parser.set_defaults(pos = 'pos',
packing = (2,2,2), packing = (2,2,2),
grid = (0,0,0), grid = (0,0,0),

View File

@ -30,7 +30,7 @@ def sortingList(labels,whitelistitems):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Filter rows according to condition and columns by either white or black listing. Filter rows according to condition and columns by either white or black listing.
Examples: Examples:

View File

@ -20,7 +20,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Apply a user-specified function to condense into a single row all those rows for which columns 'label' have identical values. Apply a user-specified function to condense into a single row all those rows for which columns 'label' have identical values.
Output table will contain as many rows as there are different (unique) values in the grouping column(s). Output table will contain as many rows as there are different (unique) values in the grouping column(s).
Periodic domain averaging of coordinate values is supported. Periodic domain averaging of coordinate values is supported.

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Permute all values in given column(s). Permute all values in given column(s).
""", version = scriptID) """, version = scriptID)

View File

@ -12,7 +12,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options] dfile[s]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Rename scalar, vectorial, and/or tensorial data header labels. Rename scalar, vectorial, and/or tensorial data header labels.
""", version = scriptID) """, version = scriptID)

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Rotate vector and/or tensor column data by given angle around given axis. Rotate vector and/or tensor column data by given angle around given axis.
""", version = scriptID) """, version = scriptID)
@ -29,7 +29,7 @@ parser.add_option('-r', '--rotation',
parser.add_option('--degrees', parser.add_option('--degrees',
dest = 'degrees', dest = 'degrees',
action = 'store_true', action = 'store_true',
help = 'angles are given in degrees [%default]') help = 'angles are given in degrees')
parser.set_defaults(rotation = (0.,1.,1.,1.), # no rotation about 1,1,1 parser.set_defaults(rotation = (0.,1.,1.,1.), # no rotation about 1,1,1
degrees = False, degrees = False,

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Uniformly scale column values by given factor. Uniformly scale column values by given factor.
""", version = scriptID) """, version = scriptID)

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Uniformly shift column values by given offset. Uniformly shift column values by given offset.
""", version = scriptID) """, version = scriptID)

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Sort rows by given (or all) column label(s). Sort rows by given (or all) column label(s).
Examples: Examples:

View File

@ -12,7 +12,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(usage='%prog [options] [file[s]]', description = """ parser = OptionParser(usage='%prog options [ASCIItable(s)]', description = """
Show components of given ASCIItable(s). Show components of given ASCIItable(s).
""", version = scriptID) """, version = scriptID)

View File

@ -17,7 +17,7 @@ scriptID = ' '.join([scriptName,damask.version])
msg = "Add scalars, vectors, and/or an RGB tuple from" msg = "Add scalars, vectors, and/or an RGB tuple from"
msg += "an ASCIItable to existing VTK grid (.vtr/.vtk/.vtu)." msg += "an ASCIItable to existing VTK grid (.vtr/.vtk/.vtu)."
parser = OptionParser(option_class=damask.extendableOption, parser = OptionParser(option_class=damask.extendableOption,
usage='%prog options [file[s]]', usage='%prog options [ASCIItable(s)]',
description = msg, description = msg,
version = scriptID) version = scriptID)
@ -172,8 +172,7 @@ for name in filenames:
writer.SetDataModeToBinary() writer.SetDataModeToBinary()
writer.SetCompressorTypeToZLib() writer.SetCompressorTypeToZLib()
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(rGrid) writer.SetInputData(rGrid)
else: writer.SetInputData(rGrid)
writer.Write() writer.Write()
# ------------------------------------------ render result --------------------------------------- # ------------------------------------------ render result ---------------------------------------

View File

@ -15,7 +15,7 @@ scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, parser = OptionParser(option_class=damask.extendableOption,
usage='%prog options [file[s]]', usage='%prog options [ASCIItable(s)]',
description = """Add scalar and RGB tuples from ASCIItable to existing VTK point cloud (.vtp).""", description = """Add scalar and RGB tuples from ASCIItable to existing VTK point cloud (.vtp).""",
version = scriptID) version = scriptID)
@ -46,8 +46,6 @@ parser.add_option('-c', '--color', dest='color', action='extend',
parser.set_defaults(data = [], parser.set_defaults(data = [],
tensor = [], tensor = [],
color = [], color = [],
inplace = False,
render = False,
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()
@ -151,14 +149,12 @@ for name in filenames:
# ------------------------------------------ output result --------------------------------------- # ------------------------------------------ output result ---------------------------------------
Polydata.Modified() Polydata.Modified()
if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update()
writer = vtk.vtkXMLPolyDataWriter() writer = vtk.vtkXMLPolyDataWriter()
writer.SetDataModeToBinary() writer.SetDataModeToBinary()
writer.SetCompressorTypeToZLib() writer.SetCompressorTypeToZLib()
writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtp' if options.inplace else '_added.vtp')) writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtp' if options.inplace else '_added.vtp'))
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata) writer.SetInputData(Polydata)
else: writer.SetInputData(Polydata)
writer.Write() writer.Write()
# ------------------------------------------ render result --------------------------------------- # ------------------------------------------ render result ---------------------------------------

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Produce a VTK point cloud dataset based on coordinates given in an ASCIItable. Produce a VTK point cloud dataset based on coordinates given in an ASCIItable.
""", version = scriptID) """, version = scriptID)
@ -78,7 +78,6 @@ for name in filenames:
Polydata.SetPoints(Points) Polydata.SetPoints(Points)
Polydata.SetVerts(Vertices) Polydata.SetVerts(Vertices)
Polydata.Modified() Polydata.Modified()
if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update()
# ------------------------------------------ output result --------------------------------------- # ------------------------------------------ output result ---------------------------------------
@ -94,8 +93,8 @@ for name in filenames:
writer.SetHeader('# powered by '+scriptID) writer.SetHeader('# powered by '+scriptID)
writer.WriteToOutputStringOn() writer.WriteToOutputStringOn()
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata)
else: writer.SetInputData(Polydata) writer.SetInputData(Polydata)
writer.Write() writer.Write()

View File

@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Create regular voxel grid from points in an ASCIItable. Create regular voxel grid from points in an ASCIItable.
""", version = scriptID) """, version = scriptID)
@ -125,8 +125,7 @@ for name in filenames:
writer.SetHeader('# powered by '+scriptID) writer.SetHeader('# powered by '+scriptID)
writer.WriteToOutputStringOn() writer.WriteToOutputStringOn()
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(rGrid) writer.SetInputData(rGrid)
else: writer.SetInputData(rGrid)
writer.Write() writer.Write()

View File

@ -25,7 +25,7 @@ mappings = {
'microstructures': lambda x: int(x), 'microstructures': lambda x: int(x),
} }
parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [geomfile(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog option [geomfile(s)]', description = """
Positions a geometric object within the (three-dimensional) canvas of a spectral geometry description. Positions a geometric object within the (three-dimensional) canvas of a spectral geometry description.
Depending on the sign of the dimension parameters, these objects can be boxes, cylinders, or ellipsoids. Depending on the sign of the dimension parameters, these objects can be boxes, cylinders, or ellipsoids.

View File

@ -18,7 +18,7 @@ def mostFrequent(arr):
# MAIN # MAIN
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [geomfile(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile(s)]', description = """
Smooth geometry by selecting most frequent microstructure index within given stencil at each location. Smooth geometry by selecting most frequent microstructure index within given stencil at each location.
""", version=scriptID) """, version=scriptID)

View File

@ -28,7 +28,7 @@ def kdtree_search(cloud, queryPoints):
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options', description = """
Distribute given number of points randomly within (a fraction of) the three-dimensional cube [0.0,0.0,0.0]--[1.0,1.0,1.0]. Distribute given number of points randomly within (a fraction of) the three-dimensional cube [0.0,0.0,0.0]--[1.0,1.0,1.0].
Reports positions with random crystal orientations in seeds file format to STDOUT. Reports positions with random crystal orientations in seeds file format to STDOUT.