-
Notifications
You must be signed in to change notification settings - Fork 0
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
Always export final solution #118
Conversation
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 for this @ddundo.
Please could you use reversed
instead of np.flip
? Good to use Python build-ins rather than external packages, where possible.
Could you also do the same thing in adjoint.py
?
Ah sorry @jwallwork23, tunnel vision here! I was looking into Shouldn't it be |
This should be ready for a re-review now @jwallwork23 :) I also made the change I mention in the above comment. It looked like a bug to me |
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 very much for this @ddundo! Your bugfix and test tweaks make sense to me.
Just two very minor requests. If you fix those then feel free to merge.
goalie/mesh_seq.py
Outdated
for j, block in zip( | ||
range(num_exports - 1), reversed(solve_blocks[::-stride]) | ||
): |
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.
One final thing for conciseness: could we switch this to
for j, block in enumerate(reversed(solve_blocks[::-stride])):
so that it (hopefully) fits on one line? My attention was brought to this because I was concerned that zip
doesn't care if the iterables have different lengths so might be skipping some iterations, but the check above ensures things are okay.
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.
Nice! Done in eb187c0
goalie/adjoint.py
Outdated
for j, block in zip( | ||
range(num_exports - 1), reversed(solve_blocks[::-stride]) | ||
): |
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.
Similarly here.
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.
Done in eb187c0
Thanks Joe! I did as you suggested and will merge :) |
Closes #106
With this PR the final solution of each subinterval always gets exported, instead of the first one.
Also tagging @stephankramer and @acse-ej321 for awareness :)