-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another perp fix #362
Another perp fix #362
Conversation
…g replace dictionary
… another_perp_fix
… another_perp_fix
…n provided in data directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just one minor thing about adding a comment.
I think it would also be good to update the PR name and description to say that this also now includes all the changes to the replace_*
routines.
@JHopeCollins are you able to edit the PR description to include a bit about what changed in your branch? |
I've added a description of those additions and a link to my original PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this also looks good now!
This fixes the issue that ufl.replace doesn't replace perp(u) on the plane (because it doesn't see the relationship between [u0, u1] and [-u1, u0]). The fix is to label the terms for which this is a problem and then the Gusto replace functions pass perp(u) to ufl.replace.
This includes a test comparing to benchmarked known good values.
This PR also includes the edits introduced in #325. That PR refactors the logic in
replace_{test,trial,subject}
for building the dictionary to pass toufl.replace
. This simplifies the logic a bit (most type checking is deferred toufl
instead of being carried out by gusto), and allows it to be share between the three functions. It also adds the ability to pass an index toreplace_{test,trial}
when the new and/or old value is from a mixed space, which was previously only possible withreplace_subject
.