polishing

This commit is contained in:
Martin Diehl 2020-05-20 23:50:08 +02:00
parent 353fd3ceb6
commit 16f30a10d0
2 changed files with 5 additions and 6 deletions

View File

@ -65,8 +65,8 @@ class Orientation:
r = b*aInv
for k in range(2):
r.inverse()
breaker = self.lattice.symmetry.inFZ(r.asRodrigues(vector=True)) \
and (not SST or other.lattice.symmetry.inDisorientationSST(r.asRodrigues(vector=True)))
breaker = self.lattice.symmetry.inFZ(r.as_Rodrigues(vector=True)) \
and (not SST or other.lattice.symmetry.inDisorientationSST(r.as_Rodrigues(vector=True)))
if breaker: break
if breaker: break
if breaker: break
@ -75,7 +75,7 @@ class Orientation:
# ... own sym, other sym,
# self-->other: True, self<--other: False
def inFZ(self):
return self.lattice.symmetry.inFZ(self.rotation.asRodrigues(vector=True))
return self.lattice.symmetry.inFZ(self.rotation.as_Rodrigues(vector=True))
def equivalentOrientations(self,members=[]):
@ -97,7 +97,7 @@ class Orientation:
def reduced(self):
"""Transform orientation to fall into fundamental zone according to symmetry."""
for me in self.equivalentOrientations():
if self.lattice.symmetry.inFZ(me.rotation.asRodrigues(vector=True)): break
if self.lattice.symmetry.inFZ(me.rotation.as_Rodrigues(vector=True)): break
return self.__class__(me.rotation,self.lattice)

View File

@ -119,7 +119,7 @@ class Rotation:
R = self.as_matrix()
return np.einsum('...im,...jn,...ko,...lp,...mnop',R,R,R,R,other)
else:
raise ValueError('Can only rotate vectors, 2nd order ternsors, and 4th order tensors')
raise ValueError('Can only rotate vectors, 2nd order tensors, and 4th order tensors')
else:
raise TypeError('Cannot rotate {}'.format(type(other)))
@ -464,7 +464,6 @@ class Rotation:
fromQuaternion = from_quaternion
fromEulers = from_Eulers
asAxisAngle = as_axis_angle
asRodrigues = as_Rodrigues
__mul__ = __matmul__
####################################################################################################