Skip to content

Target/limiter plates are plotted half a grid point off from where they should be #169

Open
@johnomotani

Description

@johnomotani

At the moment when the targets are plotted, they are drawn along the line of the first/last grid points in the y-direction.

if list(da_region.regions.values())[0].connection_lower_y is None:
# lower target exists
x_target = da_region.coords[x].isel(**{ycoord: y_boundary_guards})
y_target = da_region.coords[y].isel(**{ycoord: y_boundary_guards})
[line] = ax.plot(x_target, y_target, "k-", linewidth=2)
if hatching:
_add_hatching(line, ax)
if list(da_region.regions.values())[0].connection_upper_y is None:
# upper target exists
x_target = da_region.coords[x].isel(**{ycoord: -y_boundary_guards - 1})
y_target = da_region.coords[y].isel(**{ycoord: -y_boundary_guards - 1})
[line] = ax.plot(x_target, y_target, "k-", linewidth=2)
if hatching:
_add_hatching(line, ax, reversed=True)

They should really be half way between the end-most grid point and the first boundary point (to be consistent with BOUT++ boundary conditions definitions). This should be straightforward if we have the y boundary cells, but requires an extrapolation if they are not present.

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