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

Don't transform inputs from field aligned by default?

Open johnomotani opened this issue 2 years ago • 4 comments

At the moment the default value of input:transform_from_field_aligned is true https://github.com/boutproject/BOUT-dev/blob/ab69d52f362dcaaddb22f3bd3b16aa7bab924d84/src/field/field_factory.cxx#L57-L58

I see two downsides:

  • This setting gives initial values that are discontinuous between SOL and PFR in the divertor legs (if they have z-dependence)
  • It is inconsistent with the behaviour when using FCI, as FCI cannot transform to/from field-aligned, so just skips this step.

There is also a comment in field_factory.cxx https://github.com/boutproject/BOUT-dev/blob/ab69d52f362dcaaddb22f3bd3b16aa7bab924d84/src/field/field_factory.cxx#L315-L316

Should we change the default to false for 5.0.0? I vote for yes.

johnomotani avatar Aug 26 '22 16:08 johnomotani

Note: if we change this, don't forget to update the docs in https://github.com/boutproject/BOUT-dev/blob/next/manual/sphinx/user_docs/variable_init.rst.

johnomotani avatar Aug 26 '22 16:08 johnomotani

false is probably better, yes, but I am a bit worried about breaking old input files. Does it make sense to warn if the default value is used? Or to perhaps add it to the input file upgrader, setting it explicitly to true if it doesn't exist?

ZedThree avatar Aug 26 '22 16:08 ZedThree

Yes I think when this flag was introduced the default was chosen to be true as this kept backwards compatibility but I can't see any problem with just setting this flag true in the examples etc. and documenting the change.

d7919 avatar Aug 26 '22 17:08 d7919

Or to perhaps add it to the input file upgrader, setting it explicitly to true if it doesn't exist?

This sounds ideal to me :+1:

johnomotani avatar Aug 26 '22 17:08 johnomotani