Skip to content

Should we recompute AbstractGridIntegerConstants every time? #103

Description

@pjaap

After editing, e.g., the cell regions for a given grid, grid[NumCellRegions] is not updated. See:

julia> grid = simplexgrid(0:10);

julia> num_cellregions(grid)
1

julia> grid[CellRegions][4] = 2 # edit something
2

julia> num_cellregions(grid) # still = 1
1

julia> trim!(grid) # remove pre-computed data

julia> num_cellregions(grid) # now it is correct again
2

For me, especially functions like num_cellregions should compute the current number of cell regions and not return a cached value.
So I vote for recomputing AbstranctGridIntegerConstant in every get_index call. Also rename the type to AbstractGridInteger, since this is not a constant.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions