Merge branch 'fix-relationship-operations' into 'development'
proper bi-directional orientation relationships Closes #333 and #322 See merge request damask/DAMASK!841
|
@ -6,7 +6,8 @@ from ._typehints import FloatSequence, CrystalFamily, BravaisLattice, CrystalKin
|
|||
from . import util
|
||||
from . import Rotation
|
||||
|
||||
lattice_symmetries: Dict[BravaisLattice, CrystalFamily] = {
|
||||
|
||||
lattice_symmetries: Dict[Optional[BravaisLattice], CrystalFamily] = {
|
||||
'aP': 'triclinic',
|
||||
|
||||
'mP': 'monoclinic',
|
||||
|
@ -27,276 +28,406 @@ lattice_symmetries: Dict[BravaisLattice, CrystalFamily] = {
|
|||
'cF': 'cubic',
|
||||
}
|
||||
|
||||
orientation_relationships: Dict[str, Dict[BravaisLattice,np.ndarray]] = {
|
||||
'KS': {
|
||||
'cF': np.array([
|
||||
[[-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]],
|
||||
[[-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]],
|
||||
],dtype=float),
|
||||
'cI': 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],[ 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]],
|
||||
[[-1, 1,-1],[ 0, 1, 1]],
|
||||
],dtype=float),
|
||||
},
|
||||
'GT': {
|
||||
'cF': np.array([
|
||||
[[ -5,-12, 17],[ 1, 1, 1]],
|
||||
[[ 17, -5,-12],[ 1, 1, 1]],
|
||||
[[-12, 17, -5],[ 1, 1, 1]],
|
||||
[[ 5, 12, 17],[ -1, -1, 1]],
|
||||
[[-17, 5,-12],[ -1, -1, 1]],
|
||||
[[ 12,-17, -5],[ -1, -1, 1]],
|
||||
[[ -5, 12,-17],[ -1, 1, 1]],
|
||||
[[ 17, 5, 12],[ -1, 1, 1]],
|
||||
[[-12,-17, 5],[ -1, 1, 1]],
|
||||
[[ 5,-12,-17],[ 1, -1, 1]],
|
||||
[[-17, -5, 12],[ 1, -1, 1]],
|
||||
[[ 12, 17, 5],[ 1, -1, 1]],
|
||||
[[ -5, 17,-12],[ 1, 1, 1]],
|
||||
[[-12, -5, 17],[ 1, 1, 1]],
|
||||
[[ 17,-12, -5],[ 1, 1, 1]],
|
||||
[[ 5,-17,-12],[ -1, -1, 1]],
|
||||
[[ 12, 5, 17],[ -1, -1, 1]],
|
||||
[[-17, 12, -5],[ -1, -1, 1]],
|
||||
[[ -5,-17, 12],[ -1, 1, 1]],
|
||||
[[-12, 5,-17],[ -1, 1, 1]],
|
||||
[[ 17, 12, 5],[ -1, 1, 1]],
|
||||
[[ 5, 17, 12],[ 1, -1, 1]],
|
||||
[[ 12, -5,-17],[ 1, -1, 1]],
|
||||
[[-17,-12, 5],[ 1, -1, 1]],
|
||||
],dtype=float),
|
||||
'cI': np.array([
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ 1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[-17, 17, -7],[ -1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ -1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[-17,-17, 7],[ 1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 17, -7],[ 1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ -1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[-17,-17, 7],[ -1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ 1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
],dtype=float),
|
||||
},
|
||||
'GT_prime': {
|
||||
'cF' : np.array([
|
||||
[[ 0, 1, -1],[ 7, 17, 17]],
|
||||
[[ -1, 0, 1],[ 17, 7, 17]],
|
||||
[[ 1, -1, 0],[ 17, 17, 7]],
|
||||
[[ 0, -1, -1],[ -7,-17, 17]],
|
||||
[[ 1, 0, 1],[-17, -7, 17]],
|
||||
[[ 1, -1, 0],[-17,-17, 7]],
|
||||
[[ 0, 1, -1],[ 7,-17,-17]],
|
||||
[[ 1, 0, 1],[ 17, -7,-17]],
|
||||
[[ -1, -1, 0],[ 17,-17, -7]],
|
||||
[[ 0, -1, -1],[ -7, 17,-17]],
|
||||
[[ -1, 0, 1],[-17, 7,-17]],
|
||||
[[ -1, -1, 0],[-17, 17, -7]],
|
||||
[[ 0, -1, 1],[ 7, 17, 17]],
|
||||
[[ 1, 0, -1],[ 17, 7, 17]],
|
||||
[[ -1, 1, 0],[ 17, 17, 7]],
|
||||
[[ 0, 1, 1],[ -7,-17, 17]],
|
||||
[[ -1, 0, -1],[-17, -7, 17]],
|
||||
[[ -1, 1, 0],[-17,-17, 7]],
|
||||
[[ 0, -1, 1],[ 7,-17,-17]],
|
||||
[[ -1, 0, -1],[ 17, -7,-17]],
|
||||
[[ 1, 1, 0],[ 17,-17, -7]],
|
||||
[[ 0, 1, 1],[ -7, 17,-17]],
|
||||
[[ 1, 0, -1],[-17, 7,-17]],
|
||||
[[ 1, 1, 0],[-17, 17, -7]],
|
||||
],dtype=float),
|
||||
'cI' : np.array([
|
||||
[[ 1, 1, -1],[ 12, 5, 17]],
|
||||
[[ -1, 1, 1],[ 17, 12, 5]],
|
||||
[[ 1, -1, 1],[ 5, 17, 12]],
|
||||
[[ -1, -1, -1],[-12, -5, 17]],
|
||||
[[ 1, -1, 1],[-17,-12, 5]],
|
||||
[[ 1, -1, -1],[ -5,-17, 12]],
|
||||
[[ -1, 1, -1],[ 12, -5,-17]],
|
||||
[[ 1, 1, 1],[ 17,-12, -5]],
|
||||
[[ -1, -1, 1],[ 5,-17,-12]],
|
||||
[[ 1, -1, -1],[-12, 5,-17]],
|
||||
[[ -1, -1, 1],[-17, 12, -5]],
|
||||
[[ -1, -1, -1],[ -5, 17,-12]],
|
||||
[[ 1, -1, 1],[ 12, 17, 5]],
|
||||
[[ 1, 1, -1],[ 5, 12, 17]],
|
||||
[[ -1, 1, 1],[ 17, 5, 12]],
|
||||
[[ -1, 1, 1],[-12,-17, 5]],
|
||||
[[ -1, -1, -1],[ -5,-12, 17]],
|
||||
[[ -1, 1, -1],[-17, -5, 12]],
|
||||
[[ -1, -1, 1],[ 12,-17, -5]],
|
||||
[[ -1, 1, -1],[ 5,-12,-17]],
|
||||
[[ 1, 1, 1],[ 17, -5,-12]],
|
||||
[[ 1, 1, 1],[-12, 17, -5]],
|
||||
[[ 1, -1, -1],[ -5, 12,-17]],
|
||||
[[ 1, 1, -1],[-17, 5,-12]],
|
||||
],dtype=float),
|
||||
},
|
||||
'NW': {
|
||||
'cF' : np.array([
|
||||
[[ 2, -1, -1],[ 1, 1, 1]],
|
||||
[[ -1, 2, -1],[ 1, 1, 1]],
|
||||
[[ -1, -1, 2],[ 1, 1, 1]],
|
||||
[[ -2, -1, -1],[ -1, 1, 1]],
|
||||
[[ 1, 2, -1],[ -1, 1, 1]],
|
||||
[[ 1, -1, 2],[ -1, 1, 1]],
|
||||
[[ 2, 1, -1],[ 1, -1, 1]],
|
||||
[[ -1, -2, -1],[ 1, -1, 1]],
|
||||
[[ -1, 1, 2],[ 1, -1, 1]],
|
||||
[[ 2, -1, 1],[ -1, -1, 1]],
|
||||
[[ -1, 2, 1],[ -1, -1, 1]],
|
||||
[[ -1, -1, -2],[ -1, -1, 1]],
|
||||
],dtype=float),
|
||||
'cI' : np.array([
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
[[ 0, -1, 1],[ 0, 1, 1]],
|
||||
],dtype=float),
|
||||
},
|
||||
'Pitsch': {
|
||||
'cF' : np.array([
|
||||
[[ 1, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 1, 0],[ 0, 0, 1]],
|
||||
[[ 0, 1, 1],[ 1, 0, 0]],
|
||||
[[ 0, 1, -1],[ 1, 0, 0]],
|
||||
[[ -1, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, -1, 0],[ 0, 0, 1]],
|
||||
[[ 1, 0, -1],[ 0, 1, 0]],
|
||||
[[ -1, 1, 0],[ 0, 0, 1]],
|
||||
[[ 0, -1, 1],[ 1, 0, 0]],
|
||||
[[ 0, 1, 1],[ 1, 0, 0]],
|
||||
[[ 1, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 1, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
'cI' : np.array([
|
||||
[[ 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],[ -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],[ 1, 0, -1]],
|
||||
[[ 1, 1, -1],[ -1, 1, 0]],
|
||||
],dtype=float),
|
||||
},
|
||||
'Bain': {
|
||||
'cF' : np.array([
|
||||
[[ 0, 1, 0],[ 1, 0, 0]],
|
||||
[[ 0, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 0, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
'cI' : np.array([
|
||||
[[ 0, 1, 1],[ 1, 0, 0]],
|
||||
[[ 1, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 1, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
},
|
||||
'Burgers' : {
|
||||
'cI' : 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]],
|
||||
orientation_relationships: Dict[str, Dict[str,List[np.ndarray]]] = {
|
||||
'KS': { # https://doi.org/10.1016/j.jallcom.2012.02.004
|
||||
'cF-->cI' : [
|
||||
np.repeat(np.array([
|
||||
[[-1, 0, 1],[ 1, 1, 1]],
|
||||
[[ 0, 1,-1],[ 1, 1, 1]],
|
||||
[[ 1,-1, 0],[ 1, 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, 0,-1],[ 1,-1, 1]],
|
||||
[[-1,-1, 0],[ 1,-1, 1]],
|
||||
[[ 0, 1, 1],[ 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]],
|
||||
],dtype=float),
|
||||
'hP' : np.array([
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
[[ 0,-1, 1],[-1, 1, 1]],
|
||||
[[-1, 0,-1],[-1, 1, 1]],
|
||||
[[ 1, 1, 0],[-1, 1, 1]],
|
||||
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
[[-1, 1, 0],[ 1, 1,-1]],
|
||||
[[ 0,-1,-1],[ 1, 1,-1]],
|
||||
[[ 1, 0, 1],[ 1, 1,-1]],
|
||||
],dtype=float),
|
||||
2,axis=0),
|
||||
np.tile(np.array([[[-1,-1, 1],[ 0, 1, 1]],
|
||||
[[-1, 1,-1],[ 0, 1, 1]]],dtype=float),
|
||||
(12,1,1)),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
np.repeat(np.array([
|
||||
[[ 1, 1,-1],[ 0, 1, 1]],
|
||||
[[ 1,-1, 1],[ 0, 1, 1]],
|
||||
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, 2, -1, 0],[ 0, 0, 0, 1]],
|
||||
[[ -1, -1, 2, 0],[ 0, 0, 0, 1]],
|
||||
],dtype=float),
|
||||
},
|
||||
}
|
||||
[[ 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, 1, 0]],
|
||||
[[ 1,-1,-1],[ 1, 1, 0]],
|
||||
|
||||
[[ 1, 1, 1],[ 1,-1, 0]],
|
||||
[[ 1, 1,-1],[ 1,-1, 0]],
|
||||
],dtype=float),
|
||||
2,axis=0),
|
||||
np.tile(np.array([[[ 0, 1,-1],[ 1, 1, 1]],
|
||||
[[ 0,-1, 1],[ 1, 1, 1]]],dtype=float),
|
||||
(12,1,1)),
|
||||
],
|
||||
},
|
||||
'GT': { # https://doi.org/10.1107/S0021889805038276
|
||||
'cF-->cI' : [
|
||||
np.array([
|
||||
[[ -5,-12, 17],[ 1, 1, 1]],
|
||||
[[ 17, -5,-12],[ 1, 1, 1]],
|
||||
[[-12, 17, -5],[ 1, 1, 1]],
|
||||
[[ 5, 12, 17],[ -1, -1, 1]],
|
||||
[[-17, 5,-12],[ -1, -1, 1]],
|
||||
[[ 12,-17, -5],[ -1, -1, 1]],
|
||||
[[ -5, 12,-17],[ -1, 1, 1]],
|
||||
[[ 17, 5, 12],[ -1, 1, 1]],
|
||||
[[-12,-17, 5],[ -1, 1, 1]],
|
||||
[[ 5,-12,-17],[ 1, -1, 1]],
|
||||
[[-17, -5, 12],[ 1, -1, 1]],
|
||||
[[ 12, 17, 5],[ 1, -1, 1]],
|
||||
[[ -5, 17,-12],[ 1, 1, 1]],
|
||||
[[-12, -5, 17],[ 1, 1, 1]],
|
||||
[[ 17,-12, -5],[ 1, 1, 1]],
|
||||
[[ 5,-17,-12],[ -1, -1, 1]],
|
||||
[[ 12, 5, 17],[ -1, -1, 1]],
|
||||
[[-17, 12, -5],[ -1, -1, 1]],
|
||||
[[ -5,-17, 12],[ -1, 1, 1]],
|
||||
[[-12, 5,-17],[ -1, 1, 1]],
|
||||
[[ 17, 12, 5],[ -1, 1, 1]],
|
||||
[[ 5, 17, 12],[ 1, -1, 1]],
|
||||
[[ 12, -5,-17],[ 1, -1, 1]],
|
||||
[[-17,-12, 5],[ 1, -1, 1]],
|
||||
],dtype=float),
|
||||
np.array([
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ 1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[-17, 17, -7],[ -1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ -1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[-17,-17, 7],[ 1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 17, -7],[ 1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ -1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[-17,-17, 7],[ -1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ 1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
],dtype=float),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
np.array([
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ 1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[-17, 17, -7],[ -1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ -1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[-17,-17, 7],[ 1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 17, -7],[ 1, 1, 0]],
|
||||
[[ -7,-17, 17],[ 0, 1, 1]],
|
||||
[[ 17, -7,-17],[ 1, 0, 1]],
|
||||
[[ 17,-17, -7],[ -1, -1, 0]],
|
||||
[[ 7, 17, 17],[ 0, -1, 1]],
|
||||
[[-17, 7,-17],[ -1, 0, 1]],
|
||||
[[-17,-17, 7],[ -1, 1, 0]],
|
||||
[[ -7, 17,-17],[ 0, 1, 1]],
|
||||
[[ 17, 7, 17],[ -1, 0, 1]],
|
||||
[[ 17, 17, 7],[ 1, -1, 0]],
|
||||
[[ 7,-17,-17],[ 0, -1, 1]],
|
||||
[[-17, -7, 17],[ 1, 0, 1]],
|
||||
],dtype=float),
|
||||
np.array([
|
||||
[[ -5,-12, 17],[ 1, 1, 1]],
|
||||
[[ 17, -5,-12],[ 1, 1, 1]],
|
||||
[[-12, 17, -5],[ 1, 1, 1]],
|
||||
[[ 5, 12, 17],[ -1, -1, 1]],
|
||||
[[-17, 5,-12],[ -1, -1, 1]],
|
||||
[[ 12,-17, -5],[ -1, -1, 1]],
|
||||
[[ -5, 12,-17],[ -1, 1, 1]],
|
||||
[[ 17, 5, 12],[ -1, 1, 1]],
|
||||
[[-12,-17, 5],[ -1, 1, 1]],
|
||||
[[ 5,-12,-17],[ 1, -1, 1]],
|
||||
[[-17, -5, 12],[ 1, -1, 1]],
|
||||
[[ 12, 17, 5],[ 1, -1, 1]],
|
||||
[[ -5, 17,-12],[ 1, 1, 1]],
|
||||
[[-12, -5, 17],[ 1, 1, 1]],
|
||||
[[ 17,-12, -5],[ 1, 1, 1]],
|
||||
[[ 5,-17,-12],[ -1, -1, 1]],
|
||||
[[ 12, 5, 17],[ -1, -1, 1]],
|
||||
[[-17, 12, -5],[ -1, -1, 1]],
|
||||
[[ -5,-17, 12],[ -1, 1, 1]],
|
||||
[[-12, 5,-17],[ -1, 1, 1]],
|
||||
[[ 17, 12, 5],[ -1, 1, 1]],
|
||||
[[ 5, 17, 12],[ 1, -1, 1]],
|
||||
[[ 12, -5,-17],[ 1, -1, 1]],
|
||||
[[-17,-12, 5],[ 1, -1, 1]],
|
||||
],dtype=float),
|
||||
],
|
||||
},
|
||||
'GT_prime': { # https://doi.org/10.1107/S0021889805038276
|
||||
'cF-->cI' : [
|
||||
np.array([
|
||||
[[ 0, 1, -1],[ 7, 17, 17]],
|
||||
[[ -1, 0, 1],[ 17, 7, 17]],
|
||||
[[ 1, -1, 0],[ 17, 17, 7]],
|
||||
[[ 0, -1, -1],[ -7,-17, 17]],
|
||||
[[ 1, 0, 1],[-17, -7, 17]],
|
||||
[[ 1, -1, 0],[-17,-17, 7]],
|
||||
[[ 0, 1, -1],[ 7,-17,-17]],
|
||||
[[ 1, 0, 1],[ 17, -7,-17]],
|
||||
[[ -1, -1, 0],[ 17,-17, -7]],
|
||||
[[ 0, -1, -1],[ -7, 17,-17]],
|
||||
[[ -1, 0, 1],[-17, 7,-17]],
|
||||
[[ -1, -1, 0],[-17, 17, -7]],
|
||||
[[ 0, -1, 1],[ 7, 17, 17]],
|
||||
[[ 1, 0, -1],[ 17, 7, 17]],
|
||||
[[ -1, 1, 0],[ 17, 17, 7]],
|
||||
[[ 0, 1, 1],[ -7,-17, 17]],
|
||||
[[ -1, 0, -1],[-17, -7, 17]],
|
||||
[[ -1, 1, 0],[-17,-17, 7]],
|
||||
[[ 0, -1, 1],[ 7,-17,-17]],
|
||||
[[ -1, 0, -1],[ 17, -7,-17]],
|
||||
[[ 1, 1, 0],[ 17,-17, -7]],
|
||||
[[ 0, 1, 1],[ -7, 17,-17]],
|
||||
[[ 1, 0, -1],[-17, 7,-17]],
|
||||
[[ 1, 1, 0],[-17, 17, -7]],
|
||||
],dtype=float),
|
||||
np.array([
|
||||
[[ 1, 1, -1],[ 12, 5, 17]],
|
||||
[[ -1, 1, 1],[ 17, 12, 5]],
|
||||
[[ 1, -1, 1],[ 5, 17, 12]],
|
||||
[[ -1, -1, -1],[-12, -5, 17]],
|
||||
[[ 1, -1, 1],[-17,-12, 5]],
|
||||
[[ 1, -1, -1],[ -5,-17, 12]],
|
||||
[[ -1, 1, -1],[ 12, -5,-17]],
|
||||
[[ 1, 1, 1],[ 17,-12, -5]],
|
||||
[[ -1, -1, 1],[ 5,-17,-12]],
|
||||
[[ 1, -1, -1],[-12, 5,-17]],
|
||||
[[ -1, -1, 1],[-17, 12, -5]],
|
||||
[[ -1, -1, -1],[ -5, 17,-12]],
|
||||
[[ 1, -1, 1],[ 12, 17, 5]],
|
||||
[[ 1, 1, -1],[ 5, 12, 17]],
|
||||
[[ -1, 1, 1],[ 17, 5, 12]],
|
||||
[[ -1, 1, 1],[-12,-17, 5]],
|
||||
[[ -1, -1, -1],[ -5,-12, 17]],
|
||||
[[ -1, 1, -1],[-17, -5, 12]],
|
||||
[[ -1, -1, 1],[ 12,-17, -5]],
|
||||
[[ -1, 1, -1],[ 5,-12,-17]],
|
||||
[[ 1, 1, 1],[ 17, -5,-12]],
|
||||
[[ 1, 1, 1],[-12, 17, -5]],
|
||||
[[ 1, -1, -1],[ -5, 12,-17]],
|
||||
[[ 1, 1, -1],[-17, 5,-12]],
|
||||
],dtype=float),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
np.array([
|
||||
[[ 1, 1, -1],[ 12, 5, 17]],
|
||||
[[ -1, 1, 1],[ 17, 12, 5]],
|
||||
[[ 1, -1, 1],[ 5, 17, 12]],
|
||||
[[ -1, -1, -1],[-12, -5, 17]],
|
||||
[[ 1, -1, 1],[-17,-12, 5]],
|
||||
[[ 1, -1, -1],[ -5,-17, 12]],
|
||||
[[ -1, 1, -1],[ 12, -5,-17]],
|
||||
[[ 1, 1, 1],[ 17,-12, -5]],
|
||||
[[ -1, -1, 1],[ 5,-17,-12]],
|
||||
[[ 1, -1, -1],[-12, 5,-17]],
|
||||
[[ -1, -1, 1],[-17, 12, -5]],
|
||||
[[ -1, -1, -1],[ -5, 17,-12]],
|
||||
[[ 1, -1, 1],[ 12, 17, 5]],
|
||||
[[ 1, 1, -1],[ 5, 12, 17]],
|
||||
[[ -1, 1, 1],[ 17, 5, 12]],
|
||||
[[ -1, 1, 1],[-12,-17, 5]],
|
||||
[[ -1, -1, -1],[ -5,-12, 17]],
|
||||
[[ -1, 1, -1],[-17, -5, 12]],
|
||||
[[ -1, -1, 1],[ 12,-17, -5]],
|
||||
[[ -1, 1, -1],[ 5,-12,-17]],
|
||||
[[ 1, 1, 1],[ 17, -5,-12]],
|
||||
[[ 1, 1, 1],[-12, 17, -5]],
|
||||
[[ 1, -1, -1],[ -5, 12,-17]],
|
||||
[[ 1, 1, -1],[-17, 5,-12]],
|
||||
],dtype=float),
|
||||
np.array([
|
||||
[[ 0, 1, -1],[ 7, 17, 17]],
|
||||
[[ -1, 0, 1],[ 17, 7, 17]],
|
||||
[[ 1, -1, 0],[ 17, 17, 7]],
|
||||
[[ 0, -1, -1],[ -7,-17, 17]],
|
||||
[[ 1, 0, 1],[-17, -7, 17]],
|
||||
[[ 1, -1, 0],[-17,-17, 7]],
|
||||
[[ 0, 1, -1],[ 7,-17,-17]],
|
||||
[[ 1, 0, 1],[ 17, -7,-17]],
|
||||
[[ -1, -1, 0],[ 17,-17, -7]],
|
||||
[[ 0, -1, -1],[ -7, 17,-17]],
|
||||
[[ -1, 0, 1],[-17, 7,-17]],
|
||||
[[ -1, -1, 0],[-17, 17, -7]],
|
||||
[[ 0, -1, 1],[ 7, 17, 17]],
|
||||
[[ 1, 0, -1],[ 17, 7, 17]],
|
||||
[[ -1, 1, 0],[ 17, 17, 7]],
|
||||
[[ 0, 1, 1],[ -7,-17, 17]],
|
||||
[[ -1, 0, -1],[-17, -7, 17]],
|
||||
[[ -1, 1, 0],[-17,-17, 7]],
|
||||
[[ 0, -1, 1],[ 7,-17,-17]],
|
||||
[[ -1, 0, -1],[ 17, -7,-17]],
|
||||
[[ 1, 1, 0],[ 17,-17, -7]],
|
||||
[[ 0, 1, 1],[ -7, 17,-17]],
|
||||
[[ 1, 0, -1],[-17, 7,-17]],
|
||||
[[ 1, 1, 0],[-17, 17, -7]],
|
||||
],dtype=float),
|
||||
],
|
||||
},
|
||||
'NW': { # https://doi.org/10.1016/j.matchar.2004.12.015
|
||||
'cF-->cI' : [
|
||||
np.array([
|
||||
[[ 2,-1,-1],[ 1, 1, 1]],
|
||||
[[-1, 2,-1],[ 1, 1, 1]],
|
||||
[[-1,-1, 2],[ 1, 1, 1]],
|
||||
|
||||
[[-2,-1,-1],[-1, 1, 1]],
|
||||
[[ 1, 2,-1],[-1, 1, 1]],
|
||||
[[ 1,-1, 2],[-1, 1, 1]],
|
||||
|
||||
[[ 2, 1,-1],[ 1,-1, 1]],
|
||||
[[-1,-2,-1],[ 1,-1, 1]],
|
||||
[[-1, 1, 2],[ 1,-1, 1]],
|
||||
|
||||
[[ 2,-1, 1],[ 1, 1,-1]],
|
||||
[[-1, 2, 1],[ 1, 1,-1]],
|
||||
[[-1,-1,-2],[ 1, 1,-1]],
|
||||
],dtype=float),
|
||||
np.broadcast_to(np.array([[ 0,-1, 1],[ 0, 1, 1]],dtype=float),
|
||||
(12,2,3)),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
np.repeat(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]],
|
||||
[[ 1,-1, 0],[ 1, 1, 0]],
|
||||
[[ 1, 1, 0],[ 1,-1, 0]],
|
||||
],dtype=float),
|
||||
2,axis=0),
|
||||
np.tile(np.array([
|
||||
[[ 2,-1,-1],[ 1, 1, 1]],
|
||||
[[-2, 1, 1],[ 1, 1, 1]],
|
||||
],dtype=float),
|
||||
(6,1,1)),
|
||||
],
|
||||
},
|
||||
'Pitsch': { # https://doi.org/10.1080/14786435908238253
|
||||
'cF-->cI' : [
|
||||
np.repeat(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]],
|
||||
[[ 1, 1, 0],[ 0, 0, 1]],
|
||||
[[ 1,-1, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
2,axis=0),
|
||||
np.tile(np.array([
|
||||
[[ 1, 1,-1],[ 0, 1, 1]],
|
||||
[[-1, 1,-1],[ 0, 1, 1]],
|
||||
],dtype=float),
|
||||
(6,1,1)),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
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]],
|
||||
[[ 1,-1, 1],[ 1, 1, 0]],
|
||||
[[ 1,-1,-1],[ 1, 1, 0]],
|
||||
[[ 1, 1, 1],[ 1,-1, 0]],
|
||||
[[ 1, 1,-1],[ 1,-1, 0]],
|
||||
],dtype=float),
|
||||
np.broadcast_to(np.array([[ 1, 1, 0],[ 0, 0, 1]],dtype=float),
|
||||
(12,2,3)),
|
||||
],
|
||||
},
|
||||
'Bain': { # https://doi.org/10.1107/S0021889805038276
|
||||
'cF-->cI' : [
|
||||
np.array([
|
||||
[[ 0, 1, 0],[ 1, 0, 0]],
|
||||
[[ 0, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 0, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
np.broadcast_to(np.array([[ 1, 1, 0],[ 0, 0, 1]],dtype=float),
|
||||
(3,2,3)),
|
||||
],
|
||||
'cI-->cF' : [
|
||||
np.array([
|
||||
[[ 0, 1, 1],[ 1, 0, 0]],
|
||||
[[ 1, 0, 1],[ 0, 1, 0]],
|
||||
[[ 1, 1, 0],[ 0, 0, 1]],
|
||||
],dtype=float),
|
||||
np.broadcast_to(np.array([[ 1, 0, 0],[ 0, 0, 1]],dtype=float),
|
||||
(3,2,3)),
|
||||
]
|
||||
},
|
||||
'Burgers' : { # https://doi.org/10.1016/S0031-8914(34)80244-3
|
||||
'cI-->hP' : [
|
||||
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]],
|
||||
[[ 1,-1, 1],[ 1, 1, 0]],
|
||||
[[ 1,-1,-1],[ 1, 1, 0]],
|
||||
[[ 1, 1, 1],[ 1,-1, 0]],
|
||||
[[ 1, 1,-1],[ 1,-1, 0]],
|
||||
],dtype=float),
|
||||
np.broadcast_to(np.array([[ 2,-1,-1, 0],[ 0, 0, 0, 1]],dtype=float),
|
||||
(12,2,4)),
|
||||
],
|
||||
'hP-->cI' : [
|
||||
np.repeat(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]],
|
||||
],dtype=float),
|
||||
2,axis=0),
|
||||
np.tile(np.array([
|
||||
[[ 1, 1,-1],[ 0, 1, 1]],
|
||||
[[-1, 1,-1],[ 0, 1, 1]],
|
||||
],dtype=float),
|
||||
(3,1,1)),
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
class Crystal():
|
||||
"""
|
||||
|
@ -358,7 +489,7 @@ class Crystal():
|
|||
if lattice is not None and family is not None and family != lattice_symmetries[lattice]:
|
||||
raise KeyError(f'incompatible family "{family}" for lattice "{lattice}"')
|
||||
|
||||
self.family = lattice_symmetries[lattice] if family is None else family
|
||||
self.family = lattice_symmetries[lattice] if family is None else family
|
||||
self.lattice = lattice
|
||||
|
||||
if self.lattice is not None:
|
||||
|
@ -428,20 +559,20 @@ class Crystal():
|
|||
Crystal to check for equality.
|
||||
|
||||
"""
|
||||
return NotImplemented if not isinstance(other, Crystal) else \
|
||||
self.lattice == other.lattice and \
|
||||
self.parameters == other.parameters and \
|
||||
self.family == other.family
|
||||
return (NotImplemented if not isinstance(other, Crystal) else
|
||||
self.lattice == other.lattice and
|
||||
self.parameters == other.parameters and
|
||||
self.family == other.family) # type: ignore
|
||||
|
||||
@property
|
||||
def parameters(self):
|
||||
def parameters(self) -> Optional[Tuple]:
|
||||
"""Return lattice parameters a, b, c, alpha, beta, gamma."""
|
||||
if hasattr(self,'a'): return (self.a,self.b,self.c,self.alpha,self.beta,self.gamma)
|
||||
return (self.a,self.b,self.c,self.alpha,self.beta,self.gamma) if hasattr(self,'a') else None
|
||||
|
||||
@property
|
||||
def immutable(self):
|
||||
def immutable(self) -> Dict[str, float]:
|
||||
"""Return immutable lattice parameters."""
|
||||
_immutable = {
|
||||
_immutable: Dict[CrystalFamily, Dict[str,float]] = {
|
||||
'cubic': {
|
||||
'b': 1.0,
|
||||
'c': 1.0,
|
||||
|
@ -476,9 +607,9 @@ class Crystal():
|
|||
|
||||
|
||||
@property
|
||||
def orientation_relationships(self):
|
||||
def orientation_relationships(self) -> List[str]:
|
||||
"""Return labels of orientation relationships."""
|
||||
return [k for k,v in orientation_relationships.items() if self.lattice in v]
|
||||
return [k for k,v in orientation_relationships.items() if np.any([m.startswith(str(self.lattice)) for m in v])]
|
||||
|
||||
|
||||
@property
|
||||
|
@ -671,9 +802,9 @@ class Crystal():
|
|||
|
||||
|
||||
@property
|
||||
def lattice_points(self):
|
||||
def lattice_points(self) -> np.ndarray:
|
||||
"""Return lattice points."""
|
||||
_lattice_points = {
|
||||
_lattice_points: Dict[str, List] = {
|
||||
'P': [
|
||||
],
|
||||
'S': [
|
||||
|
@ -694,8 +825,8 @@ class Crystal():
|
|||
|
||||
if self.lattice is None: raise KeyError('no lattice type specified')
|
||||
return np.array([[0,0,0]]
|
||||
+ _lattice_points.get(self.lattice if self.lattice == 'hP' else \
|
||||
self.lattice[-1],None),dtype=float)
|
||||
+ _lattice_points.get(self.lattice if self.lattice == 'hP' else
|
||||
self.lattice[-1],[]),dtype=float)
|
||||
|
||||
def to_lattice(self, *,
|
||||
direction: Optional[FloatSequence] = None,
|
||||
|
@ -753,7 +884,7 @@ class Crystal():
|
|||
Crystal frame vector (reciprocal space) of Titanium along (1,0,0) plane normal:
|
||||
|
||||
>>> import damask
|
||||
>>> Ti = damask.Crystal(lattice='hP', a=0.295e-9, c=0.469e-9)
|
||||
>>> Ti = damask.Crystal(lattice='hP', a=295e-12, c=469e-12)
|
||||
>>> Ti.to_frame(hkl=(1, 0, 0))
|
||||
array([ 3.38983051e+09, 1.95711956e+09, -4.15134508e-07])
|
||||
|
||||
|
@ -782,7 +913,7 @@ class Crystal():
|
|||
Directions and planes of deformation mode families.
|
||||
|
||||
"""
|
||||
_kinematics: Dict[BravaisLattice, Dict[CrystalKinematics, List[np.ndarray]]] = {
|
||||
_kinematics: Dict[Optional[BravaisLattice], Dict[CrystalKinematics, List[np.ndarray]]] = {
|
||||
'cF': {
|
||||
'slip': [np.array([
|
||||
[ 0,+1,-1, +1,+1,+1],
|
||||
|
@ -1025,7 +1156,8 @@ class Crystal():
|
|||
|
||||
|
||||
def relation_operations(self,
|
||||
model: str) -> Tuple[BravaisLattice, Rotation]:
|
||||
model: str,
|
||||
target = None) -> Tuple[BravaisLattice, Rotation]:
|
||||
"""
|
||||
Crystallographic orientation relationships for phase transformations.
|
||||
|
||||
|
@ -1033,6 +1165,10 @@ class Crystal():
|
|||
----------
|
||||
model : str
|
||||
Name of orientation relationship.
|
||||
target : Crystal, optional
|
||||
Crystal to transform to.
|
||||
Providing this parameter allows specification of non-standard lattice parameters.
|
||||
Default is inferred from selected model and uses standard lattice parameters.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
@ -1057,20 +1193,27 @@ class Crystal():
|
|||
https://doi.org/10.1016/j.actamat.2004.11.021
|
||||
|
||||
"""
|
||||
my_relationships = {k:v for k,v in orientation_relationships.items() if self.lattice in v}
|
||||
if model not in my_relationships:
|
||||
m_l: BravaisLattice
|
||||
o_l: BravaisLattice
|
||||
|
||||
if model not in self.orientation_relationships:
|
||||
raise KeyError(f'unknown orientation relationship "{model}"')
|
||||
r = my_relationships[model]
|
||||
|
||||
sl = self.lattice
|
||||
ol = (set(r)-{sl}).pop()
|
||||
m = r[sl]
|
||||
o = r[ol]
|
||||
sep = '-->'
|
||||
search = self.lattice+sep+('' if target is None else target.lattice) # type: ignore
|
||||
transform = [t for t in orientation_relationships[model].keys() if t.startswith(search)] # type: ignore
|
||||
|
||||
p_,_p = np.zeros(m.shape[:-1]+(3,)),np.zeros(o.shape[:-1]+(3,))
|
||||
p_[...,0,:] = m[...,0,:] if m.shape[-1] == 3 else util.Bravais_to_Miller(uvtw=m[...,0,0:4])
|
||||
p_[...,1,:] = m[...,1,:] if m.shape[-1] == 3 else util.Bravais_to_Miller(hkil=m[...,1,0:4])
|
||||
_p[...,0,:] = o[...,0,:] if o.shape[-1] == 3 else util.Bravais_to_Miller(uvtw=o[...,0,0:4])
|
||||
_p[...,1,:] = o[...,1,:] if o.shape[-1] == 3 else util.Bravais_to_Miller(hkil=o[...,1,0:4])
|
||||
if len(transform) != 1:
|
||||
raise ValueError(f'invalid target lattice "{search.split(sep)[1]}"')
|
||||
|
||||
return (ol,Rotation.from_parallel(p_,_p))
|
||||
m_l,o_l = transform[0].split(sep) # type: ignore
|
||||
m_p,o_p = orientation_relationships[model][m_l+sep+o_l]
|
||||
other = Crystal(lattice=o_l) if target is None else target
|
||||
m_p = np.stack((self.to_frame(uvw=m_p[:,0] if len(m_p[0,0])==3 else util.Bravais_to_Miller(uvtw=m_p[:,0])),
|
||||
self.to_frame(hkl=m_p[:,1] if len(m_p[0,1])==3 else util.Bravais_to_Miller(hkil=m_p[:,1]))),
|
||||
axis=1)
|
||||
o_p = np.stack((other.to_frame(uvw=o_p[:,0] if len(o_p[0,0])==3 else util.Bravais_to_Miller(uvtw=o_p[:,0])),
|
||||
other.to_frame(hkl=o_p[:,1] if len(o_p[0,1])==3 else util.Bravais_to_Miller(hkil=o_p[:,1]))),
|
||||
axis=1)
|
||||
|
||||
return (o_l,Rotation.from_parallel(a=m_p,b=o_p))
|
||||
|
|
|
@ -240,13 +240,6 @@ class Orientation(Rotation,Crystal):
|
|||
return self.copy(Rotation(self.quaternion)*Rotation(other.quaternion))
|
||||
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_random,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
@util.pass_on('rotation', Rotation.from_random, wrapped=__init__)
|
||||
def from_random(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_quaternion,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
|
@ -282,6 +275,13 @@ class Orientation(Rotation,Crystal):
|
|||
def from_matrix(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_parallel,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
@util.pass_on('rotation', Rotation.from_parallel, wrapped=__init__)
|
||||
def from_parallel(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_Rodrigues_vector,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
|
@ -303,6 +303,20 @@ class Orientation(Rotation,Crystal):
|
|||
def from_cubochoric(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_random,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
@util.pass_on('rotation', Rotation.from_random, wrapped=__init__)
|
||||
def from_random(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_ODF,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
@util.pass_on('rotation', Rotation.from_ODF, wrapped=__init__)
|
||||
def from_ODF(cls, **kwargs) -> 'Orientation':
|
||||
return cls(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@util.extend_docstring(Rotation.from_spherical_component,
|
||||
adopted_parameters=Crystal.__init__)
|
||||
|
@ -325,7 +339,7 @@ class Orientation(Rotation,Crystal):
|
|||
hkl: FloatSequence,
|
||||
**kwargs) -> 'Orientation':
|
||||
"""
|
||||
Initialize orientation object from two crystallographic directions.
|
||||
Initialize orientation object from the crystallographic direction and plane parallel to lab x and z, respectively.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
@ -855,7 +869,8 @@ class Orientation(Rotation,Crystal):
|
|||
|
||||
|
||||
def related(self: MyType,
|
||||
model: str) -> MyType:
|
||||
model: str,
|
||||
target = None) -> MyType:
|
||||
"""
|
||||
All orientations related to self by given relationship model.
|
||||
|
||||
|
@ -863,6 +878,10 @@ class Orientation(Rotation,Crystal):
|
|||
----------
|
||||
model : str
|
||||
Orientation relationship model selected from self.orientation_relationships.
|
||||
target : Crystal, optional
|
||||
Crystal to transform to.
|
||||
Providing this parameter allows specification of non-standard lattice parameters.
|
||||
Default is inferred from selected model and uses standard lattice parameters.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
@ -890,11 +909,10 @@ class Orientation(Rotation,Crystal):
|
|||
[0.924 0.000 0.000 0.383]]
|
||||
|
||||
"""
|
||||
lattice,o = self.relation_operations(model)
|
||||
target = Crystal(lattice=lattice)
|
||||
o = o.broadcast_to(o.shape+self.shape,mode='right')
|
||||
lattice,o = self.relation_operations(model,target)
|
||||
target = Crystal(lattice=lattice) if target is None else target
|
||||
|
||||
return Orientation(rotation=o*Rotation(self.quaternion).broadcast_to(o.shape,mode='left'),
|
||||
return Orientation(rotation=o*Rotation(self.quaternion)[np.newaxis,...], # type: ignore
|
||||
lattice=lattice,
|
||||
b = self.b if target.ratio['b'] is None else self.a*target.ratio['b'],
|
||||
c = self.c if target.ratio['c'] is None else self.a*target.ratio['c'],
|
||||
|
|
|
@ -57,6 +57,11 @@ class Table:
|
|||
|
||||
Test equality of other.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
other : Table
|
||||
Table to check for equality.
|
||||
|
||||
"""
|
||||
return NotImplemented if not isinstance(other,Table) else \
|
||||
self.shapes == other.shapes and self.data.equals(other.data)
|
||||
|
|
|
@ -10,8 +10,8 @@ FloatSequence = Union[np.ndarray,Sequence[float]]
|
|||
IntSequence = Union[np.ndarray,Sequence[int]]
|
||||
StrSequence = Union[np.ndarray,Sequence[str]]
|
||||
FileHandle = Union[TextIO, str, Path]
|
||||
CrystalFamily = Union[None,Literal['triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic']]
|
||||
BravaisLattice = Union[None,Literal['aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF']]
|
||||
CrystalFamily = Literal['triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic']
|
||||
BravaisLattice = Literal['aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF']
|
||||
CrystalKinematics = Literal['slip', 'twin']
|
||||
NumpyRngSeed = Union[int, IntSequence, np.random.SeedSequence, np.random.Generator]
|
||||
# BitGenerator does not exists in older numpy versions
|
||||
|
|
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -1,4 +1,4 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
180.0 45.00000000000001 180.0 1 1
|
||||
270.0 45.00000000000001 90.0 1 2
|
||||
90.0 90.0 315.0 1 1
|
||||
180.0 90.00000000000001 45.000000000000014 1 2
|
||||
315.0 0.0 0.0 1 3
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
146.75362934444064 9.976439066337804 256.395594327347 1 1
|
||||
356.59977719102034 43.39784965440254 12.173896584899929 1 2
|
||||
75.92521636876346 43.82007387041961 277.8843642946069 1 3
|
||||
326.75362934444064 9.976439066337806 76.39559432734703 1 4
|
||||
176.59977719102034 43.397849654402556 192.17389658489986 1 5
|
||||
255.92521636876344 43.82007387041961 97.88436429460687 1 6
|
||||
213.24637065555936 9.976439066337804 103.604405672653 1 7
|
||||
3.400222808979685 43.39784965440255 347.8261034151001 1 8
|
||||
146.75362934444055 9.976439066337804 256.39559432734706 1 1
|
||||
356.59977719102034 43.39784965440254 12.173896584899923 1 2
|
||||
75.92521636876346 43.820073870419634 277.8843642946069 1 3
|
||||
326.7536293444406 9.976439066337804 76.39559432734708 1 4
|
||||
176.59977719102034 43.39784965440254 192.1738965848999 1 5
|
||||
255.92521636876344 43.82007387041961 97.88436429460688 1 6
|
||||
213.2463706555594 9.976439066337804 103.60440567265299 1 7
|
||||
3.4002228089796636 43.39784965440254 347.8261034151001 1 8
|
||||
284.0747836312365 43.82007387041961 82.11563570539313 1 9
|
||||
33.24637065555936 9.976439066337804 283.60440567265294 1 10
|
||||
183.40022280897963 43.397849654402556 167.8261034151001 1 11
|
||||
104.07478363123654 43.82007387041961 262.1156357053931 1 12
|
||||
273.4002228089796 43.397849654402556 77.82610341510008 1 13
|
||||
123.24637065555939 9.976439066337806 193.60440567265297 1 14
|
||||
194.07478363123653 43.82007387041961 172.11563570539317 1 15
|
||||
93.40022280897969 43.39784965440255 257.8261034151001 1 16
|
||||
303.24637065555936 9.976439066337804 13.604405672652977 1 17
|
||||
14.074783631236542 43.82007387041961 352.1156357053931 1 18
|
||||
86.59977719102032 43.39784965440254 282.17389658489986 1 19
|
||||
236.75362934444058 9.976439066337804 166.39559432734703 1 20
|
||||
165.92521636876344 43.82007387041961 187.88436429460683 1 21
|
||||
266.59977719102034 43.39784965440254 102.17389658489992 1 22
|
||||
56.75362934444064 9.976439066337804 346.395594327347 1 23
|
||||
345.9252163687635 43.82007387041961 7.884364294606862 1 24
|
||||
33.246370655559474 9.976439066337804 283.6044056726529 1 10
|
||||
183.40022280897966 43.39784965440254 167.8261034151001 1 11
|
||||
104.07478363123657 43.82007387041961 262.1156357053931 1 12
|
||||
273.4002228089796 43.39784965440254 77.82610341510009 1 13
|
||||
123.24637065555936 9.976439066337804 193.60440567265303 1 14
|
||||
194.07478363123653 43.82007387041961 172.11563570539315 1 15
|
||||
93.40022280897966 43.39784965440256 257.82610341510014 1 16
|
||||
303.2463706555593 9.976439066337804 13.604405672653055 1 17
|
||||
14.07478363123655 43.82007387041961 352.1156357053931 1 18
|
||||
86.59977719102034 43.39784965440254 282.17389658489986 1 19
|
||||
236.75362934444064 9.976439066337804 166.39559432734697 1 20
|
||||
165.92521636876347 43.82007387041961 187.88436429460683 1 21
|
||||
266.59977719102034 43.39784965440254 102.17389658489991 1 22
|
||||
56.75362934444067 9.976439066337804 346.395594327347 1 23
|
||||
345.9252163687635 43.82007387041961 7.8843642946068595 1 24
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
166.39559432734697 9.976439066337804 236.75362934444058 1 1
|
||||
352.1156357053931 43.82007387041961 14.074783631236542 1 2
|
||||
77.82610341510008 43.397849654402556 273.4002228089796 1 3
|
||||
346.395594327347 9.976439066337804 56.75362934444064 1 4
|
||||
172.11563570539317 43.82007387041961 194.07478363123653 1 5
|
||||
257.8261034151001 43.39784965440255 93.40022280897969 1 6
|
||||
193.604405672653 9.976439066337804 123.24637065555939 1 7
|
||||
7.884364294606862 43.82007387041961 345.9252163687635 1 8
|
||||
282.17389658489986 43.39784965440254 86.59977719102032 1 9
|
||||
13.604405672652977 9.976439066337804 303.24637065555936 1 10
|
||||
187.88436429460683 43.82007387041961 165.92521636876344 1 11
|
||||
102.17389658489992 43.39784965440254 266.59977719102034 1 12
|
||||
277.8843642946069 43.82007387041961 75.92521636876346 1 13
|
||||
103.604405672653 9.976439066337804 213.24637065555936 1 14
|
||||
192.17389658489986 43.397849654402556 176.59977719102034 1 15
|
||||
166.39559432734703 9.976439066337804 236.75362934444064 1 1
|
||||
352.1156357053931 43.82007387041961 14.07478363123654 1 2
|
||||
77.82610341510009 43.39784965440254 273.4002228089796 1 3
|
||||
346.3955943273471 9.976439066337804 56.75362934444052 1 4
|
||||
172.11563570539315 43.82007387041959 194.07478363123653 1 5
|
||||
257.8261034151001 43.39784965440256 93.40022280897968 1 6
|
||||
193.60440567265294 9.976439066337804 123.24637065555943 1 7
|
||||
7.884364294606861 43.82007387041961 345.9252163687635 1 8
|
||||
282.17389658489986 43.39784965440254 86.59977719102034 1 9
|
||||
13.60440567265293 9.976439066337804 303.2463706555594 1 10
|
||||
187.88436429460683 43.82007387041961 165.92521636876347 1 11
|
||||
102.17389658489991 43.39784965440254 266.59977719102034 1 12
|
||||
277.8843642946069 43.82007387041961 75.92521636876347 1 13
|
||||
103.60440567265306 9.976439066337804 213.2463706555593 1 14
|
||||
192.1738965848999 43.39784965440254 176.59977719102034 1 15
|
||||
97.88436429460687 43.82007387041961 255.92521636876344 1 16
|
||||
283.60440567265294 9.976439066337804 33.24637065555936 1 17
|
||||
12.173896584899929 43.39784965440254 356.59977719102034 1 18
|
||||
82.11563570539313 43.82007387041961 284.0747836312365 1 19
|
||||
283.60440567265294 9.976439066337804 33.24637065555943 1 17
|
||||
12.173896584899891 43.39784965440254 356.59977719102034 1 18
|
||||
82.11563570539315 43.82007387041961 284.0747836312365 1 19
|
||||
256.395594327347 9.976439066337804 146.75362934444064 1 20
|
||||
167.8261034151001 43.397849654402556 183.40022280897963 1 21
|
||||
262.1156357053931 43.82007387041961 104.07478363123654 1 22
|
||||
76.39559432734703 9.976439066337806 326.75362934444064 1 23
|
||||
347.8261034151001 43.39784965440255 3.400222808979685 1 24
|
||||
167.8261034151001 43.39784965440254 183.40022280897966 1 21
|
||||
262.1156357053931 43.82007387041958 104.07478363123656 1 22
|
||||
76.39559432734696 9.976439066337804 326.7536293444407 1 23
|
||||
347.8261034151001 43.39784965440256 3.4002228089796644 1 24
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
114.20342833932975 10.52877936550932 204.20342833932972 1 1
|
||||
94.3573968784815 80.40593177313954 311.22729452432543 1 2
|
||||
175.6426031215185 80.40593177313954 48.77270547567447 1 3
|
||||
155.79657166067025 10.52877936550932 155.79657166067025 1 4
|
||||
99.62136089109411 85.70366403943004 318.04510841542015 1 5
|
||||
170.37863910890587 85.70366403943002 41.954891584579855 1 6
|
||||
85.64260312151852 80.40593177313954 48.77270547567448 1 7
|
||||
65.79657166067024 10.52877936550932 155.79657166067025 1 8
|
||||
9.621360891094124 85.70366403943004 318.04510841542015 1 9
|
||||
80.37863910890587 85.70366403943004 41.95489158457987 1 10
|
||||
24.203428339329758 10.52877936550932 204.20342833932975 1 11
|
||||
4.357396878481486 80.40593177313954 311.2272945243255 1 12
|
||||
204.20342833932972 10.52877936550932 204.20342833932972 1 13
|
||||
184.35739687848147 80.40593177313954 311.2272945243255 1 14
|
||||
265.64260312151845 80.40593177313953 48.77270547567449 1 15
|
||||
245.79657166067025 10.528779365509317 155.79657166067025 1 16
|
||||
189.62136089109413 85.70366403943004 318.04510841542015 1 17
|
||||
260.3786391089059 85.70366403943002 41.954891584579855 1 18
|
||||
114.2034283393298 10.528779365509285 204.2034283393297 1 1
|
||||
94.35739687848151 80.40593177313954 311.2272945243255 1 2
|
||||
175.64260312151848 80.40593177313957 48.77270547567447 1 3
|
||||
155.79657166067022 10.528779365509285 155.79657166067028 1 4
|
||||
99.62136089109413 85.70366403943005 318.04510841542015 1 5
|
||||
170.37863910890584 85.70366403943002 41.95489158457988 1 6
|
||||
85.64260312151852 80.40593177313954 48.77270547567447 1 7
|
||||
65.79657166067024 10.528779365509285 155.79657166067025 1 8
|
||||
9.62136089109412 85.70366403943004 318.04510841542015 1 9
|
||||
80.37863910890589 85.70366403943004 41.95489158457986 1 10
|
||||
24.203428339329754 10.528779365509356 204.20342833932975 1 11
|
||||
4.357396878481504 80.40593177313954 311.22729452432554 1 12
|
||||
204.2034283393298 10.528779365509356 204.2034283393297 1 13
|
||||
184.35739687848152 80.40593177313954 311.2272945243255 1 14
|
||||
265.6426031215185 80.40593177313954 48.772705475674464 1 15
|
||||
245.79657166067025 10.528779365509285 155.79657166067025 1 16
|
||||
189.62136089109413 85.70366403943002 318.04510841542015 1 17
|
||||
260.3786391089059 85.70366403943002 41.95489158457986 1 18
|
||||
170.37863910890587 94.29633596056996 138.04510841542015 1 19
|
||||
99.62136089109411 94.29633596056998 221.95489158457983 1 20
|
||||
155.79657166067025 169.4712206344907 24.203428339329754 1 21
|
||||
99.62136089109411 94.29633596056996 221.95489158457985 1 20
|
||||
155.79657166067025 169.47122063449072 24.203428339329754 1 21
|
||||
175.64260312151848 99.59406822686046 131.22729452432552 1 22
|
||||
94.35739687848151 99.59406822686046 228.77270547567446 1 23
|
||||
114.20342833932975 169.4712206344907 335.7965716606702 1 24
|
||||
94.35739687848148 99.59406822686044 228.77270547567446 1 23
|
||||
114.20342833932965 169.4712206344907 335.79657166067017 1 24
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
96.91733794010702 83.13253115922213 314.5844440567886 1 1
|
||||
173.082662059893 83.13253115922211 45.41555594321143 1 2
|
||||
135.0 9.735610317245317 180.0 1 3
|
||||
263.082662059893 83.13253115922213 45.415555943211444 1 4
|
||||
186.91733794010702 83.13253115922211 314.5844440567886 1 5
|
||||
224.99999999999997 9.735610317245317 180.0 1 6
|
||||
83.082662059893 83.13253115922213 45.415555943211444 1 7
|
||||
6.917337940106983 83.13253115922211 314.5844440567886 1 8
|
||||
45.0 9.73561031724532 180.0 1 9
|
||||
13.638707279476469 45.81931182053557 80.40196970123216 1 10
|
||||
256.36129272052347 45.81931182053556 279.59803029876775 1 11
|
||||
315.0 99.73561031724536 0.0 1 12
|
||||
96.917337940107 83.13253115922213 314.5844440567886 1 1
|
||||
173.08266205989295 83.13253115922213 45.415555943211444 1 2
|
||||
135.00000000000003 9.735610317245321 179.99999999999997 1 3
|
||||
263.082662059893 83.13253115922213 45.41555594321144 1 4
|
||||
186.91733794010705 83.13253115922211 314.5844440567886 1 5
|
||||
224.99999999999997 9.735610317245396 180.00000000000003 1 6
|
||||
83.082662059893 83.13253115922213 45.41555594321142 1 7
|
||||
6.917337940107001 83.13253115922213 314.5844440567886 1 8
|
||||
45.000000000000036 9.735610317245321 179.99999999999994 1 9
|
||||
96.917337940107 96.86746884077787 225.41555594321142 1 10
|
||||
173.08266205989298 96.86746884077787 134.58444405678858 1 11
|
||||
135.0 170.26438968275468 0.0 1 12
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
135.41555594321144 83.13253115922213 173.082662059893 1 1
|
||||
260.26438968275465 90.0 135.0 1 2
|
||||
260.40196970123213 45.81931182053557 13.638707279476478 1 3
|
||||
314.5844440567886 83.13253115922213 96.91733794010702 1 4
|
||||
350.40196970123213 45.81931182053557 283.6387072794765 1 5
|
||||
170.26438968275465 90.0 224.99999999999997 1 6
|
||||
315.4155559432114 83.13253115922213 353.08266205989304 1 7
|
||||
99.73561031724536 90.0 225.0 1 8
|
||||
279.59803029876787 45.819311820535574 166.36129272052352 1 9
|
||||
134.58444405678856 83.13253115922213 276.91733794010696 1 10
|
||||
9.598030298767851 45.819311820535574 76.36129272052355 1 11
|
||||
9.735610317245369 90.0 315.0 1 12
|
||||
80.40196970123212 134.18068817946445 346.3612927205235 1 1
|
||||
45.41555594321142 96.86746884077787 276.91733794010696 1 2
|
||||
45.41555594321142 83.1325311592221 263.082662059893 1 3
|
||||
80.40196970123215 45.81931182053556 193.63870727947645 1 4
|
||||
224.58444405678856 96.86746884077789 83.08266205989298 1 5
|
||||
189.59803029876787 134.18068817946445 13.638707279476478 1 6
|
||||
189.59803029876787 45.81931182053558 166.36129272052355 1 7
|
||||
224.58444405678856 83.1325311592221 96.91733794010702 1 8
|
||||
350.26438968275465 44.999999999999986 0.0 1 9
|
||||
279.7356103172453 45.00000000000001 0.0 1 10
|
||||
260.26438968275465 44.999999999999986 0.0 1 11
|
||||
189.73561031724535 44.999999999999986 0.0 1 12
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
0.0 45.00000000000001 0.0 1 1
|
||||
90.0 45.00000000000001 270.0 1 2
|
||||
45.00000000000001 0.0 0.0 1 3
|
||||
90.0 90.00000000000003 44.99999999999999 1 1
|
||||
180.0 89.99999999999999 135.0 1 2
|
||||
45.0 0.0 0.0 1 3
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
283.60440567265294 9.976439066337804 33.24637065555936 1 1
|
||||
167.8261034151001 43.397849654402556 183.40022280897963 1 2
|
||||
262.1156357053931 43.82007387041961 104.07478363123654 1 3
|
||||
103.604405672653 9.976439066337804 213.24637065555936 1 4
|
||||
347.8261034151001 43.39784965440255 3.400222808979685 1 5
|
||||
283.60440567265294 9.976439066337804 33.246370655559446 1 1
|
||||
167.8261034151001 43.39784965440254 183.40022280897966 1 2
|
||||
262.1156357053931 43.820073870419634 104.07478363123656 1 3
|
||||
103.60440567265293 9.976439066337804 213.24637065555945 1 4
|
||||
347.8261034151001 43.39784965440254 3.400222808979658 1 5
|
||||
82.11563570539313 43.82007387041961 284.0747836312365 1 6
|
||||
76.39559432734703 9.976439066337806 326.75362934444064 1 7
|
||||
192.17389658489986 43.397849654402556 176.59977719102034 1 8
|
||||
76.39559432734703 9.976439066337804 326.7536293444406 1 7
|
||||
192.1738965848999 43.39784965440254 176.59977719102034 1 8
|
||||
97.88436429460687 43.82007387041961 255.92521636876344 1 9
|
||||
256.395594327347 9.976439066337804 146.75362934444064 1 10
|
||||
12.173896584899929 43.39784965440254 356.59977719102034 1 11
|
||||
277.8843642946069 43.82007387041961 75.92521636876346 1 12
|
||||
102.17389658489992 43.39784965440254 266.59977719102034 1 13
|
||||
346.395594327347 9.976439066337804 56.75362934444064 1 14
|
||||
7.884364294606862 43.82007387041961 345.9252163687635 1 15
|
||||
282.17389658489986 43.39784965440254 86.59977719102032 1 16
|
||||
166.39559432734703 9.976439066337804 236.75362934444058 1 17
|
||||
187.88436429460683 43.82007387041961 165.92521636876344 1 18
|
||||
257.8261034151001 43.39784965440255 93.40022280897969 1 19
|
||||
13.604405672652977 9.976439066337804 303.24637065555936 1 20
|
||||
352.1156357053931 43.82007387041961 14.074783631236542 1 21
|
||||
77.82610341510008 43.397849654402556 273.4002228089796 1 22
|
||||
193.60440567265297 9.976439066337806 123.24637065555939 1 23
|
||||
172.11563570539317 43.82007387041961 194.07478363123653 1 24
|
||||
256.39559432734706 9.976439066337804 146.75362934444055 1 10
|
||||
12.173896584899904 43.39784965440254 356.59977719102034 1 11
|
||||
277.8843642946069 43.82007387041961 75.92521636876344 1 12
|
||||
102.17389658489991 43.39784965440254 266.59977719102034 1 13
|
||||
346.395594327347 9.976439066337804 56.75362934444066 1 14
|
||||
7.884364294606855 43.82007387041961 345.9252163687635 1 15
|
||||
282.17389658489986 43.39784965440256 86.59977719102035 1 16
|
||||
166.39559432734697 9.976439066337804 236.7536293444407 1 17
|
||||
187.88436429460685 43.82007387041961 165.92521636876344 1 18
|
||||
257.82610341510014 43.39784965440254 93.40022280897966 1 19
|
||||
13.60440567265301 9.976439066337804 303.24637065555936 1 20
|
||||
352.1156357053931 43.82007387041961 14.074783631236537 1 21
|
||||
77.82610341510009 43.39784965440254 273.4002228089796 1 22
|
||||
193.604405672653 9.976439066337804 123.24637065555933 1 23
|
||||
172.11563570539315 43.82007387041961 194.07478363123653 1 24
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
303.24637065555936 9.976439066337804 13.604405672652977 1 1
|
||||
165.92521636876344 43.82007387041961 187.88436429460683 1 2
|
||||
303.24637065555936 9.976439066337804 13.604405672652986 1 1
|
||||
165.92521636876347 43.82007387041961 187.88436429460683 1 2
|
||||
266.59977719102034 43.39784965440254 102.17389658489992 1 3
|
||||
123.24637065555939 9.976439066337804 193.604405672653 1 4
|
||||
345.9252163687635 43.82007387041961 7.884364294606862 1 5
|
||||
86.59977719102032 43.39784965440254 282.17389658489986 1 6
|
||||
56.75362934444064 9.976439066337804 346.395594327347 1 7
|
||||
194.07478363123653 43.82007387041961 172.11563570539317 1 8
|
||||
93.40022280897969 43.39784965440255 257.8261034151001 1 9
|
||||
236.75362934444058 9.976439066337804 166.39559432734697 1 10
|
||||
14.074783631236542 43.82007387041961 352.1156357053931 1 11
|
||||
273.4002228089796 43.397849654402556 77.82610341510008 1 12
|
||||
123.2463706555595 9.976439066337804 193.60440567265286 1 4
|
||||
345.9252163687634 43.82007387041959 7.884364294606872 1 5
|
||||
86.59977719102034 43.39784965440256 282.17389658489986 1 6
|
||||
56.75362934444059 9.976439066337804 346.395594327347 1 7
|
||||
194.07478363123653 43.82007387041961 172.11563570539315 1 8
|
||||
93.40022280897968 43.39784965440254 257.8261034151001 1 9
|
||||
236.75362934444058 9.976439066337804 166.39559432734706 1 10
|
||||
14.074783631236523 43.82007387041961 352.1156357053931 1 11
|
||||
273.4002228089796 43.39784965440254 77.82610341510009 1 12
|
||||
104.07478363123654 43.82007387041961 262.1156357053931 1 13
|
||||
326.75362934444064 9.976439066337806 76.39559432734703 1 14
|
||||
3.400222808979685 43.39784965440255 347.8261034151001 1 15
|
||||
284.0747836312365 43.82007387041961 82.11563570539313 1 16
|
||||
146.75362934444064 9.976439066337804 256.395594327347 1 17
|
||||
183.40022280897963 43.397849654402556 167.8261034151001 1 18
|
||||
326.7536293444407 9.976439066337804 76.39559432734696 1 14
|
||||
3.4002228089796604 43.39784965440254 347.8261034151001 1 15
|
||||
284.0747836312365 43.82007387041961 82.11563570539316 1 16
|
||||
146.75362934444055 9.976439066337804 256.39559432734706 1 17
|
||||
183.40022280897966 43.39784965440254 167.8261034151001 1 18
|
||||
255.92521636876344 43.82007387041961 97.88436429460687 1 19
|
||||
33.24637065555936 9.976439066337804 283.60440567265294 1 20
|
||||
356.59977719102034 43.39784965440254 12.173896584899929 1 21
|
||||
75.92521636876346 43.82007387041961 277.8843642946069 1 22
|
||||
213.24637065555936 9.976439066337804 103.604405672653 1 23
|
||||
176.59977719102034 43.397849654402556 192.17389658489986 1 24
|
||||
356.59977719102034 43.39784965440254 12.173896584899905 1 21
|
||||
75.92521636876346 43.82007387041958 277.8843642946069 1 22
|
||||
213.2463706555593 9.976439066337804 103.60440567265306 1 23
|
||||
176.59977719102034 43.39784965440256 192.1738965848999 1 24
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
335.7965716606702 10.528779365509317 65.79657166067024 1 1
|
||||
228.77270547567446 80.40593177313953 85.64260312151849 1 2
|
||||
131.22729452432552 80.40593177313954 4.357396878481506 1 3
|
||||
24.20342833932977 10.52877936550932 24.20342833932976 1 4
|
||||
221.95489158457983 85.70366403943002 80.37863910890589 1 5
|
||||
138.04510841542015 85.70366403943004 9.621360891094124 1 6
|
||||
131.22729452432552 80.40593177313953 94.35739687848151 1 7
|
||||
24.203428339329765 10.52877936550932 114.20342833932976 1 8
|
||||
221.95489158457983 85.70366403943004 170.37863910890587 1 9
|
||||
138.04510841542015 85.70366403943004 99.62136089109411 1 10
|
||||
335.7965716606702 10.52877936550932 155.79657166067025 1 11
|
||||
228.77270547567448 80.40593177313954 175.6426031215185 1 12
|
||||
335.7965716606702 10.52877936550932 335.7965716606702 1 13
|
||||
228.77270547567448 80.40593177313954 355.6426031215185 1 14
|
||||
131.2272945243255 80.40593177313954 274.35739687848144 1 15
|
||||
24.203428339329747 10.52877936550932 294.2034283393298 1 16
|
||||
221.95489158457985 85.70366403943004 350.3786391089059 1 17
|
||||
138.04510841542015 85.70366403943004 279.6213608910941 1 18
|
||||
41.95489158457986 94.29633596056998 9.621360891094133 1 19
|
||||
318.04510841542015 94.29633596056996 80.37863910890589 1 20
|
||||
155.79657166067025 169.4712206344907 24.203428339329754 1 21
|
||||
48.77270547567448 99.59406822686046 4.357396878481504 1 22
|
||||
311.2272945243255 99.59406822686046 85.64260312151852 1 23
|
||||
204.20342833932975 169.4712206344907 65.79657166067024 1 24
|
||||
257.3335306934857 49.47122063449066 102.66646930651427 1 1
|
||||
131.22729452432554 80.40593177313957 4.357396878481523 1 2
|
||||
184.3573968784815 99.59406822686046 48.772705475674485 1 3
|
||||
24.20342833932965 10.528779365509285 24.20342833932986 1 4
|
||||
335.7965716606704 169.4712206344907 204.20342833932992 1 5
|
||||
175.6426031215185 80.40593177313954 228.77270547567446 1 6
|
||||
102.66646930651426 130.52877936550934 282.66646930651433 1 7
|
||||
228.77270547567448 99.59406822686046 184.35739687848152 1 8
|
||||
294.2034283393298 10.528779365509285 24.2034283393297 1 9
|
||||
94.35739687848152 99.59406822686047 48.772705475674485 1 10
|
||||
167.3335306934857 49.4712206344907 102.66646930651429 1 11
|
||||
41.22729452432552 80.40593177313954 4.3573968784814845 1 12
|
||||
12.666469306514255 130.5287793655093 282.6664693065143 1 13
|
||||
138.7727054756745 99.59406822686046 184.3573968784815 1 14
|
||||
245.79657166067028 169.4712206344907 204.20342833932978 1 15
|
||||
85.64260312151852 80.40593177313954 228.77270547567448 1 16
|
||||
165.61499741817968 137.86632049415985 83.58843092115008 1 17
|
||||
104.38500258182032 42.13367950584017 263.58843092115006 1 18
|
||||
189.62136089109413 85.70366403943004 138.04510841542015 1 19
|
||||
80.37863910890587 94.29633596056998 318.04510841542015 1 20
|
||||
350.3786391089059 94.29633596056996 318.04510841542015 1 21
|
||||
99.62136089109414 85.70366403943004 138.04510841542012 1 22
|
||||
14.385002581820302 42.13367950584017 263.5884309211501 1 23
|
||||
75.61499741817968 137.8663204941598 83.58843092115006 1 24
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
225.41555594321144 83.13253115922213 83.08266205989301 1 1
|
||||
134.58444405678856 83.13253115922211 6.917337940107012 1 2
|
||||
4.702125169424418e-15 9.735610317245317 45.0 1 3
|
||||
134.58444405678856 83.13253115922213 276.91733794010696 1 4
|
||||
225.4155559432114 83.13253115922213 353.082662059893 1 5
|
||||
0.0 9.735610317245317 315.0 1 6
|
||||
134.58444405678858 83.13253115922213 96.91733794010702 1 7
|
||||
225.41555594321142 83.13253115922213 173.082662059893 1 8
|
||||
0.0 9.735610317245317 135.0 1 9
|
||||
99.59803029876785 45.81931182053557 166.36129272052355 1 10
|
||||
260.40196970123213 45.81931182053556 283.6387072794765 1 11
|
||||
180.0 99.73561031724535 225.0 1 12
|
||||
99.59803029876785 45.81931182053558 346.3612927205235 1 1
|
||||
225.41555594321144 83.13253115922213 83.082662059893 1 2
|
||||
260.40196970123213 134.18068817946443 166.36129272052355 1 3
|
||||
134.58444405678856 96.86746884077786 263.08266205989304 1 4
|
||||
9.598030298767839 45.81931182053556 346.3612927205236 1 5
|
||||
135.41555594321142 83.13253115922213 83.08266205989298 1 6
|
||||
170.40196970123213 134.18068817946443 166.36129272052355 1 7
|
||||
44.58444405678856 96.86746884077789 263.082662059893 1 8
|
||||
170.26438968275465 45.00000000000003 179.99999999999997 1 9
|
||||
99.73561031724535 135.0 0.0 1 10
|
||||
9.735610317245337 135.00000000000003 0.0 1 11
|
||||
80.26438968275465 45.00000000000001 179.99999999999997 1 12
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
1_Eulers 2_Eulers 3_Eulers 1_pos 2_pos
|
||||
6.9173379401070045 83.13253115922213 44.58444405678856 1 1
|
||||
45.0 89.99999999999999 279.7356103172453 1 2
|
||||
166.36129272052352 45.819311820535574 279.59803029876787 1 3
|
||||
83.08266205989301 83.13253115922213 225.41555594321144 1 4
|
||||
256.3612927205235 45.819311820535574 189.59803029876787 1 5
|
||||
315.0 90.0 9.735610317245369 1 6
|
||||
186.917337940107 83.13253115922213 224.58444405678856 1 7
|
||||
315.0 90.0 80.26438968275463 1 8
|
||||
13.638707279476478 45.81931182053557 260.40196970123213 1 9
|
||||
263.082662059893 83.13253115922213 45.415555943211444 1 10
|
||||
103.63870727947646 45.819311820535574 170.40196970123213 1 11
|
||||
224.99999999999997 90.0 170.26438968275465 1 12
|
||||
180.0 44.999999999999986 189.73561031724537 1 1
|
||||
180.0 44.999999999999986 80.26438968275463 1 2
|
||||
179.99999999999994 135.0 80.26438968275464 1 3
|
||||
180.0 135.0 9.735610317245355 1 4
|
||||
90.0 44.999999999999986 260.26438968275465 1 5
|
||||
90.00000000000001 45.00000000000001 189.73561031724532 1 6
|
||||
90.0 135.0 9.735610317245342 1 7
|
||||
90.00000000000001 135.0 80.26438968275467 1 8
|
||||
135.0 90.0 99.73561031724536 1 9
|
||||
135.0 90.0 170.26438968275463 1 10
|
||||
45.0 90.0 350.26438968275465 1 11
|
||||
45.00000000000001 89.99999999999999 279.7356103172453 1 12
|
||||
|
|
BIN
python/tests/resources/Result/2phase_irregularGrid_tensionX_2phase_irregularGrid.material.hdf5
vendored
Normal file
BIN
python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_0.dream3d
vendored
Normal file
BIN
python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_40.dream3d
vendored
Normal file
|
@ -110,3 +110,11 @@ class TestCrystal:
|
|||
for r in crystal.orientation_relationships:
|
||||
crystal.relation_operations(r)
|
||||
|
||||
@pytest.mark.parametrize('crystal', [Crystal(lattice='cF'),
|
||||
Crystal(lattice='cI'),
|
||||
Crystal(lattice='hP')])
|
||||
def test_related_invalid_target(self,crystal):
|
||||
relationship = np.random.choice(crystal.orientation_relationships)
|
||||
with pytest.raises(ValueError):
|
||||
crystal.relation_operations(relationship,crystal)
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import pytest
|
||||
import numpy as np
|
||||
from itertools import permutations
|
||||
from matplotlib import pyplot as plt
|
||||
from PIL import Image
|
||||
|
||||
from damask import Rotation
|
||||
from damask import Orientation
|
||||
|
@ -304,13 +306,6 @@ class TestOrientation:
|
|||
with pytest.raises(ValueError):
|
||||
eval(f'o.{function}(np.ones(4))')
|
||||
|
||||
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])
|
||||
@pytest.mark.parametrize('lattice',['cF','cI'])
|
||||
def test_relationship_forward_backward(self,model,lattice):
|
||||
o = Orientation.from_random(lattice=lattice)
|
||||
for i,r in enumerate(o.related(model)):
|
||||
assert o.disorientation(r.related(model)[i]).as_axis_angle(degrees=True,pair=True)[1]<1.0e-5
|
||||
|
||||
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])
|
||||
@pytest.mark.parametrize('lattice',['cF','cI'])
|
||||
def test_relationship_reference(self,update,res_path,model,lattice):
|
||||
|
@ -527,3 +522,25 @@ class TestOrientation:
|
|||
def test_mul_invalid(self):
|
||||
with pytest.raises(TypeError):
|
||||
Orientation.from_random(lattice='cF')*np.ones(3)
|
||||
|
||||
@pytest.mark.parametrize('OR',['KS','NW','GT','GT_prime','Bain','Pitsch'])
|
||||
@pytest.mark.parametrize('pole',[[0,0,1],[0,1,1],[1,1,1]])
|
||||
def test_OR_plot(self,update,res_path,tmp_path,OR,pole):
|
||||
# https://doi.org/10.3390/cryst13040663 for comparison
|
||||
O = Orientation(lattice='cF')
|
||||
poles = O.related(OR).to_pole(uvw=pole,with_symmetry=True).reshape(-1,3)
|
||||
points = util.project_equal_area(poles,'z')
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
c = plt.Circle((0,0),1, color='k',fill=False)
|
||||
ax.add_patch(c)
|
||||
ax.scatter(points[:,0],points[:,1])
|
||||
ax.set_aspect('equal', 'box')
|
||||
fname=f'{OR}-{"".join(map(str,pole))}.png'
|
||||
plt.axis('off')
|
||||
plt.savefig(tmp_path/fname)
|
||||
if update: plt.savefig(res_path/fname)
|
||||
current = np.array(Image.open(tmp_path/fname))
|
||||
reference = np.array(Image.open(res_path/fname))
|
||||
assert np.allclose(current,reference)
|
||||
|
||||
|
|