Skip to content

Commit

Permalink
Do linear extrapolation in PsiContour.contourSfunc()
Browse files Browse the repository at this point in the history
This allows the 'orthogonal' Sfunc to do something sensible at the
targets when it is being used there because only the X-point is
'nonorthogonal'.
  • Loading branch information
johnomotani committed Aug 23, 2024
1 parent d802e50 commit a4659b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hypnotoad/core/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,8 +1697,11 @@ def contourSfunc(self, *, psi, kind="cubic"):
i,
[i <= 0.0, i >= thisEndInd - thisStartInd],
[
0.0,
endDistance - startDistance,
lambda i: i * (distance[thisStartInd + 1] - distance[thisStartInd]),
lambda i: endDistance
- startDistance
+ (i - thisEndInd + thisStartInd)
* (distance[thisEndInd] - distance[thisEndInd - 1]),
lambda i: interpS(i + thisStartInd) - startDistance,
],
)
Expand Down

0 comments on commit a4659b9

Please sign in to comment.