hex_flake Function

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, (:)


Calls

proc~~hex_flake~~CallsGraph proc~hex_flake hex_geometries::hex_flake proc~hex_insert hex_geometries::hex_insert proc~hex_flake->proc~hex_insert

Called by

proc~~hex_flake~~CalledByGraph proc~hex_flake hex_geometries::hex_flake proc~get_flake honeytools::get_flake proc~get_flake->proc~hex_flake

Source Code

   pure function hex_flake(radius) result(hexagons)
      !! Build a hexagon-shaped honeycomb flake
      integer,intent(in)      :: radius
      type(hex),allocatable   :: hexagons(:)
      integer                 :: i,j
      do i = -radius,+radius
         do j = max(-radius,-i-radius),min(radius,-i+radius)
            call hex_insert(hexagons,hex(i,j))
         enddo
      enddo
   end function hex_flake