structured according to family

This commit is contained in:
Martin Diehl 2021-08-04 16:06:28 +02:00
parent 96767e75a3
commit bb5db3e79c
2 changed files with 170 additions and 165 deletions

View File

@ -340,178 +340,183 @@ class Crystal():
""" """
_kinematics = { _kinematics = {
'cF': { 'cF': {
'slip' : np.array([ 'slip' :[np.array([
[+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],
[+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],
[+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],
[+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,+0], np.array([
[+1,-1,+0, +1,+1,+0], [+1,+1,+0, +1,-1,+0],
[+1,+0,+1, +1,+0,-1], [+1,-1,+0, +1,+1,+0],
[+1,+0,-1, +1,+0,+1], [+1,+0,+1, +1,+0,-1],
[+0,+1,+1, +0,+1,-1], [+1,+0,-1, +1,+0,+1],
[+0,+1,-1, +0,+1,+1], [+0,+1,+1, +0,+1,-1],
],dtype=float), [+0,+1,-1, +0,+1,+1]])],
'twin' : np.array([ 'twin' :[np.array([
[-2, 1, 1, 1, 1, 1], [-2, 1, 1, 1, 1, 1],
[ 1,-2, 1, 1, 1, 1], [ 1,-2, 1, 1, 1, 1],
[ 1, 1,-2, 1, 1, 1], [ 1, 1,-2, 1, 1, 1],
[ 2,-1, 1, -1,-1, 1], [ 2,-1, 1, -1,-1, 1],
[-1, 2, 1, -1,-1, 1], [-1, 2, 1, -1,-1, 1],
[-1,-1,-2, -1,-1, 1], [-1,-1,-2, -1,-1, 1],
[-2,-1,-1, 1,-1,-1], [-2,-1,-1, 1,-1,-1],
[ 1, 2,-1, 1,-1,-1], [ 1, 2,-1, 1,-1,-1],
[ 1,-1, 2, 1,-1,-1], [ 1,-1, 2, 1,-1,-1],
[ 2, 1,-1, -1, 1,-1], [ 2, 1,-1, -1, 1,-1],
[-1,-2,-1, -1, 1,-1], [-1,-2,-1, -1, 1,-1],
[-1, 1, 2, -1, 1,-1], [-1, 1, 2, -1, 1,-1]])]
],dtype=float),
}, },
'cI': { 'cI': {
'slip' : np.array([ 'slip' :[np.array([
[+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, +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,+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, +2,+1,+1], np.array([
[+1,+1,+1, -2,+1,+1], [-1,+1,+1, +2,+1,+1],
[+1,+1,-1, +2,-1,+1], [+1,+1,+1, -2,+1,+1],
[+1,-1,+1, +2,+1,-1], [+1,+1,-1, +2,-1,+1],
[+1,-1,+1, +1,+2,+1], [+1,-1,+1, +2,+1,-1],
[+1,+1,-1, -1,+2,+1], [+1,-1,+1, +1,+2,+1],
[+1,+1,+1, +1,-2,+1], [+1,+1,-1, -1,+2,+1],
[-1,+1,+1, +1,+2,-1], [+1,+1,+1, +1,-2,+1],
[+1,+1,-1, +1,+1,+2], [-1,+1,+1, +1,+2,-1],
[+1,-1,+1, -1,+1,+2], [+1,+1,-1, +1,+1,+2],
[-1,+1,+1, +1,-1,+2], [+1,-1,+1, -1,+1,+2],
[+1,+1,+1, +1,+1,-2], [-1,+1,+1, +1,-1,+2],
[+1,+1,-1, +1,+2,+3], [+1,+1,+1, +1,+1,-2]]),
[+1,-1,+1, -1,+2,+3], np.array([
[-1,+1,+1, +1,-2,+3], [+1,+1,-1, +1,+2,+3],
[+1,+1,+1, +1,+2,-3], [+1,-1,+1, -1,+2,+3],
[+1,-1,+1, +1,+3,+2], [-1,+1,+1, +1,-2,+3],
[+1,+1,-1, -1,+3,+2], [+1,+1,+1, +1,+2,-3],
[+1,+1,+1, +1,-3,+2], [+1,-1,+1, +1,+3,+2],
[-1,+1,+1, +1,+3,-2], [+1,+1,-1, -1,+3,+2],
[+1,+1,-1, +2,+1,+3], [+1,+1,+1, +1,-3,+2],
[+1,-1,+1, -2,+1,+3], [-1,+1,+1, +1,+3,-2],
[-1,+1,+1, +2,-1,+3], [+1,+1,-1, +2,+1,+3],
[+1,+1,+1, +2,+1,-3], [+1,-1,+1, -2,+1,+3],
[+1,-1,+1, +2,+3,+1], [-1,+1,+1, +2,-1,+3],
[+1,+1,-1, -2,+3,+1], [+1,+1,+1, +2,+1,-3],
[+1,+1,+1, +2,-3,+1], [+1,-1,+1, +2,+3,+1],
[-1,+1,+1, +2,+3,-1], [+1,+1,-1, -2,+3,+1],
[-1,+1,+1, +3,+1,+2], [+1,+1,+1, +2,-3,+1],
[+1,+1,+1, -3,+1,+2], [-1,+1,+1, +2,+3,-1],
[+1,+1,-1, +3,-1,+2], [-1,+1,+1, +3,+1,+2],
[+1,-1,+1, +3,+1,-2], [+1,+1,+1, -3,+1,+2],
[-1,+1,+1, +3,+2,+1], [+1,+1,-1, +3,-1,+2],
[+1,+1,+1, -3,+2,+1], [+1,-1,+1, +3,+1,-2],
[+1,+1,-1, +3,-2,+1], [-1,+1,+1, +3,+2,+1],
[+1,-1,+1, +3,+2,-1], [+1,+1,+1, -3,+2,+1],
],dtype=float), [+1,+1,-1, +3,-2,+1],
'twin' : np.array([ [+1,-1,+1, +3,+2,-1]])],
[-1, 1, 1, 2, 1, 1], 'twin' :[np.array([
[ 1, 1, 1, -2, 1, 1], [-1, 1, 1, 2, 1, 1],
[ 1, 1,-1, 2,-1, 1], [ 1, 1, 1, -2, 1, 1],
[ 1,-1, 1, 2, 1,-1], [ 1, 1,-1, 2,-1, 1],
[ 1,-1, 1, 1, 2, 1], [ 1,-1, 1, 2, 1,-1],
[ 1, 1,-1, -1, 2, 1], [ 1,-1, 1, 1, 2, 1],
[ 1, 1, 1, 1,-2, 1], [ 1, 1,-1, -1, 2, 1],
[-1, 1, 1, 1, 2,-1], [ 1, 1, 1, 1,-2, 1],
[ 1, 1,-1, 1, 1, 2], [-1, 1, 1, 1, 2,-1],
[ 1,-1, 1, -1, 1, 2], [ 1, 1,-1, 1, 1, 2],
[-1, 1, 1, 1,-1, 2], [ 1,-1, 1, -1, 1, 2],
[ 1, 1, 1, 1, 1,-2], [-1, 1, 1, 1,-1, 2],
],dtype=float), [ 1, 1, 1, 1, 1,-2]])]
}, },
'hP': { 'hP': {
'slip' : np.array([ 'slip' :[np.array([
[+2,-1,-1,+0, +0,+0,+0,+1], [+2,-1,-1,+0, +0,+0,+0,+1],
[-1,+2,-1,+0, +0,+0,+0,+1], [-1,+2,-1,+0, +0,+0,+0,+1],
[-1,-1,+2,+0, +0,+0,+0,+1], [-1,-1,+2,+0, +0,+0,+0,+1]]),
[+2,-1,-1,+0, +0,+1,-1,+0], np.array([
[-1,+2,-1,+0, -1,+0,+1,+0], [+2,-1,-1,+0, +0,+1,-1,+0],
[-1,-1,+2,+0, +1,-1,+0,+0], [-1,+2,-1,+0, -1,+0,+1,+0],
[-1,+1,+0,+0, +1,+1,-2,+0], [-1,-1,+2,+0, +1,-1,+0,+0]]),
[+0,-1,+1,+0, -2,+1,+1,+0], np.array([
[+1,+0,-1,+0, +1,-2,+1,+0], [-1,+1,+0,+0, +1,+1,-2,+0],
[-1,+2,-1,+0, +1,+0,-1,+1], [+0,-1,+1,+0, -2,+1,+1,+0],
[-2,+1,+1,+0, +0,+1,-1,+1], [+1,+0,-1,+0, +1,-2,+1,+0]]),
[-1,-1,+2,+0, -1,+1,+0,+1], np.array([
[+1,-2,+1,+0, -1,+0,+1,+1], [-1,+2,-1,+0, +1,+0,-1,+1],
[+2,-1,-1,+0, +0,-1,+1,+1], [-2,+1,+1,+0, +0,+1,-1,+1],
[+1,+1,-2,+0, +1,-1,+0,+1], [-1,-1,+2,+0, -1,+1,+0,+1],
[-2,+1,+1,+3, +1,+0,-1,+1], [+1,-2,+1,+0, -1,+0,+1,+1],
[-1,-1,+2,+3, +1,+0,-1,+1], [+2,-1,-1,+0, +0,-1,+1,+1],
[-1,-1,+2,+3, +0,+1,-1,+1], [+1,+1,-2,+0, +1,-1,+0,+1]]),
[+1,-2,+1,+3, +0,+1,-1,+1], np.array([
[+1,-2,+1,+3, -1,+1,+0,+1], [-2,+1,+1,+3, +1,+0,-1,+1],
[+2,-1,-1,+3, -1,+1,+0,+1], [-1,-1,+2,+3, +1,+0,-1,+1],
[+2,-1,-1,+3, -1,+0,+1,+1], [-1,-1,+2,+3, +0,+1,-1,+1],
[+1,+1,-2,+3, -1,+0,+1,+1], [+1,-2,+1,+3, +0,+1,-1,+1],
[+1,+1,-2,+3, +0,-1,+1,+1], [+1,-2,+1,+3, -1,+1,+0,+1],
[-1,+2,-1,+3, +0,-1,+1,+1], [+2,-1,-1,+3, -1,+1,+0,+1],
[-1,+2,-1,+3, +1,-1,+0,+1], [+2,-1,-1,+3, -1,+0,+1,+1],
[-2,+1,+1,+3, +1,-1,+0,+1], [+1,+1,-2,+3, -1,+0,+1,+1],
[-1,-1,+2,+3, +1,+1,-2,+2], [+1,+1,-2,+3, +0,-1,+1,+1],
[+1,-2,+1,+3, -1,+2,-1,+2], [-1,+2,-1,+3, +0,-1,+1,+1],
[+2,-1,-1,+3, -2,+1,+1,+2], [-1,+2,-1,+3, +1,-1,+0,+1],
[+1,+1,-2,+3, -1,-1,+2,+2], [-2,+1,+1,+3, +1,-1,+0,+1]]),
[-1,+2,-1,+3, +1,-2,+1,+2], np.array([
[-2,+1,+1,+3, +2,-1,-1,+2], [-1,-1,+2,+3, +1,+1,-2,+2],
],dtype=float), [+1,-2,+1,+3, -1,+2,-1,+2],
'twin' : np.array([ [+2,-1,-1,+3, -2,+1,+1,+2],
[-1, 0, 1, 1, 1, 0,-1, 2], # shear = (3-(c/a)^2)/(sqrt(3) c/a) <-10.1>{10.2} [+1,+1,-2,+3, -1,-1,+2,+2],
[ 0,-1, 1, 1, 0, 1,-1, 2], [-1,+2,-1,+3, +1,-2,+1,+2],
[ 1,-1, 0, 1, -1, 1, 0, 2], [-2,+1,+1,+3, +2,-1,-1,+2]])],
[ 1, 0,-1, 1, -1, 0, 1, 2], 'twin' :[np.array([
[ 0, 1,-1, 1, 0,-1, 1, 2], [-1, 0, 1, 1, 1, 0,-1, 2], # shear = (3-(c/a)^2)/(sqrt(3) c/a) <-10.1>{10.2}
[-1, 1, 0, 1, 1,-1, 0, 2], [ 0,-1, 1, 1, 0, 1,-1, 2],
[-1,-1, 2, 6, 1, 1,-2, 1], # shear = 1/(c/a) <11.6>{-1-1.1} [ 1,-1, 0, 1, -1, 1, 0, 2],
[ 1,-2, 1, 6, -1, 2,-1, 1], [ 1, 0,-1, 1, -1, 0, 1, 2],
[ 2,-1,-1, 6, -2, 1, 1, 1], [ 0, 1,-1, 1, 0,-1, 1, 2],
[ 1, 1,-2, 6, -1,-1, 2, 1], [-1, 1, 0, 1, 1,-1, 0, 2]]),
[-1, 2,-1, 6, 1,-2, 1, 1], np.array([
[-2, 1, 1, 6, 2,-1,-1, 1], [-1,-1, 2, 6, 1, 1,-2, 1], # shear = 1/(c/a) <11.6>{-1-1.1}
[ 1, 0,-1,-2, 1, 0,-1, 1], # shear = (4(c/a)^2-9)/(4 sqrt(3) c/a) <10.-2>{10.1} [ 1,-2, 1, 6, -1, 2,-1, 1],
[ 0, 1,-1,-2, 0, 1,-1, 1], [ 2,-1,-1, 6, -2, 1, 1, 1],
[-1, 1, 0,-2, -1, 1, 0, 1], [ 1, 1,-2, 6, -1,-1, 2, 1],
[-1, 0, 1,-2, -1, 0, 1, 1], [-1, 2,-1, 6, 1,-2, 1, 1],
[ 0,-1, 1,-2, 0,-1, 1, 1], [-2, 1, 1, 6, 2,-1,-1, 1]]),
[ 1,-1, 0,-2, 1,-1, 0, 1], np.array([
[ 1, 1,-2,-3, 1, 1,-2, 2], # shear = 2((c/a)^2-2)/(3 c/a) <11.-3>{11.2} [ 1, 0,-1,-2, 1, 0,-1, 1], # shear = (4(c/a)^2-9)/(4 sqrt(3) c/a) <10.-2>{10.1}
[-1, 2,-1,-3, -1, 2,-1, 2], [ 0, 1,-1,-2, 0, 1,-1, 1],
[-2, 1, 1,-3, -2, 1, 1, 2], [-1, 1, 0,-2, -1, 1, 0, 1],
[-1,-1, 2,-3, -1,-1, 2, 2], [-1, 0, 1,-2, -1, 0, 1, 1],
[ 1,-2, 1,-3, 1,-2, 1, 2], [ 0,-1, 1,-2, 0,-1, 1, 1],
[ 2,-1,-1,-3, 2,-1,-1, 2], [ 1,-1, 0,-2, 1,-1, 0, 1]]),
],dtype=float), np.array([
[ 1, 1,-2,-3, 1, 1,-2, 2], # shear = 2((c/a)^2-2)/(3 c/a) <11.-3>{11.2}
[-1, 2,-1,-3, -1, 2,-1, 2],
[-2, 1, 1,-3, -2, 1, 1, 2],
[-1,-1, 2,-3, -1,-1, 2, 2],
[ 1,-2, 1,-3, 1,-2, 1, 2],
[ 2,-1,-1,-3, 2,-1,-1, 2]])]
}, },
} }
master = _kinematics[self.lattice][mode] master = _kinematics[self.lattice][mode]
if self.lattice == 'hP': if self.lattice == 'hP':
return {'direction':util.Bravais_to_Miller(uvtw=master[:,0:4]), return {'direction':[util.Bravais_to_Miller(uvtw=m[:,0:4]) for m in master],
'plane': util.Bravais_to_Miller(hkil=master[:,4:8])} 'plane': [util.Bravais_to_Miller(hkil=m[:,4:8]) for m in master]}
else: else:
return {'direction':master[:,0:3], return {'direction':[m[:,0:3] for m in master],
'plane': master[:,3:6]} 'plane': [m[:,3:6] for m in master]}
def relation_operations(self,model): def relation_operations(self,model):

View File

@ -882,8 +882,8 @@ class Orientation(Rotation,Crystal):
[ 0.000, 0.000, 0.000]]) [ 0.000, 0.000, 0.000]])
""" """
d = self.to_frame(uvw=self.kinematics(mode)['direction']) d = self.to_frame(uvw=np.vstack(self.kinematics(mode)['direction']))
p = self.to_frame(hkl=self.kinematics(mode)['plane']) p = self.to_frame(hkl=np.vstack(self.kinematics(mode)['plane']))
P = np.einsum('...i,...j',d/np.linalg.norm(d,axis=1,keepdims=True), P = np.einsum('...i,...j',d/np.linalg.norm(d,axis=1,keepdims=True),
p/np.linalg.norm(p,axis=1,keepdims=True)) p/np.linalg.norm(p,axis=1,keepdims=True))