Sibling child index obtained by reflecting c across face s (swap the half-index of the direction normal to s).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | s | |||
| integer, | intent(in) | :: | c |
pure function oc_reflect(s,c) result(rc)
!! Sibling child index obtained by reflecting c across face s (swap the half-index of
!! the direction normal to s).
implicit none
integer,intent(in) :: s,c
integer :: rc
integer,parameter :: xref(1:8) = [2,1,4,3,6,5,8,7] ! swap ax (s = 3,5)
integer,parameter :: yref(1:8) = [4,3,2,1,8,7,6,5] ! swap ay (s = 2,4)
integer,parameter :: zref(1:8) = [5,6,7,8,1,2,3,4] ! swap az (s = 1,6)
if(s == 1 .or. s == 6) then
rc = zref(c)
elseif(s == 2 .or. s == 4) then
rc = yref(c)
else
rc = xref(c)
endif
endfunction oc_reflect