hex_supercell Function

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)


Called by

proc~~hex_supercell~~CalledByGraph proc~hex_supercell hex_geometries::hex_supercell proc~get_supercell honeytools::get_supercell proc~get_supercell->proc~hex_supercell

Source Code

   pure function hex_supercell(rows,cols) result(hexagons)
      !! Build a honeycomb supercell (parallelogram)
      integer,intent(in)   :: rows,cols
      type(hex)            :: hexagons(rows*cols)
      integer              :: i,j,k
      k = 0
      do i = 1,rows
         do j = 1,cols
            k = k + 1
            hexagons(k) = hex(q=i,r=j)
         enddo
      enddo
   end function hex_supercell