Skip to content

Hypnotoad-like corner data for gridue converter - #154

Merged
wearysebas merged 7 commits into
masterfrom
Hypnotoad-like-corner-data-gridue-converter
Nov 16, 2026
Merged

wearysebas merged 7 commits into
masterfrom
Hypnotoad-like-corner-data-gridue-converter

Conversation

@mrhardman

Copy link
Copy Markdown
Contributor

Changes to add the Rxy_*corners, Zxy_*corners variables to the gridue converter tool src/boutdata/gridue_to_bout_converter/gridue_to_bout.py.

Changes to the README.md due to actions bot e9b8477.

Corners were identified through discussion with chat-based LLM, and using the comment

    # Ordering for corners
    # (1) -- (3)
    #  |      |
    #  |  (0) |  -> Radial, BOUT++ "x"
    #  |      |
    # (2) -- (4)

and assuming that upper corresponds to the bottom row (not a typo), lower to the top row (not a typo), left to the left column, right to the right column:

    Rxy_corners = rm[:, :, 1].T
    Zxy_corners = zm[:, :, 1].T
    Rxy_lower_right_corners = rm[:, :, 3].T
    Zxy_lower_right_corners = zm[:, :, 3].T
    Rxy_upper_right_corners = rm[:, :, 4].T
    Zxy_upper_right_corners = zm[:, :, 4].T
    Rxy_upper_left_corners = rm[:, :, 2].T
    Zxy_upper_left_corners = zm[:, :, 2].T

A suggestion for a test that verifies this identification would be useful.

As far as I understand, the output necessarily has zero guards in y, hence, to enable other tools to read the netcdf file, I set the following variable.

f.write("y_boundary_guards", 0)

Note that some logic for removing guards in double null was being executed in single null cases cb3a81c.

@wearysebas wearysebas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I tested it against my UEDGE grids and got the same BOUT++ grids as before.

@wearysebas
wearysebas merged commit 0f9e58c into master Nov 16, 2026
3 of 4 checks passed
@wearysebas
wearysebas deleted the Hypnotoad-like-corner-data-gridue-converter branch November 16, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants