hex_triangle Function

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


Calls

proc~~hex_triangle~~CallsGraph proc~hex_triangle hex_geometries::hex_triangle assert assert proc~hex_triangle->assert proc~hex_insert hex_geometries::hex_insert proc~hex_triangle->proc~hex_insert

Called by

proc~~hex_triangle~~CalledByGraph proc~hex_triangle hex_geometries::hex_triangle proc~get_triangle honeytools::get_triangle proc~get_triangle->proc~hex_triangle

Source Code

   pure function hex_triangle(size) result(hexagons)
      !! Build a triangle-shaped honeycomb flake
      integer,intent(in)      :: size
      type(hex),allocatable   :: hexagons(:)
      integer                 :: i,j
      call assert(size>1,"triangle size > 1",size)
      do i = 0,size
         do j = 0,size-i
            call hex_insert(hexagons,hex(i,j))
         enddo
      enddo
   end function hex_triangle