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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| integer, | intent(in) | :: | flip | |||
| integer, | intent(in) | :: | N | |||
| integer, | intent(out) | :: | i2 | |||
| integer, | intent(out) | :: | j2 |
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