hex_geometries Module

Provide common honeycomb geometries, as dynamic type(hex) arrays


Uses

  • module~~hex_geometries~~UsesGraph module~hex_geometries hex_geometries assert_m assert_m module~hex_geometries->assert_m module~hex_coordinates hex_coordinates module~hex_geometries->module~hex_coordinates module~hex_layout hex_layout module~hex_geometries->module~hex_layout module~hex_coordinates->assert_m

Used by

  • module~~hex_geometries~~UsedByGraph module~hex_geometries hex_geometries module~honeytools honeytools module~honeytools->module~hex_geometries

Functions

public pure function hex_supercell(rows, cols) result(hexagons)

Build a honeycomb supercell (parallelogram)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: rows
integer, intent(in) :: cols

Return Value type(hex), (rows*cols)

public pure function hex_triangle(size) result(hexagons)

Build a triangle-shaped honeycomb flake

Arguments

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

Return Value type(hex), allocatable, (:)

public pure function hex_flake(radius) result(hexagons)

Build a hexagon-shaped honeycomb flake

Arguments

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

Return Value type(hex), allocatable, (:)

public pure function hex_armchair_stripe(height, width) result(hexagons)

Build a armchair-on-top honeycomb stripe/ribbon CONVERSION TO XY SITES REQUIRES ARMCHAIR LAYOUT

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: height
integer, intent(in) :: width

Return Value type(hex), allocatable, (:)

public pure function hex_zigzag_stripe(height, width) result(hexagons)

Build a zigzag-on-top honeycomb stripe/ribbon CONVERSION TO XY SITES REQUIRES ZIGZAG LAYOUT

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: height
integer, intent(in) :: width

Return Value type(hex), allocatable, (:)

public pure function hex_line(A, B) result(line)

Draw a line between A and B, in hex space

Arguments

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

Return Value type(hex), allocatable, (:)

private pure elemental function linear_interpolation(a, b, t) result(l)

Linear interpolation from a to b, with step t a + (b - a) * t = a * (1-t) + b * t for better floating-point precision

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: a
real(kind=8), intent(in) :: b
real(kind=8), intent(in) :: t

Return Value real(kind=8)

private pure function hex_round(xyz) result(qrs)

Round a triplet of reals to a proper hex object

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=8), intent(in) :: xyz(3)

Return Value type(hex)


Subroutines

public pure subroutine hex_insert(vec, val)

Utility to grow type(hex) arrays, it is a poor man implementation of a dynamic array insertion, a là std::vector (but with no preallocation and smart doubling...)

Arguments

Type IntentOptional Attributes Name
type(hex), intent(inout), allocatable :: vec(:)
type(hex), intent(in) :: val