init_basis_vecs_rect_base Subroutine

private subroutine init_basis_vecs_rect_base(this, l)

Base function for setting up a the basis vector array for rectangular lattices (extracted from the previous init_basis_vecs_rect) @param[in] l Maximal number of unit vectors to be combined into a basis vector

Type Bound

rectangle

Arguments

Type IntentOptional Attributes Name
class(rectangle), intent(inout) :: this
integer, intent(in) :: l

Contents


Source Code

    subroutine init_basis_vecs_rect_base(this,l)
        class(rectangle), intent(inout) :: this
        integer, intent(in) :: l

        integer :: i,j,k

        if (allocated(this%basis_vecs)) deallocate(this%basis_vecs)
        allocate(this%basis_vecs((2*l+1)**2,3))
        this%basis_vecs = 0
        k = 0
        do i = -l, l
            do j = -l, l
                k = k + 1
                this%basis_vecs(k, :) = i * this%k_vec(:, 1) + j * this%k_vec(:, 2)
            end do
        end do

    end subroutine init_basis_vecs_rect_base