Skip to content

Resolve "Implement hexagonal grid"

Utopia Developers requested to merge 256-implement-hexagonal-grid into master

What does this MR do?

This MR implements a pointy-topped hexagonal grid in even row offset geometry. It uses the template provided and tests the same things as the square grid.

The implementation follows this documentation.

Is there something that needs to be double checked?

Hexagonal grids do not cover a square non-periodic space entirely, because of their offset geometry. Here, a cutoff is implemented, such that in periodic BC the space is uniformly covered with (N_x = resolution * Width, N_y = resolution * Height / 0.75) cells. Non-periodic space is not uniformly covered and last column of cells is half-cut.

Is this ok? Yes, see discussion below.

Can this MR be accepted?

  • Implemented the changes
    • the hexagonal grid in pointy topped and even row offset
    • consider flat-topped and odd offset (have been removed in 185b8e6a)
    • hexagonal neighborhood
    • data writing and import in utopya
    • visualization via .ca.state plot
  • Added or extended tests
    • hexagonal grid c++ tests as for square grid
    • hexagonal / empty neighborhood c++ tests on hex grid
    • Use case in SEIRD model @herdeanu
  • Checked test code coverage on new and adjusted code
  • Added or updated documentation
  • Reasonably up-to-date with current master
  • Pipeline passing without warnings
  • Squash option set
  • Set labels to pick this MR into support branches
  • Approved by @blsqr (with discussions resolved)
  • Approved by anyone else (if interested and time permitting)

Related issues

Closes #256 (closed)

Edited by Utopia Developers

Merge request reports