Sibling child index obtained by reflecting c across side s (swap the y-half for the horizontal faces S/N, the x-half for the vertical faces E/W).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | s | |||
| integer, | intent(in) | :: | c |
pure function qt_reflect(s,c) result(rc)
!! Sibling child index obtained by reflecting c across side s (swap the y-half for the
!! horizontal faces S/N, the x-half for the vertical faces E/W).
implicit none
integer,intent(in) :: s,c
integer :: rc
integer,parameter :: vref(1:4) = [4,3,2,1] ! swap ay (s = 1,3)
integer,parameter :: href(1:4) = [2,1,4,3] ! swap ax (s = 2,4)
if(s == 1 .or. s == 3) then
rc = vref(c)
else
rc = href(c)
endif
endfunction qt_reflect