From e95157f039528446acc5967138d2277b65feff54 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 25 Jul 2021 20:32:24 +0200 Subject: [PATCH] unified behavior extra dimensions (here: slip systems) are added to the left, inline with .equivalent and .related --- python/damask/_orientation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 48f3b3e46..0c730ac06 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -865,7 +865,7 @@ class Orientation(Rotation,Crystal): Returns ------- - P : numpy.ndarray of shape (...,N,3,3) + P : numpy.ndarray of shape (N,...,3,3) Schmid matrix for each of the N deformation systems. Examples @@ -887,8 +887,9 @@ class Orientation(Rotation,Crystal): P = np.einsum('...i,...j',d/np.linalg.norm(d,axis=1,keepdims=True), p/np.linalg.norm(p,axis=1,keepdims=True)) - return ~self.broadcast_to( self.shape+P.shape[:-2],mode='right') \ - @ np.broadcast_to(P,self.shape+P.shape) + shape = P.shape[0:1]+self.shape+(3,3) + return ~self.broadcast_to(shape[:-2]) \ + @ np.broadcast_to(P.reshape(util.shapeshifter(P.shape,shape)),shape) def related(self,model):