ascot4fusion / ascot5

ASCOT5 is a high-performance orbit-following code for fusion plasma physics and engineering
https://ascot4fusion.github.io/ascot5/
GNU Lesser General Public License v3.0
21 stars 6 forks source link

2D wall leaks when first and last points in the input are not the same #93

Closed miekkasarki closed 4 months ago

miekkasarki commented 4 months ago

The wall intersection algorithm omits the last segment if it is not explicitly given. This is bad since the documentation forbids using data where first point == last point. I've now fixed this so that from the intersection algorithm perspective it doesn't matter whether that points are same or not (it always assumes the data is a closed polygon).