This routine compute the product between the diagonal of T matrix with x, and add it to y. The product is simply computed by each element of x for its inverse polarizability.
Type | Intent | Optional | 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 |
subroutine TMatVec_diag(eel, x, y)
!! This routine compute the product between the diagonal of T matrix
!! with x, and add it to y. The product is simply computed by
!! each element of x for its inverse polarizability.
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, ii
!$omp parallel do default(shared) private(i,ii)
do i=1, 3*eel%pol_atoms
ii = (i+2)/3
y(i) = y(i) + x(i) / eel%pol(ii)
end do
end subroutine TMatVec_diag