hex_neighbors Module

Defining nearest neighbors for given hex coordinates


Uses

  • module~~hex_neighbors~~UsesGraph module~hex_neighbors hex_neighbors module~hex_coordinates hex_coordinates module~hex_neighbors->module~hex_coordinates assert_m assert_m module~hex_coordinates->assert_m

Used by

  • module~~hex_neighbors~~UsedByGraph module~hex_neighbors hex_neighbors module~honeyplots honeyplots module~honeyplots->module~hex_neighbors module~honeytools honeytools module~honeytools->module~hex_neighbors

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: N = 6

Functions

public pure function hex_direction(idir) result(dir)

Return a direction in pseudo-3D hex space, given a (signed) integer label

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idir

Return Value type(hex)

public pure function hex_hop(H, i) result(Ni)

Return the nearest neighbor of H, by hopping in the i-th direction. You can feed any i ∈ ℤ, but you'd get only 6 inequivalent neighbors

Arguments

Type IntentOptional Attributes Name
type(hex), intent(in) :: H
integer, intent(in) :: i

Return Value type(hex)

public pure function hex_nearest(H) result(nnvec)

Return the vector of all nearest hex_neighbors of hex H

Arguments

Type IntentOptional Attributes Name
type(hex), intent(in) :: H

Return Value type(hex), dimension(N)