map_k_vec Function

private pure function map_k_vec(this, k_in) result(k_out)

Type Bound

lattice

Arguments

Type IntentOptional Attributes Name
class(lattice), intent(in) :: this
integer, intent(in) :: k_in(3)

Return Value integer, (3)


Contents

Source Code


Source Code

    pure function map_k_vec(this, k_in) result(k_out)
        class(lattice), intent(in) :: this
        integer, intent(in) :: k_in(3)
        integer :: k_out(3)

        integer :: i

        k_out = k_in

        if (this%inside_bz(k_in)) then
            k_out = k_in

        else
            ! here i have to do something..
            ! should i store this matrix to setup the lattice within the
            ! lattice class? so i can reuse it here..
            ! or i apply the primitive vectors to the k_vec and check if
            ! a resulting vector lies within the first BZ..
            i = 1
            k_out = k_in
            do while (.not. this%inside_bz(k_out))
                ! apply all possible basis vectors of the lattice
                k_out = this%apply_basis_vector(k_in, i)
                i = i + 1
            end do
        end if

    end function map_k_vec