hex_zigzag_stripe Function

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


Calls

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

Called by

proc~~hex_zigzag_stripe~~CalledByGraph proc~hex_zigzag_stripe hex_geometries::hex_zigzag_stripe proc~get_stripe honeytools::get_stripe proc~get_stripe->proc~hex_zigzag_stripe

Source Code

   pure function hex_zigzag_stripe(height,width) result(hexagons)
      !! Build a zigzag-on-top honeycomb stripe/ribbon
      !! CONVERSION TO XY SITES REQUIRES ZIGZAG LAYOUT
      integer,intent(in)      :: height,width
      type(hex),allocatable   :: hexagons(:)
      integer                 :: i,j,offset
      do i = 1,height
         offset = floor(i/2.d0)
         do j = 1-offset,width-offset
            call hex_insert(hexagons,hex(i,j))
         enddo
      enddo
   end function hex_zigzag_stripe