Skip to content

nodes() returns the full grid when given a smaller view of a Field #4729

@tomchor

Description

@tomchor

I'm not sure this is an issue per se, but I noticed that when a view of a Field is given to nodes() it always returns the nodes for the full grid, regardless of what the view is. For example:

julia> grid = RectilinearGrid(size=(8, 2, 2), extent=(1, 1, 1));

julia> c = XFaceField(grid);

julia> nodes(c)
(0.0:0.125:0.875, 0.25:0.5:0.75, -0.75:0.5:-0.25)

julia> nodes(view(c, 2:4, :, :))
(0.0:0.125:0.875, 0.25:0.5:0.75, -0.75:0.5:-0.25)

Looking at the code I see maybe this was always the intended the behavior, but I think it might be more useful to return the nodes corresponding to the indices of the view in this case. Curious about what everyone thinks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions