-
Notifications
You must be signed in to change notification settings - Fork 3
production
johnomotani edited this page May 10, 2021
·
1 revision
To make 'production' grids that are as accurate and reproducible as possible:
- Increase
finecontour_Nfine
. A value of 1000 is suggested (as this is significantly higher than the poloidal resolution of most grids, so should result in distance betweenFineContour
points very small compared to variation of the poloidal magnetic field, and therefore a high accuracy for things like calculation of arc-length distance along the contour). Large values will increase run time significantly. - Use
refine_method = line
(and notnewton+integrate
orintegrate
). The line-search algorithm is more robust to small errors because it restricts the refinement to a 1d lines perpendicular to contours, rather than using a 2d search.- The
line
option can result in iteration failures. In some cases these can be resolved by increasing therefine_width
- values as high as 0.1 have been found to be reasonable.
- The
- Make all the
*_rtol
and*_atol
options as small as possible while avoiding convergence errors. See the integrated tests for values that may be suitable: https://github.com/boutproject/hypnotoad/blob/master/integrated_tests/connected_doublenull_orthogonal/test_orthogonal.yml, https://github.com/boutproject/hypnotoad/blob/master/integrated_tests/connected_doublenull_nonorthogonal/test_nonorthogonal.yml
Note that these settings will tend to make grid generation slower, so should be used as a final step, after all other options (number of points, psi-ranges, etc.) have been set to suitable values.
To check the robustness of grid generation, you could try calling hypnotoad_geqdsk.main()
with the add_noise
argument (whose value is an int
to use as the seed of a random number generator) to add machine-precision level noise, as is done in the *_with_rounding_error*
integrated tests, see https://github.com/boutproject/hypnotoad/blob/master/integrated_tests/utils.py. This should result in a grid file with only very small differences from one produced without add_noise
.