Skip to content

staggered derivatives #810

Description

@dschwoerer

if inloc is e.g. at YLOW, this produces a wrong result.

if ((vloc == CELL_XLOW) && (diffloc == CELL_CENTRE)) {

This is wrong if all locations are at CELL_CENTRE

if (StaggerGrids) {

Due to the code duplication, there are probably more cases where things are wrong.

I would suggest splitting the functions into smaller ones.
See e.g. https://github.com/dschwoerer/BOUT-dev/blob/ef41a53c04f6b349a63ac98038903b34b83a3a16/src/mesh/impls/aiolos/generated_derivs.cxx#L1672
After having determined whether we need staggered derivatives, it is much easier if you only need to consider that single case:
https://github.com/dschwoerer/BOUT-dev/blob/ef41a53c04f6b349a63ac98038903b34b83a3a16/src/mesh/impls/aiolos/generated_derivs.cxx#L1318

Further, I would be in favour of complete removing the StaggerGrids bool - which reduces and simplifies the code, without reducing its functionality. It further simplifies the use of BOUT. As this is a breaking change, we should probably wait till 5.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions