bugfixes: wrong shape, wrong conversion

This commit is contained in:
Martin Diehl 2019-02-12 09:04:35 +01:00
parent 336a80091f
commit 7da8980cc0
3 changed files with 5 additions and 5 deletions

View File

@ -212,10 +212,10 @@ for name in filenames:
outputAlive = True
while outputAlive and table.data_read(): # read next data line of ASCII table
o = damask.Orientation(quaternion = np.array(list(map(float,table.data[column:column+4]))))
o = damask.Rotation(list(map(float,table.data[column:column+4])))
table.data_append( np.abs( np.sum(slip_direction * (o.quaternion * force) ,axis=1) \
* np.sum(slip_normal * (o.quaternion * normal),axis=1)))
table.data_append( np.abs( np.sum(slip_direction * (o * force) ,axis=1) \
* np.sum(slip_normal * (o * normal),axis=1)))
outputAlive = table.data_write() # output processed line
# ------------------------------------------ output finalization -----------------------------------

View File

@ -91,7 +91,7 @@ for name in filenames:
table.data[column:column+3] = r * np.array(list(map(float,table.data[column:column+3])))
for t in active['tensor']:
column = table.label_index(t)
table.data[column:column+9] = (r * (np.array(list(map(float,table.data[column:column+9]))))).reshape((3,3))
table.data[column:column+9] = (r * np.array(list(map(float,table.data[column:column+9]))).reshape((3,3))).reshape(9)
outputAlive = table.data_write() # output processed line

View File

@ -322,7 +322,7 @@ class Rotation:
ax = angleAxis if isinstance(angleAxis, np.ndarray) else np.array(angleAxis)
if P > 0: ax[1:4] *= -1 # convert from P=1 to P=-1
if degrees: ax[0] = np.degrees(ax[0])
if degrees: ax[0] = np.radians(ax[0])
if normalise: ax[1:4] /=np.linalg.norm(ax[1:4])
if ax[0] < 0.0 or ax[0] > np.pi:
raise ValueError('Axis angle rotation angle outside of [0..π].\n'.format(ax[0]))