Add reverse_current to tokamak_example.py#206
Conversation
johnomotani
left a comment
There was a problem hiding this comment.
Looks good to me. @mikekryjak up to you if you want to address the comment.
| parser.add_argument("--ny", type=int, default=65) | ||
| parser.add_argument("--np", "--number-of-processors", type=int, default=-1) | ||
| parser.add_argument("--no-plot", action="store_true", default=False) | ||
| parser.add_argument("--reverse-current", action="store_true", default=False) |
There was a problem hiding this comment.
If this example only works properly with the current reversed, maybe we want to default to doing this, so make the command line flag --no-reverse-current and reverse the current unless the user passes this flag?
There was a problem hiding this comment.
I didn't want to break anything else that this example is used for. If you can't think of anything, then happy to do this.
There was a problem hiding this comment.
As far as I know this example isn't used in production for anything, or for tests (apart from a test that it runs at all), so I think it should be fine. Anyway, better to have a more usable solution than stick to the existing one just for historical consistency - something like this I think is low risk and if it affects anyone they can raise an issue.
|
Added a new commit, mostly to trigger the CI jobs (which had been suspended due to inactivity on the repo). Added the option to manually trigger CI, which would have been useful now! |
…ject/hypnotoad into examples-reverse-current
|
@johnomotani I fixed the |
|
The LDN topology has the opposite psi sign to the other examples: hypnotoad/examples/tokamak/tokamak_example.py Lines 52 to 55 in a3fe3a5 I'd like to make it consistent but I'm wondering if this was done on purpose. @bendudson do you remember if this is required? |
tokamak_example.pyis a precious resource because it can generate example grids of all topologies. We need this for all kinds of tests in Hermes-3, xBOUT and xHermes.Unfortunately, the COCOS convention is such that you get warnings about negative
Jdue to a negativedxwhen you run with the grids.This PR adds the flag--reverse-currenttotokamak_example.pywhich passes it to the yaml input file. This flips thepsidirection and allows it to be run.This PR changes the default current direction in the YAML files for the examples. There is now a new flag
--original-cocosto disablereverse_current. There is also a new flag called--no-guardsto generate a grid without guard cells.doc/whats-new.mdwith a summary of the changes