From 5fe65bfcc35f23bc5d5f80900e51f1b8bfad84c1 Mon Sep 17 00:00:00 2001 From: Yannick Naunheim Date: Mon, 29 Jun 2015 16:02:56 +0000 Subject: [PATCH] corrected OR models and set up simple test to check them --- lib/damask/orientation.py | 279 +++++++++++++++++++++----------------- 1 file changed, 156 insertions(+), 123 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 1c4696ba0..bde531036 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -900,8 +900,15 @@ class Orientation: def related(self, relationModel, direction, targetSymmetry = None): - if relationModel not in ['KS','GT',"GT'",'NW','Bain']: return None + if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None if int(direction) == 0: return None + + # KS from S. Morito et al./Journal of Alloys and Compounds 5775 (2013) S587-S592 + # GT from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 + # GT' from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 + # NW from H. Kitahara et al./Materials Characterization 54 (2005) 378-386 + # Pitsch from Y. He et al./Acta Materialia 53 (2005) 1179-1190 + # Bain from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 variant = int(abs(direction))-1 (me,other) = (0,1) if direction > 0 else (1,0) @@ -925,62 +932,62 @@ class Orientation: [[ -1, 1, 1],[ 0, 1, 1]],\ [[ -1, 1, 1],[ 0, 1, 1]],\ [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]]]), + [[ 1, 1, -1],[ 0, 1, 1]],\ + [[ 1, 1, -1],[ 0, 1, 1]],\ + [[ 1, 1, -1],[ 0, 1, 1]],\ + [[ 1, 1, -1],[ 0, 1, 1]],\ + [[ 1, 1, -1],[ 0, 1, 1]],\ + [[ 1, 1, -1],[ 0, 1, 1]]]), 'GT': \ - np.array([[[ 1, 1, 1],[ 1, 1, 0]],\ - [[ 1, 1, 1],[ 1, 0, 1]],\ - [[ -1, -1, 1],[ -1, -1, 0]],\ - [[ -1, -1, 1],[ -1, 0, 1]],\ - [[ -1, 1, 1],[ -1, 1, 0]],\ - [[ -1, 1, 1],[ -1, 0, 1]],\ - [[ 1, -1, 1],[ 1, -1, 0]],\ - [[ 1, -1, 1],[ 1, 0, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ + np.array([[[ 1, 1, 1],[ 1, 0, 1]],\ [[ 1, 1, 1],[ 1, 1, 0]],\ - [[ -1, -1, 1],[ 0, -1, 1]],\ - [[ -1, -1, 1],[ -1, -1, 0]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ -1, 1, 0]],\ - [[ 1, -1, 1],[ 0, -1, 1]],\ - [[ 1, -1, 1],[ 1, -1, 0]],\ - [[ 1, 1, 1],[ 1, 0, 1]],\ [[ 1, 1, 1],[ 0, 1, 1]],\ [[ -1, -1, 1],[ -1, 0, 1]],\ + [[ -1, -1, 1],[ -1, -1, 0]],\ [[ -1, -1, 1],[ 0, -1, 1]],\ [[ -1, 1, 1],[ -1, 0, 1]],\ + [[ -1, 1, 1],[ -1, 1, 0]],\ [[ -1, 1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 1, 0, 1]],\ - [[ 1, -1, 1],[ 0, -1, 1]]]), - "GT'": \ - np.array([[[ 17, 7, 17],[ 17, 12, 5]],\ - [[-17, 7,-17],[-17, 12, -5]],\ - [[-17, -7, 17],[-17,-12, 5]],\ - [[ 17, -7,-17],[ 17,-12, -5]],\ - [[ 17, 17, 7],[ 17, 5, 12]],\ - [[-17,-17, 7],[-17, -5, 12]],\ - [[ 17,-17, -7],[ 17, -5,-12]],\ - [[-17, 17, -7],[-17, 5,-12]],\ + [[ 1, -1, 1],[ 1, -1, 0]],\ + [[ 1, -1, 1],[ 0, -1, 1]],\ + [[ 1, 1, 1],[ 1, 1, 0]],\ + [[ 1, 1, 1],[ 0, 1, 1]],\ + [[ 1, 1, 1],[ 1, 0, 1]],\ + [[ -1, -1, 1],[ -1, -1, 0]],\ + [[ -1, -1, 1],[ 0, -1, 1]],\ + [[ -1, -1, 1],[ -1, 0, 1]],\ + [[ -1, 1, 1],[ -1, 1, 0]],\ + [[ -1, 1, 1],[ 0, 1, 1]],\ + [[ -1, 1, 1],[ -1, 0, 1]],\ + [[ 1, -1, 1],[ 1, -1, 0]],\ + [[ 1, -1, 1],[ 0, -1, 1]],\ + [[ 1, -1, 1],[ 1, 0, 1]]]), + 'GTdash': \ + np.array([[[ 7, 17, 17],[ 12, 5, 17]],\ + [[ 17, 7, 17],[ 17, 12, 5]],\ [[ 17, 17, 7],[ 5, 17, 12]],\ + [[ -7,-17, 17],[-12, -5, 17]],\ + [[-17, -7, 17],[-17,-12, 5]],\ [[-17,-17, 7],[ -5,-17, 12]],\ + [[ 7,-17,-17],[ 12, -5,-17]],\ + [[ 17, -7,-17],[ 17,-12, -5]],\ [[ 17,-17, -7],[ 5,-17,-12]],\ + [[ -7, 17,-17],[-12, 5,-17]],\ + [[-17, 7,-17],[-17, 12, -5]],\ [[-17, 17, -7],[ -5, 17,-12]],\ [[ 7, 17, 17],[ 12, 17, 5]],\ - [[ 7,-17,-17],[ 12,-17, -5]],\ - [[ -7,-17, 17],[-12,-17, 5]],\ - [[ -7, 17,-17],[-12, 17, -5]],\ - [[ 7, 17, 17],[ 12, 5, 17]],\ - [[ 7,-17,-17],[ 12, -5,-17]],\ - [[ -7,-17, 17],[-12, -5, 17]],\ - [[ -7, 17,-17],[-12, 5,-17]],\ [[ 17, 7, 17],[ 5, 12, 17]],\ - [[-17, 7,-17],[ -5, 12,-17]],\ + [[ 17, 17, 7],[ 17, 5, 12]],\ + [[ -7,-17, 17],[-12,-17, 5]],\ [[-17, -7, 17],[ -5,-12, 17]],\ - [[ 17, -7,-17],[ 5,-12,-17]]]), + [[-17,-17, 7],[-17, -5, 12]],\ + [[ 7,-17,-17],[ 12,-17, -5]],\ + [[ 17, -7,-17],[ 5, -12,-17]],\ + [[ 17,-17, 7],[ 17, -5,-12]],\ + [[ -7, 17,-17],[-12, 17, -5]],\ + [[-17, 7,-17],[ -5, 12,-17]],\ + [[-17, 17, -7],[-17, 5,-12]]]), 'NW': \ np.array([[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, 1],[ 0, 1, 1]],\ @@ -991,9 +998,22 @@ class Orientation: [[ 1, -1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]]]), + [[ -1, -1, 1],[ 0, 1, 1]],\ + [[ -1, -1, 1],[ 0, 1, 1]],\ + [[ -1, -1, 1],[ 0, 1, 1]]]), + 'Pitsch': \ + np.array([[[ 0, 1, 0],[ -1, 0, 1]],\ + [[ 0, 0, 1],[ 1, -1, 0]],\ + [[ 1, 0, 0],[ 0, 1, -1]],\ + [[ 1, 0, 0],[ 0, -1, -1]],\ + [[ 0, 1, 0],[ -1, 0, -1]],\ + [[ 0, 0, 1],[ -1, -1, 0]],\ + [[ 0, 1, 0],[ -1, 0, -1]],\ + [[ 0, 0, 1],[ -1, -1, 0]],\ + [[ 1, 0, 0],[ 0, -1, -1]],\ + [[ 1, 0, 0],[ 0, -1, 1]],\ + [[ 0, 1, 0],[ 1, 0, -1]],\ + [[ 0, 0, 1],[ -1, 1, 0]]]), 'Bain': \ np.array([[[ 1, 0, 0],[ 1, 0, 0]],\ [[ 0, 1, 0],[ 0, 1, 0]],\ @@ -1007,87 +1027,100 @@ class Orientation: [[ 0, 1, -1],[ -1, 1, -1]],\ [[ 1, -1, 0],[ -1, -1, 1]],\ [[ 1, -1, 0],[ -1, 1, -1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ -1, 0, 1],[ -1, 1, -1]],\ - [[ 0, 1, -1],[ -1, -1, 1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 1, -1, 0],[ -1, -1, 1]],\ - [[ 1, -1, 0],[ -1, 1, -1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ -1, 0, 1],[ -1, 1, -1]],\ - [[ 0, 1, -1],[ -1, -1, 1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 1, -1, 0],[ -1, -1, 1]],\ - [[ 1, -1, 0],[ -1, 1, -1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ -1, 0, 1],[ -1, 1, -1]],\ - [[ 0, 1, -1],[ -1, -1, 1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 1, -1, 0],[ -1, -1, 1]],\ - [[ 1, -1, 0],[ -1, 1, -1]]]), - 'GT': \ - np.array([[[ 17, -5,-12],[ 17,-17, -7]],\ - [[ 17,-12, -5],[ 17, -7,-17]],\ - [[-17, 5,-12],[-17, 17, -7]],\ - [[-17, 12, -5],[-17, 7,-17]],\ - [[ 17, 5, 12],[ 17, 17, 7]],\ - [[ 17, 12, 5],[ 17, 7, 17]],\ - [[-17, -5, 12],[-17,-17, 7]],\ - [[-17,-12, 5],[-17, -7, 17]],\ - [[-12, 17, -5],[ -7, 17,-17]],\ - [[ -5, 17,-12],[-17, 17, -7]],\ - [[ 12,-17, -5],[ 7,-17,-17]],\ - [[ 5,-17,-12],[ 17,-17, -7]],\ - [[-12,-17, 5],[ -7,-17, 17]],\ - [[ -5,-17, 12],[-17,-17, 7]],\ - [[ 12, 17, 5],[ 7, 17, 17]],\ - [[ 5, 17, 12],[ 17, 17, 7]],\ - [[ -5,-12, 17],[-17, -7, 17]],\ - [[-12, -5, 17],[ -7,-17, 17]],\ - [[ 5, 12, 17],[ 17, 7, 17]],\ - [[ 12, 5, 17],[ 7, 17, 17]],\ - [[ -5, 12,-17],[-17, 7,-17]],\ - [[-12, 5,-17],[ -7, 17,-17]],\ - [[ 5,-12,-17],[ 17, -7,-17]],\ - [[ 12, -5,-17],[ 7,-17,-17]]]), - "GT'": \ - np.array([[[ -1, 0, 1],[ -1, 1, 1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ 1, 0, 1],[ 1, -1, 1]],\ - [[ 1, 0, 1],[ 1, 1, 1]],\ - [[ -1, 1, 0],[ -1, 1, 1]],\ - [[ -1, 1, 0],[ -1, 1, -1]],\ - [[ 1, 1, 0],[ 1, 1, 1]],\ - [[ 1, 1, 0],[ 1, 1, -1]],\ - [[ 1, -1, 0],[ 1, -1, 1]],\ - [[ 1, -1, 0],[ 1, -1, -1]],\ + [[ 1, 0, -1],[ -1, -1, 1]],\ + [[ 1, 0, -1],[ -1, 1, -1]],\ [[ -1, -1, 0],[ -1, -1, 1]],\ + [[ -1, -1, 0],[ -1, 1, -1]],\ + [[ 0, 1, 1],[ -1, -1, 1]],\ + [[ 0, 1, 1],[ -1, 1, -1]],\ + [[ 0, -1, 1],[ -1, -1, 1]],\ + [[ 0, -1, 1],[ -1, 1, -1]],\ + [[ -1, 0, -1],[ -1, -1, 1]],\ + [[ -1, 0, -1],[ -1, 1, -1]],\ + [[ 1, 1, 0],[ -1, -1, 1]],\ + [[ 1, 1, 0],[ -1, 1, -1]],\ + [[ -1, 1, 0],[ -1, -1, 1]],\ + [[ -1, 1, 0],[ -1, 1, -1]],\ + [[ 0, -1, -1],[ -1, -1, 1]],\ + [[ 0, -1, -1],[ -1, 1, -1]],\ + [[ 1, 0, 1],[ -1, -1, 1]],\ + [[ 1, 0, 1],[ -1, 1, -1]]]), + 'GT': \ + np.array([[[ -5,-12, 17],[-17, -7, 17]],\ + [[ 17, -5,-12],[ 17,-17, -7]],\ + [[-12, 17, -5],[ -7, 17,-17]],\ + [[ 5, 12, 17],[ 17, 7, 17]],\ + [[-17, 5,-12],[-17, 17, -7]],\ + [[ 12,-17, -5],[ 7,-17,-17]],\ + [[ -5, 12,-17],[-17, 7,-17]],\ + [[ 17, 5, 12],[ 17, 17, 7]],\ + [[-12,-17, 5],[ -7,-17, 17]],\ + [[ 5,-12,-17],[ 17, -7,-17]],\ + [[-17, -5, 12],[-17,-17, 7]],\ + [[ 12, 17, 5],[ 7, 17, 17]],\ + [[ -5, 17,-12],[-17, 17, -7]],\ + [[-12, -5, 17],[ -7,-17, 17]],\ + [[ 17,-12, -5],[ 17, -7,-17]],\ + [[ 5,-17,-12],[ 17,-17, -7]],\ + [[ 12, 5, 17],[ 7, 17, 17]],\ + [[-17, 12, -5],[-17, 7,-17]],\ + [[ -5,-17, 12],[-17,-17, 7]],\ + [[-12, 5,-17],[ -7, 17,-17]],\ + [[ 17, 12, 5],[ 17, 7, 17]],\ + [[ 5, 17, 12],[ 17, 17, 7]],\ + [[ 12, -5,-17],[ 7,-17,-17]],\ + [[-17,-12, 5],[-17, 7, 17]]]), + 'GTdash': \ + np.array([[[ 0, 1, -1],[ 1, 1, -1]],\ + [[ -1, 0, 1],[ -1, 1, 1]],\ + [[ 1, -1, 0],[ 1, -1, 1]],\ + [[ 0, -1, -1],[ -1, -1, -1]],\ + [[ 1, 0, 1],[ 1, -1, 1]],\ + [[ 1, -1, 0],[ 1, -1, -1]],\ + [[ 0, 1, -1],[ -1, 1, -1]],\ + [[ 1, 0, 1],[ 1, 1, 1]],\ + [[ -1, -1, 0],[ -1, -1, 1]],\ + [[ 0, -1, -1],[ 1, -1, -1]],\ + [[ -1, 0, 1],[ -1, -1, 1]],\ [[ -1, -1, 0],[ -1, -1, -1]],\ [[ 0, -1, 1],[ 1, -1, 1]],\ + [[ 1, 0, -1],[ 1, 1, -1]],\ + [[ -1, 1, 0],[ -1, 1, 1]],\ + [[ 0, 1, 1],[ -1, 1, 1]],\ + [[ -1, 0, -1],[ -1, -1, -1]],\ + [[ -1, 1, 0],[ -1, 1, -1]],\ + [[ 0, -1, 1],[ -1, -1, 1]],\ + [[ -1, 0, -1],[ -1, 1, -1]],\ + [[ 1, 1, 0],[ 1, 1, 1]],\ + [[ 0, 1, 1],[ 1, 1, 1]],\ + [[ 1, 0, -1],[ 1, -1, -1]],\ + [[ 1, 1, 0],[ 1, 1, -1]]]), + 'NW': \ + np.array([[[ 2, -1, -1],[ 0, -1, 1]],\ + [[ -1, 2, -1],[ 0, -1, 1]],\ + [[ -1, -1, 2],[ 0, -1, 1]],\ + [[ -2, -1, -1],[ 0, -1, 1]],\ + [[ 1, 2, -1],[ 0, -1, 1]],\ + [[ 1, -1, 2],[ 0, -1, 1]],\ + [[ 2, 1, -1],[ 0, -1, 1]],\ + [[ -1, -2, -1],[ 0, -1, 1]],\ + [[ -1, 1, 2],[ 0, -1, 1]],\ + [[ -1, 2, 1],[ 0, -1, 1]],\ + [[ -1, 2, 1],[ 0, -1, 1]],\ + [[ -1, -1, -2],[ 0, -1, 1]]]), + 'Pitsch': \ + np.array([[[ 1, 0, 1],[ 1, -1, 1]],\ + [[ 1, 1, 0],[ 1, 1, -1]],\ + [[ 0, 1, 1],[ -1, 1, 1]],\ + [[ 0, 1, -1],[ -1, 1, -1]],\ + [[ -1, 0, 1],[ -1, -1, 1]],\ + [[ 1, -1, 0],[ 1, -1, -1]],\ + [[ 1, 0, -1],[ 1, -1, -1]],\ + [[ -1, 1, 0],[ -1, 1, -1]],\ [[ 0, -1, 1],[ -1, -1, 1]],\ [[ 0, 1, 1],[ -1, 1, 1]],\ - [[ 0, 1, 1],[ 1, 1, 1]],\ - [[ 0, 1, -1],[ 1, 1, -1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 0, -1, -1],[ -1, -1, -1]],\ - [[ 0, -1, -1],[ 1, -1, -1]],\ - [[ 1, 0, -1],[ 1, 1, -1]],\ - [[ 1, 0, -1],[ 1, -1, -1]],\ - [[ -1, 0, -1],[ -1, -1, -1]],\ - [[ -1, 0, -1],[ -1, 1, -1]]]), - 'NW': \ - np.array([[[ 1, -1, 0],[ 1, 0, 0]],\ - [[ 1, 0, -1],[ 1, 0, 0]],\ - [[ 0, -1, 1],[ 1, 0, 0]],\ - [[ 1, 1, 0],[ 1, 0, 0]],\ - [[ 0, 1, -1],[ 1, 0, 0]],\ - [[ 1, 0, 1],[ 1, 0, 0]],\ - [[ 1, 1, 0],[ 1, 0, 0]],\ - [[ 0, 1, 1],[ 1, 0, 0]],\ - [[ -1, 0, 1],[ 1, 0, 0]],\ - [[ 1, 0, 1],[ 1, 0, 0]],\ - [[ 1, -1, 0],[ 1, 0, 0]],\ - [[ 0, 1, 1],[ 1, 0, 0]]]), + [[ 1, 0, 1],[ 1, -1, 1]],\ + [[ 1, 1, 0],[ 1, 1, -1]]]), 'Bain': \ np.array([[[ 0, 1, 0],[ 0, 1, 1]], [[ 0, 0, 1],[ 1, 0, 1]], @@ -1104,7 +1137,7 @@ class Orientation: otherNormal = [float(i) for i in normals[relationModel][variant,other]] # map(float, planes[...]) does not work in python 3 otherNormal /= np.linalg.norm(otherNormal) otherMatrix = np.array([otherPlane,otherNormal,np.cross(otherPlane,otherNormal)]) - + rot=np.dot(otherMatrix.T,myMatrix) - return Orientation(matrix=np.dot(rot,self.asMatrix())) # no symmetry information ?? + return Orientation(matrix=np.dot(rot,self.asMatrix())) # no symmetry information ?? \ No newline at end of file