Prevent user set negative cell dimension
I'm running some 1D cases and setting the parallel cell width dy using an analytical expression in the input file. Through a typo in the expression I managed to get a region where dy was negative, and I was surprised that BOUT++ seems to have no issues with accepting this and running with it.
Does anyone know of any situation where a negative cell width would be beneficial? If not, then maybe there should be a check that raises an exception as this would help in debugging analytical grids.
What check level did you run with?
Not sure - I've never looked into check levels, so I guess the default value.
The checks would only be needed at initialisation, so I think it would make sense to do them at any check level, like we do for metric components, etc. which use bout::checkFinite() which runs at any check level.
https://github.com/boutproject/BOUT-dev/blob/3d6cb4b7da6605e2d39828f07ece36c8d3886bcd/include/bout/field.hxx#L233-L255