Maps receiver-face node indices (i,j) to donor-face node indices (i2,j2) for each of the eight SELF face flips (see the CGNStoSELFflip table above; indices here are 1-based, so the 0-based rule i2 = N-i1 reads i2 = N+2-i). Mortar staging uses this to reorient a small face's trace into the big face's coordinates and to scatter restricted traces back.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i | |||
| integer, | intent(in) | :: | j | |||
| integer, | intent(in) | :: | N | |||
| integer, | intent(in) | :: | flip | |||
| integer, | intent(out) | :: | i2 | |||
| integer, | intent(out) | :: | j2 |
pure subroutine MortarFaceMap(i,j,N,flip,i2,j2)
!! Maps receiver-face node indices (i,j) to donor-face node indices (i2,j2) for
!! each of the eight SELF face flips (see the CGNStoSELFflip table above; indices
!! here are 1-based, so the 0-based rule i2 = N-i1 reads i2 = N+2-i). Mortar
!! staging uses this to reorient a small face's trace into the big face's
!! coordinates and to scatter restricted traces back.
implicit none
integer,intent(in) :: i,j,N,flip
integer,intent(out) :: i2,j2
select case(flip)
case(0)
i2 = i
j2 = j
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 default ! flip == 7
i2 = j
j2 = N+2-i
endselect
endsubroutine MortarFaceMap