slip systems for tI (bct)
simple test. Not the best, but allows easy comparison with - grep NTWINSYSTEM\ = src/lattice.f90 - grep NSLIPSYSTEM\ = src/lattice.f90
This commit is contained in:
parent
4880051284
commit
100565c79b
|
@ -378,7 +378,7 @@ class Crystal():
|
|||
"""
|
||||
_kinematics = {
|
||||
'cF': {
|
||||
'slip' :[np.array([
|
||||
'slip': [np.array([
|
||||
[+0,+1,-1, +1,+1,+1],
|
||||
[-1,+0,+1, +1,+1,+1],
|
||||
[+1,-1,+0, +1,+1,+1],
|
||||
|
@ -398,7 +398,7 @@ class Crystal():
|
|||
[+1,+0,-1, +1,+0,+1],
|
||||
[+0,+1,+1, +0,+1,-1],
|
||||
[+0,+1,-1, +0,+1,+1]])],
|
||||
'twin' :[np.array([
|
||||
'twin': [np.array([
|
||||
[-2, 1, 1, 1, 1, 1],
|
||||
[ 1,-2, 1, 1, 1, 1],
|
||||
[ 1, 1,-2, 1, 1, 1],
|
||||
|
@ -413,7 +413,7 @@ class Crystal():
|
|||
[-1, 1, 2, -1, 1,-1]])]
|
||||
},
|
||||
'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],
|
||||
|
@ -464,7 +464,7 @@ class Crystal():
|
|||
[+1,+1,+1, -3,+2,+1],
|
||||
[+1,+1,-1, +3,-2,+1],
|
||||
[+1,-1,+1, +3,+2,-1]])],
|
||||
'twin' :[np.array([
|
||||
'twin': [np.array([
|
||||
[-1, 1, 1, 2, 1, 1],
|
||||
[ 1, 1, 1, -2, 1, 1],
|
||||
[ 1, 1,-1, 2,-1, 1],
|
||||
|
@ -479,7 +479,7 @@ class Crystal():
|
|||
[ 1, 1, 1, 1, 1,-2]])]
|
||||
},
|
||||
'hP': {
|
||||
'slip' :[np.array([
|
||||
'slip': [np.array([
|
||||
[+2,-1,-1,+0, +0,+0,+0,+1],
|
||||
[-1,+2,-1,+0, +0,+0,+0,+1],
|
||||
[-1,-1,+2,+0, +0,+0,+0,+1]]),
|
||||
|
@ -514,7 +514,7 @@ class Crystal():
|
|||
[+1,+1,-2,+3, -1,-1,+2,+2],
|
||||
[-1,+2,-1,+3, +1,-2,+1,+2],
|
||||
[-2,+1,+1,+3, +2,-1,-1,+2]])],
|
||||
'twin' :[np.array([
|
||||
'twin': [np.array([
|
||||
[-1, 0, 1, 1, 1, 0,-1, 2], # shear = (3-(c/a)^2)/(sqrt(3) c/a) <-10.1>{10.2}
|
||||
[ 0,-1, 1, 1, 0, 1,-1, 2],
|
||||
[ 1,-1, 0, 1, -1, 1, 0, 2],
|
||||
|
@ -543,6 +543,73 @@ class Crystal():
|
|||
[ 1,-2, 1,-3, 1,-2, 1, 2],
|
||||
[ 2,-1,-1,-3, 2,-1,-1, 2]])]
|
||||
},
|
||||
'tI': {
|
||||
'slip': [np.array([
|
||||
[+0,+0,+1, +1,+0,+0],
|
||||
[+0,+0,+1, +0,+1,+0]]),
|
||||
np.array([
|
||||
[+0,+0,+1, +1,+1,+0],
|
||||
[+0,+0,+1, -1,+1,+0]]),
|
||||
np.array([
|
||||
[+0,+1,+0, +1,+0,+0],
|
||||
[+1,+0,+0, +0,+1,+0]]),
|
||||
np.array([
|
||||
[+1,-1,+1, +1,+1,+0],
|
||||
[+1,-1,-1, +1,+1,+0],
|
||||
[-1,-1,-1, -1,+1,+0],
|
||||
[-1,-1,+1, -1,+1,+0]]),
|
||||
np.array([
|
||||
[+1,-1,+0, +1,+1,+0],
|
||||
[+1,+1,+0, +1,-1,+0]]),
|
||||
np.array([
|
||||
[+0,+1,+1, +1,+0,+0],
|
||||
[+0,-1,+1, +1,+0,+0],
|
||||
[-1,+0,+1, +0,+1,+0],
|
||||
[+1,+0,+1, +0,+1,+0]]),
|
||||
np.array([
|
||||
[+0,+1,+0, +0,+0,+1],
|
||||
[+1,+0,+0, +0,+0,+1]]),
|
||||
np.array([
|
||||
[+1,+1,+0, +0,+0,+1],
|
||||
[-1,+1,+0, +0,+0,+1]]),
|
||||
np.array([
|
||||
[+0,+1,-1, +0,+1,+1],
|
||||
[+0,-1,-1, +0,-1,+1],
|
||||
[-1,+0,-1, -1,+0,+1],
|
||||
[+1,+0,-1, +1,+0,+1]]),
|
||||
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, +1,+0,+1],
|
||||
[-1,-1,+1, +1,+0,+1],
|
||||
[+1,+1,+1, +1,+0,-1],
|
||||
[+1,-1,+1, +1,+0,-1]]),
|
||||
np.array([
|
||||
[+1,+0,+0, +0,+1,+1],
|
||||
[+1,+0,+0, +0,+1,-1],
|
||||
[+0,+1,+0, +1,+0,+1],
|
||||
[+0,+1,+0, +1,+0,-1]]),
|
||||
np.array([
|
||||
[+0,+1,-1, +2,+1,+1],
|
||||
[+0,-1,-1, +2,-1,+1],
|
||||
[+1,+0,-1, +1,+2,+1],
|
||||
[-1,+0,-1, -1,+2,+1],
|
||||
[+0,+1,-1, -2,+1,+1],
|
||||
[+0,-1,-1, -2,-1,+1],
|
||||
[-1,+0,-1, -1,-2,+1],
|
||||
[+1,+0,-1, +1,-2,+1]]),
|
||||
np.array([
|
||||
[-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, -2,+1,+1],
|
||||
[+1,-1,+1, -2,-1,+1],
|
||||
[-1,+1,+1, -1,-2,+1],
|
||||
[+1,+1,+1, +1,-2,+1]])]
|
||||
}
|
||||
}
|
||||
master = _kinematics[self.lattice][mode]
|
||||
if self.lattice == 'hP':
|
||||
|
|
|
@ -79,3 +79,23 @@ class TestCrystal:
|
|||
a=a,b=b,c=c,
|
||||
alpha=alpha,beta=beta,gamma=gamma)
|
||||
assert np.allclose(points,c.lattice_points)
|
||||
|
||||
@pytest.mark.parametrize('crystal,length',
|
||||
[(Crystal(lattice='cF'),[12,6]),
|
||||
(Crystal(lattice='cI'),[12,12,24]),
|
||||
(Crystal(lattice='hP'),[3,3,6,12,6]),
|
||||
(Crystal(lattice='tI',c=1.2),[2,2,2,4,2,4,2,2,4,8,4,8,8])
|
||||
])
|
||||
def test_N_slip(self,crystal,length):
|
||||
assert [len(s) for s in crystal.kinematics('slip')['direction']] == length
|
||||
assert [len(s) for s in crystal.kinematics('slip')['plane']] == length
|
||||
|
||||
@pytest.mark.parametrize('crystal,length',
|
||||
[(Crystal(lattice='cF'),[12]),
|
||||
(Crystal(lattice='cI'),[12]),
|
||||
(Crystal(lattice='hP'),[6,6,6,6]),
|
||||
])
|
||||
def test_N_twin(self,crystal,length):
|
||||
assert [len(s) for s in crystal.kinematics('twin')['direction']] == length
|
||||
assert [len(s) for s in crystal.kinematics('twin')['plane']] == length
|
||||
|
||||
|
|
Loading…
Reference in New Issue