Repository navigation
Fix Rotate partials when rotate_x is off - #471
Open
umutKaracelebi wants to merge 1 commit into
Open
umutKaracelebi wants to merge 1 commit into
umutKaracelebi wants to merge 1 commit into
Conversation
The reference axis dependence of the leading and trailing edge blocks of d(mesh)/d(in_mesh) was only assigned inside the rotate_x branch, so with rotate_x=False those entries stayed zero while the finite-difference Jacobian is non-zero. Assign them regardless of rotate_x and add regression tests for both symmetry settings.
umutKaracelebi
requested review from
sabakhshi
and
a balanced review from Copilot
November 19, 2026 23:58
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotate.compute_partialsonly assigned the reference-axis dependence of the leading and trailing edge blocks ofd(mesh)/d(in_mesh)inside theif rotate_x:branch, so withrotate_x=Falsethose entries stayed zero while the finite-difference Jacobian is non-zero (up to 3.9e-2 in the test mesh). Any gradient-based optimization using this option got wrong mesh sensitivities.The term does not depend on a rotation about x: the reference axis still moves the LE and TE points, so
(I - R) * dq/d(mesh)belongs outside the branch. Only thedtheta_xcontribution is now conditional. Thedel_n/nn2/nn3indices are computed up front since they do not depend onrotate_xeither.Added
test_rotate_without_x_rotationand its symmetry variant, which fail with a 1.0 relative error onmeshwrtin_meshbefore the change. All existing rotate tests are unchanged.python -m pytest tests -q --ignore-glob="*mphys*"-> 190 passed, 13 skipped (mphys tests skipped,mphysnot installed).Fixes #452