PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
98 stars 26 forks source link

Improve missing quadrature weight warning to lead users to compute on uniform grid #1193

Open unalmis opened 3 months ago

unalmis commented 3 months ago

The changes aren't good because currently iota_r will be computed on your non-uniform straight field line grid sfl_grid, which will be signficantly less accurate do to worse convergence properties of the quadrature.

To notify you of this, the code raised a warning saying that sfl_grid doesn't have the proper quadrature weights to perform the integration, that is the _spacing attribute is missing. The patch of adding quadrature weights to the grid will suppress this warning, but it's a bad choice to do the quadrature on a grid with non-uniform spacing.

I have created a new issue to update the warning to suggest users toward computing things on a uniform grid first when they see this warning, rather than trying to construct quadrature weights on a non-uniform grid.

_Originally posted by @unalmis in https://github.com/PlasmaControl/DESC/pull/1170#discussion_r1717355554

dpanici commented 3 months ago

GIve an example here and then point warning to this issue

dpanici commented 3 weeks ago

bump