bugfixes: wrong shape, wrong conversion
This commit is contained in:
parent
336a80091f
commit
7da8980cc0
|
@ -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 -----------------------------------
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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]))
|
||||
|
|
Loading…
Reference in New Issue