Skip to content

Should we recompute AbstractGridIntegerConstants every time? #103

@pjaap

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions