-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix BoundaryAdaptedGrid
for only one central point
#281
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #281 +/- ##
=======================================
Coverage 91.58% 91.59%
=======================================
Files 35 35
Lines 5362 5364 +2
=======================================
+ Hits 4911 4913 +2
Misses 451 451
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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. I don't have a better idea than an if
statement for the special case.
Could you please bump the version in |
Done in ef87f47. |
Should I add a test for the case that |
Adding a test would be great 👍 The test should also cover the second issue that you have described
|
I added a test in 683dfc9. |
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 fixes two independent, but related issues regarding the
BoundaryAdaptedGrid
:due to
ERROR: ArgumentError: range(0.4999999999999999, stop=0.5, length=1): endpoints differ
. This is because there is only one inner point and due to rounding errors the left and right ends are not the same. I simply added an if-statement for this. Let me know if you have a better idea to handle this @ranocha.D = derivative_operator(MattssonAlmquistVanDerWeide2018Accurate(), 1, 4, 0.0, 1.0, 11)
already without the fix above) gives a result, butstep(grid)
gives zero, again, because there is only one point in theuniform_grid
. This results in an operator with mass_matrix equal to zero andInf
s andNaN
s for the entries ofMatrix(D)
. This modifies thestep
function for theBoundaryAdaptedGrid
to return the actual step also for this edge case.