diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index dcc139b7c..7d6dee3ff 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -448,9 +448,12 @@ class Orientation(Rotation,Crystal): elif self.family == 'orthorhombic': return (np.prod(1. >= rho_abs,axis=-1)).astype(bool) elif self.family == 'monoclinic': - return (1. >= rho_abs[...,1]).astype(bool) + return np.logical_or( 1. >= rho_abs[...,1], + np.isnan(rho_abs[...,1])) + elif self.family == 'triclinic': + return np.ones(rho_abs.shape[:-1]).astype(bool) else: - return np.all(np.isfinite(rho_abs),axis=-1) + raise(TypeError, f'unknown symmetry "{self.family}"') @property diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 61529eb46..06f87abc5 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1372,7 +1372,7 @@ class Rotation: w[np.isclose(w[...,0],1.0+0.0j),1:] = 0. w[np.isclose(w[...,1],1.0+0.0j),2:] = 0. vr = np.swapaxes(vr,-1,-2) - ax = np.where(np.abs(diag_delta)<1e-12, + ax = np.where(np.abs(diag_delta)<1e-13, np.real(vr[np.isclose(w,1.0+0.0j)]).reshape(om.shape[:-2]+(3,)), np.abs(np.real(vr[np.isclose(w,1.0+0.0j)]).reshape(om.shape[:-2]+(3,))) \ *np.sign(diag_delta)) @@ -1581,14 +1581,19 @@ class Rotation: @staticmethod def _ho2ax(ho: np.ndarray) -> np.ndarray: """Homochoric vector to axis–angle pair.""" - tfit = np.array([+1.0000000000018852, -0.5000000002194847, - -0.024999992127593126, -0.003928701544781374, - -0.0008152701535450438, -0.0002009500426119712, - -0.00002397986776071756, -0.00008202868926605841, - +0.00012448715042090092, -0.0001749114214822577, - +0.0001703481934140054, -0.00012062065004116828, - +0.000059719705868660826, -0.00001980756723965647, - +0.000003953714684212874, -0.00000036555001439719544]) + tfit = np.array([ + 0.9999999999999968E0, -0.49999999999986866E0, + -0.025000000000632055E0, -0.003928571496460683E0, + -0.0008164666077062752E0, -0.00019411896443261646E0, + -0.00004985822229871769E0, -0.000014164962366386031E0, + -1.9000248160936107E-6, -5.72184549898506E-6, + 7.772149920658778E-6, -0.00001053483452909705E0, + 9.528014229335313E-6, -5.660288876265125E-6, + 1.2844901692764126E-6, 1.1255185726258763E-6, + -1.3834391419956455E-6, 7.513691751164847E-7, + -2.401996891720091E-7, 4.386887017466388E-8, + -3.5917775353564864E-9, + ]) hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True) s = np.sum(tfit*hmag_squared**np.arange(len(tfit)),axis=-1,keepdims=True) with np.errstate(invalid='ignore'): @@ -1679,7 +1684,7 @@ class Rotation: """ with np.errstate(invalid='ignore',divide='ignore'): - # get pyramide and scale by grid parameter ratio + # get pyramid and scale by grid parameter ratio XYZ = np.take_along_axis(cu,Rotation._get_pyramid_order(cu,'forward'),-1) * _sc order = np.abs(XYZ[...,1:2]) <= np.abs(XYZ[...,0:1]) q = np.pi/12.0 * np.where(order,XYZ[...,1:2],XYZ[...,0:1]) \