From 8e7f0c255bcf601ded78e290431b9d7ea080588e Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:58:04 -0400 Subject: [PATCH] fix some syntax error --- processing/post/h5_addStrainTensors.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 processing/post/h5_addStrainTensors.py diff --git a/processing/post/h5_addStrainTensors.py b/processing/post/h5_addStrainTensors.py old mode 100644 new mode 100755 index eca63e317..65f71e50c --- a/processing/post/h5_addStrainTensors.py +++ b/processing/post/h5_addStrainTensors.py @@ -32,8 +32,8 @@ def calcEPS(defgrads, stretchType, strainType): # this loop can use some performance boost # (multi-threading?) for ri in xrange(defgrads.shape[0]): - f = defgrads[ri, :, :].reshape(3, 3) - U, S, Vh = np.lingalg.svd(f) + f = defgrads[ri, :].reshape(3, 3) + U, S, Vh = np.linalg.svd(f) R = np.dot(U, Vh) # rotation of polar decomposition if stretchType == 'U': stretch = np.dot(np.linalg.inv(R), f) # F = RU @@ -94,6 +94,9 @@ parser.add_option('-2', '--green', dest='green', action='store_true', help='calculate green strain tensor') +# NOTE: +# It might be easier to just calculate one type of deformation gradient +# at a time. msg = 'heading(s) of columns containing deformation tensor values' parser.add_option('-f', '--defgrad', dest='defgrad', @@ -103,7 +106,7 @@ parser.add_option('-f', '--defgrad', parser.set_defaults(right=False, left=False, logarithmic=False, biot=False, green=False, - defgrad=['f']) + defgrad='f') (options, filenames) = parser.parse_args() @@ -134,7 +137,7 @@ for name in filenames: damask.util.report(scriptName, name) # extract defgrads from HDF5 storage - F = h5f.get_data(options.defgrads) + F = h5f.get_data(options.defgrad) # allow calculate multiple types of strain within the # same cmd call