ammarhakim / gkylzero

Lowest, compiled layer of Gkeyll infrastructure.
MIT License
22 stars 5 forks source link

Fix an error in the eval_cubic_wgrad2 function #487

Closed akashukla closed 1 month ago

akashukla commented 1 month ago

This is a bug fix that affects mirror geometry on the magnetic axis. Before commit 4ce1631, there was a memory error that obscured this issue. When @manauref was trying to run mirror calculations post this commit, he noticed the error. We have tracked it back to this mistake which fixes the issue.

Error in the eval_cubic_wgrad2 function in dg_basis_ops: Accidentally returned only one of the second derivatives and the mixed partial rather than both second derivatives and the mixed partial. (This is for the 2x case). This was breaking on axis calculation of bmag for the mirror.

This wgrad2 function is supposed to return f, d^2f/dx^2, d^2f/dy^2, and d^2f/dxdy which it now does.