matching name
This commit is contained in:
parent
86a60283c3
commit
19ca99e033
|
@ -168,7 +168,7 @@ class Crystal():
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def basis(self):
|
def standard_triangle(self):
|
||||||
"""
|
"""
|
||||||
Corners of the standard triangle.
|
Corners of the standard triangle.
|
||||||
|
|
||||||
|
|
|
@ -668,21 +668,21 @@ class Orientation(Rotation,Crystal):
|
||||||
if not isinstance(vector,np.ndarray) or vector.shape[-1] != 3:
|
if not isinstance(vector,np.ndarray) or vector.shape[-1] != 3:
|
||||||
raise ValueError('input is not a field of three-dimensional vectors')
|
raise ValueError('input is not a field of three-dimensional vectors')
|
||||||
|
|
||||||
if self.basis is None: # direct exit for no symmetry
|
if self.standard_triangle is None: # direct exit for no symmetry
|
||||||
return np.ones_like(vector[...,0],bool)
|
return np.ones_like(vector[...,0],bool)
|
||||||
|
|
||||||
if proper:
|
if proper:
|
||||||
components_proper = np.around(np.einsum('...ji,...i',
|
components_proper = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self.basis['proper'], vector.shape+(3,)),
|
np.broadcast_to(self.standard_triangle['proper'], vector.shape+(3,)),
|
||||||
vector), 12)
|
vector), 12)
|
||||||
components_improper = np.around(np.einsum('...ji,...i',
|
components_improper = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self.basis['improper'], vector.shape+(3,)),
|
np.broadcast_to(self.standard_triangle['improper'], vector.shape+(3,)),
|
||||||
vector), 12)
|
vector), 12)
|
||||||
return np.all(components_proper >= 0.0,axis=-1) \
|
return np.all(components_proper >= 0.0,axis=-1) \
|
||||||
| np.all(components_improper >= 0.0,axis=-1)
|
| np.all(components_improper >= 0.0,axis=-1)
|
||||||
else:
|
else:
|
||||||
components = np.around(np.einsum('...ji,...i',
|
components = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self.basis['improper'], vector.shape+(3,)),
|
np.broadcast_to(self.standard_triangle['improper'], vector.shape+(3,)),
|
||||||
np.block([vector[...,:2],np.abs(vector[...,2:3])])), 12)
|
np.block([vector[...,:2],np.abs(vector[...,2:3])])), 12)
|
||||||
|
|
||||||
return np.all(components >= 0.0,axis=-1)
|
return np.all(components >= 0.0,axis=-1)
|
||||||
|
@ -723,15 +723,15 @@ class Orientation(Rotation,Crystal):
|
||||||
vector_ = self.to_SST(vector,proper) if in_SST else \
|
vector_ = self.to_SST(vector,proper) if in_SST else \
|
||||||
self @ np.broadcast_to(vector,self.shape+(3,))
|
self @ np.broadcast_to(vector,self.shape+(3,))
|
||||||
|
|
||||||
if self.basis is None: # direct exit for no symmetry
|
if self.standard_triangle is None: # direct exit for no symmetry
|
||||||
return np.zeros_like(vector_)
|
return np.zeros_like(vector_)
|
||||||
|
|
||||||
if proper:
|
if proper:
|
||||||
components_proper = np.around(np.einsum('...ji,...i',
|
components_proper = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self.basis['proper'], vector_.shape+(3,)),
|
np.broadcast_to(self.standard_triangle['proper'], vector_.shape+(3,)),
|
||||||
vector_), 12)
|
vector_), 12)
|
||||||
components_improper = np.around(np.einsum('...ji,...i',
|
components_improper = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self.basis['improper'], vector_.shape+(3,)),
|
np.broadcast_to(self.standard_triangle['improper'], vector_.shape+(3,)),
|
||||||
vector_), 12)
|
vector_), 12)
|
||||||
in_SST = np.all(components_proper >= 0.0,axis=-1) \
|
in_SST = np.all(components_proper >= 0.0,axis=-1) \
|
||||||
| np.all(components_improper >= 0.0,axis=-1)
|
| np.all(components_improper >= 0.0,axis=-1)
|
||||||
|
@ -739,7 +739,7 @@ class Orientation(Rotation,Crystal):
|
||||||
components_proper,components_improper)
|
components_proper,components_improper)
|
||||||
else:
|
else:
|
||||||
components = np.around(np.einsum('...ji,...i',
|
components = np.around(np.einsum('...ji,...i',
|
||||||
np.broadcast_to(self .basis['improper'], vector_.shape+(3,)),
|
np.broadcast_to(self .standard_triangle['improper'], vector_.shape+(3,)),
|
||||||
np.block([vector_[...,:2],np.abs(vector_[...,2:3])])), 12)
|
np.block([vector_[...,:2],np.abs(vector_[...,2:3])])), 12)
|
||||||
|
|
||||||
in_SST = np.all(components >= 0.0,axis=-1)
|
in_SST = np.all(components >= 0.0,axis=-1)
|
||||||
|
|
Loading…
Reference in New Issue