PolVec Subroutine

private subroutine PolVec(eel, x, y)

Perform matrix vector multiplication y = pol*x, where pol is polarizability vector, x and y are column vectors

Arguments

Type IntentOptional Attributes Name
type(ommp_electrostatics_type), intent(in) :: eel

The electostatic data structure

real(kind=rp), intent(in), dimension(3*eel%pol_atoms) :: x

Input vector

real(kind=rp), intent(out), dimension(3*eel%pol_atoms) :: y

Output vector


Contents

Source Code


Source Code

    subroutine PolVec(eel, x, y)
        !! Perform matrix vector multiplication y = pol*x,
        !! where pol is polarizability vector, x and y are 
        !! column vectors
        
        implicit none
        
        type(ommp_electrostatics_type), intent(in) :: eel
        !! The electostatic data structure 
        real(rp), dimension(3*eel%pol_atoms), intent(in) :: x
        !! Input vector
        real(rp), dimension(3*eel%pol_atoms), intent(out) :: y
        !! Output vector
        
        integer(ip) :: i, indx
        
        !$omp parallel do default(shared) private(indx,i)
        do i = 1, 3*eel%pol_atoms
            indx = (i+2)/3
            y(i) = eel%pol(indx)*x(i)   
        enddo
        
    end subroutine PolVec