Commit 1d005014 authored by aarograh's avatar aarograh
Browse files

Minor tweak to LineType APPROXEQA and Geom_Hex 1D<->2D index maps

parent ec997c89
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ ELEMENTAL FUNCTION hex_2D_to_1D(rings, row, col) RESULT(index)
  INTEGER(SIK) :: i

  index = 0
  DO i = hex_rows(rings),row+1,-1
  DO i = 1,row-1
    index = index + hex_columns(rings, i)
  ENDDO !i
  index = index + col
@@ -300,7 +300,7 @@ ENDFUNCTION hex_2D_to_1D
!> @brief Converts 1D hex array index to 2D indexes
!> @param rings the number of rings in the array
!> @param index the 1D hex array index
!> @returns indexes the 2D hex array indexes (col, row)
!> @returns indexes the 2D hex array indexes (row, col)
!>
!> The row index begins with the top row, but the 1D index begins with the bottom row.
!> The column index and 1D index both move left to right down the row.
@@ -319,7 +319,6 @@ PURE FUNCTION hex_1D_to_2D(rings, index) RESULT(indexes)
    indexes(1) = indexes(1) + 1
  ENDDO
  indexes(2) = i
  indexes(1) = hex_rows(rings) - indexes(1) + 1 !invert to match top->bottom row indexing

ENDFUNCTION hex_1D_to_2D
!
+5 −1
Original line number Diff line number Diff line
@@ -570,7 +570,11 @@ ELEMENTAL FUNCTION approxequal_LineType(l0,l1) RESULT(bool)
  TYPE(LineType),INTENT(IN) :: l0,l1
  LOGICAL(SBK) :: bool
  bool=.FALSE.
  IF(l0%p1 .APPROXEQA. l1%p1) bool=l0%p2 .APPROXEQA. l1%p2
  IF(l0%p1 .APPROXEQA. l1%p1) THEN
    bool=l0%p2 .APPROXEQA. l1%p2
  ELSEIF(l0%p1 .APPROXEQA. l1%p2) THEN
    bool=l0%p2 .APPROXEQA. l1%p1
  ENDIF
ENDFUNCTION approxequal_LineType
!
!-------------------------------------------------------------------------------