-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remaining bugs with duplicate nodes, add grid developer guide #409
Conversation
A list of bugs fixes follows. Note that the use case is rather narrow, which is why it wasn't detected by previous tests, and is unlikely to affect most stuff. - Fixed issue where theta and zeta surface integrals on grids with duplicate node at 0 and 2 pi (or 2 pi/NFP) (e.g. when endpoint=True) computed a value that was off by a factor of 2 only on the surface at 0 and 2 pi. All other surfaces were computed correctly. In other words, 2 elements of the returned array of length grid.num_surface_label were off by factor 2. - More massaging of inputs so that the grid class works with weird inputs. This is required for correctness of some of the algorithms, but unlikely to be the cause of any bugs as a runtime error would have been raised immediately. - Added logic so LinearGrids with duplicate nodes and symmetry have correct weights and spacing. - If the user supplies an incorrect marker for endpoint, for example by providing endpoint=False to the LinearGrid constructor while also providing arrays with nodes that include a duplicate endpoint, the weights would be computed incorrectly. This was fixed so that the correct weights are computed regardless of the user's trickery. - Many more tests.
Codecov ReportBase: 93.59% // Head: 93.60% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #409 +/- ##
=======================================
Coverage 93.59% 93.60%
=======================================
Files 68 68
Lines 14039 14055 +16
=======================================
+ Hits 13140 13156 +16
Misses 899 899
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,1225 @@ | |||
{ |
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.
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.
Do you mean that in the sense that
If we wanted to compute the actual area of a
When I mention "node area" in this document I am just referring to the product of the differential elements in the columns of grid.spacing
for the row associated with that node. For a
I think that is an invariant the grid should try to keep. That way when we supply a Jacobian factor in the integral, whether that be for an area or volume, we know that the integral covers the entire domain.
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.
Yeah I was thinking of it like the area in the computational domain which in this case is a disk, so the area should be pi. But I can see your point as well about keeping the Jacobian separate. I'm fine with it if everyone else is.
- fix markdown headings so that every section does not show up as a new website on the documentation page - clarify why duplicate node algorithm is correct - document that line integrals overweight duplicate nodes by square root of the duplicity. The easy fix is documented in the grid docs. But it requires a new grid.spacing.
Squash bugs
A list of bug fixes follows. The use case that would uncover these bugs is rather narrow, which is why it wasn't detected by previous tests, and is unlikely to affect most stuff. All of these bugs involve duplicate nodes, however, none of them were introduced by Duplicate node spacing #386 . This PR just finds bugs that were missed by that one.
In other words, 2 elements of the returned array of length
grid.num_surface_label
were off by factor 2.LinearGrid
s with duplicate nodes andsymmetry
have correct weights and spacing.endpoint=False
to theLinearGrid
constructor while also providing arrays with nodes that include a duplicate endpoint, the weights would be computed incorrectly. This was fixed so that the correct weights are computed regardless of the user's tricks.Add bug catchers
Add bug repellent
grid.py
to developer guide explaining everything with nice visuals