qt_reflect Function

public 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).

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: s
integer, intent(in) :: c

Return Value integer


Called by

proc~~qt_reflect~~CalledByGraph proc~qt_reflect qt_reflect proc~faceneighbor_quadtreemesh2d FaceNeighbor_QuadTreeMesh2D proc~faceneighbor_quadtreemesh2d->proc~qt_reflect proc~faceneighbor_quadtreemesh2d->proc~faceneighbor_quadtreemesh2d

Contents

Source Code


Source Code

  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