Skip to content

+ handle rotation matrix ambiguities#20

Open
SteSeg wants to merge 2 commits intoopenmc-dev:mainfrom
SteSeg:check-rotation
Open

+ handle rotation matrix ambiguities#20
SteSeg wants to merge 2 commits intoopenmc-dev:mainfrom
SteSeg:check-rotation

Conversation

@SteSeg
Copy link
Contributor

@SteSeg SteSeg commented Dec 11, 2024

While converting some benchmarks we were finding some issues with quadric surface rotations. Apparently, in the case of 45 degrees rotation and degenerate eigenvalues of the coefficient matrix numpy does not know how to unambiguously order the eigenvectors in the rotation matrix. @davidepettinari and I think we have found a solution to this and we added a function able to reorder the rotation matrix according to two criteria. First the eigenvectors are ordered so their element with the highest absolute value stand on the diagonal. Then, if there is still ambiguity, it orders the ambiguous eigenvectors left in order to achieve orthogonality.

We went from this (not meshable):

image

To this (meshable):

image

@SteSeg
Copy link
Contributor Author

SteSeg commented Dec 11, 2024

Just rewrote the function to explicitly make sure the built rotation matrix is also right handed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant