FlipIndex Subroutine

public pure subroutine FlipIndex(i, j, flip, N, i2, j2)

Index (i2,j2) on the sending face that supplies node (i,j) of the receiving face, for the receiving side's flip in 0..7. Identical to the mapping in SideExchange_MappedScalar3D_t and ApplyFlip_MappedScalar3D_t.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: i
integer, intent(in) :: j
integer, intent(in) :: flip
integer, intent(in) :: N
integer, intent(out) :: i2
integer, intent(out) :: j2

Called by

proc~~flipindex~~CalledByGraph proc~flipindex FlipIndex proc~exchangeoutbox_setinterface3d_t ExchangeOutbox_SetInterface3D_t proc~exchangeoutbox_setinterface3d_t->proc~flipindex

Contents

Source Code


Source Code

  pure subroutine FlipIndex(i,j,flip,N,i2,j2)
    !! Index (i2,j2) on the sending face that supplies node (i,j) of the receiving face,
    !! for the receiving side's flip in 0..7. Identical to the mapping in
    !! SideExchange_MappedScalar3D_t and ApplyFlip_MappedScalar3D_t.
    implicit none
    integer,intent(in) :: i,j,flip,N
    integer,intent(out) :: i2,j2

    select case(flip)
    case(1)
      i2 = N+2-i; j2 = j
    case(2)
      i2 = N+2-i; j2 = N+2-j
    case(3)
      i2 = i; j2 = N+2-j
    case(4)
      i2 = j; j2 = i
    case(5)
      i2 = N+2-j; j2 = i
    case(6)
      i2 = N+2-j; j2 = N+2-i
    case(7)
      i2 = j; j2 = N+2-i
    case default
      i2 = i; j2 = j
    endselect

  endsubroutine FlipIndex