BOUT-dev icon indicating copy to clipboard operation
BOUT-dev copied to clipboard

Potentially missing `/ dy` in `Coordinates::DDY`?

Open ZedThree opened this issue 10 months ago • 4 comments

This bit of code: https://github.com/boutproject/BOUT-dev/blob/51e53f80fac4a40cd63e961ae9223e348c437b99/src/mesh/coordinates.cxx#L1499-L1510

L1506 is missing the division by dy -- does anyone know if this is deliberate, and if so, why?

ZedThree avatar Mar 05 '25 14:03 ZedThree

Looks like a bug to me.

bshanahan avatar Mar 05 '25 15:03 bshanahan

@totork did you notice this in your MMS tests? Can you verify whether you hit this case?

I also think this is a bug ... likely this branch was never hit in the MMS tests ...

One possible fix is to change

     return bout::derivatives::index::DDY(f_parallel, outloc, method, region); 

to

     return DDY(f_parallel, outloc, method, region); 

dschwoerer avatar Mar 05 '25 15:03 dschwoerer

Could we move the 3D metric specific bit into the index derivative?

ZedThree avatar Mar 05 '25 15:03 ZedThree

Probably a good idea 👍

dschwoerer avatar Mar 05 '25 15:03 dschwoerer