Skip to content

Commit

Permalink
Merge branch 'relax-orthonormal-check' into 'development'
Browse files Browse the repository at this point in the history
relax tolerances to avoid failing tests

See merge request damask/DAMASK!943
  • Loading branch information
dmentock committed May 27, 2024
2 parents d4d0fe8 + 69cb476 commit 1e47c36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/damask/_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.):
Expand Down

0 comments on commit 1e47c36

Please sign in to comment.