mirror_vec Function

public function mirror_vec(in_vec, mirror_axis) result(out_vec)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: in_vec(3)
character(len=1), intent(in) :: mirror_axis

Return Value integer, (3)


Contents

Source Code


Source Code

    function mirror_vec(in_vec, mirror_axis) result(out_vec)
        integer, intent(in) :: in_vec(3)
        character(1), intent(in) :: mirror_axis
        integer :: out_vec(3)

        select case (mirror_axis)
        case ('x')
            out_vec(1:2) = nint(matmul(mirror_x, real(in_vec(1:2))))

        case ('y')
            out_vec(1:2) = nint(matmul(mirror_y, real(in_vec(1:2))))

        case ('d')
            out_vec(1:2) = nint(matmul(mirror_d, real(in_vec(1:2))))

        case ('o')
            out_vec(1:2) = nint(matmul(mirror_o, real(in_vec(1:2))))

        case ('0')
            out_vec = in_vec

        case Default

            call stop_all("mirror_vec", "incorrect mirroring axis!")

        end select

        out_vec(3) = in_vec(3)

    end function mirror_vec