diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 9744231a8..fc693d28c 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -950,9 +950,9 @@ def from_basis(basis: np.ndarray, if not orthonormal: (U,S,Vh) = np.linalg.svd(om) # singular value decomposition om = np.einsum('...ij,...jl',U,Vh) - elif not np.allclose(np.einsum('...i,...i',om[...,0],om[...,1]),0.) \ - or not np.allclose(np.einsum('...i,...i',om[...,1],om[...,2]),0.) \ - or not np.allclose(np.einsum('...i,...i',om[...,2],om[...,0]),0.): + elif (np.abs(np.einsum('...i,...i',om[...,0],om[...,1])) > 5.e-8).any() \ + or (np.abs(np.einsum('...i,...i',om[...,1],om[...,2])) > 5.e-8).any() \ + or (np.abs(np.einsum('...i,...i',om[...,2],om[...,0])) > 5.e-8).any(): raise ValueError('orientation matrix is not orthogonal') if not np.allclose(np.linalg.det(om),1.):