tem_assign_rotatedNeighbors_ref2d Function

public function tem_assign_rotatedNeighbors_ref2d(iCase) result(sourceCoord)

Sets the source coordinate for the rotated unit cube

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iCase

Return Value integer, (3,4)

source coordinates


Source Code

  function tem_assign_rotatedNeighbors_ref2d( iCase ) result( sourceCoord )
    ! ---------------------------------------------------------------------------
    !>
    integer, intent(in)    :: iCase
    !> source coordinates
    integer  :: sourceCoord(3,4)
    ! ---------------------------------------------------------------------------

    sourceCoord = 0
    select case( iCase )
    case( 1)
      ! Child num 1: 0.75 0.75
      sourceCoord(:, 1) = (/ 1, 1, 0 /)
      sourceCoord(:, 2) = (/ 0, 1, 0 /)
      sourceCoord(:, 3) = (/ 1, 0, 0 /)
      sourceCoord(:, 4) = (/ 0, 0, 0 /)
    case( 2)
      ! Child num 2: 0.25 0.75
      sourceCoord(:, 1) = (/ 0, 1, 0 /)
      sourceCoord(:, 2) = (/ 0, 0, 0 /)
      sourceCoord(:, 3) = (/ 1, 1, 0 /)
      sourceCoord(:, 4) = (/ 1, 0, 0 /)
    case( 3)
      ! Child num 3: 0.75 0.25
      sourceCoord(:, 1) = (/ 1, 0, 0 /)
      sourceCoord(:, 2) = (/ 1, 1, 0 /)
      sourceCoord(:, 3) = (/ 0, 0, 0 /)
      sourceCoord(:, 4) = (/ 0, 1, 0 /)
    case( 4)
      ! Child num 4: 0.25 0.25
      sourceCoord(:, 1) = (/ 0, 0, 0 /)
      sourceCoord(:, 2) = (/ 1, 0, 0 /)
      sourceCoord(:, 3) = (/ 0, 1, 0 /)
      sourceCoord(:, 4) = (/ 1, 1, 0 /)
    case( 5)
      ! Child num 1: 0.75 0.75
      sourceCoord(:, 1) = (/ 1, 1, 1 /)
      sourceCoord(:, 2) = (/ 0, 1, 1 /)
      sourceCoord(:, 3) = (/ 1, 0, 1 /)
      sourceCoord(:, 4) = (/ 0, 0, 1 /)
    case( 6)
      ! Child num 2: 0.25 0.75
      sourceCoord(:, 1) = (/ 0, 1, 1 /)
      sourceCoord(:, 2) = (/ 0, 0, 1 /)
      sourceCoord(:, 3) = (/ 1, 1, 1 /)
      sourceCoord(:, 4) = (/ 1, 0, 1 /)
    case( 7)
      ! Child num 3: 0.75 0.25
      sourceCoord(:, 1) = (/ 1, 0, 1 /)
      sourceCoord(:, 2) = (/ 1, 1, 1 /)
      sourceCoord(:, 3) = (/ 0, 0, 1 /)
      sourceCoord(:, 4) = (/ 0, 1, 1 /)
    case( 8)
      ! Child num 4: 0.25 0.25
      sourceCoord(:, 1) = (/ 0, 0, 1 /)
      sourceCoord(:, 2) = (/ 1, 0, 1 /)
      sourceCoord(:, 3) = (/ 0, 1, 1 /)
      sourceCoord(:, 4) = (/ 1, 1, 1 /)
    end select

   end function tem_assign_rotatedNeighbors_ref2d