This subroutine compute the interaction tensor (rank 3) between two polarizable sites i and j. This tensor is built according to the following rules: ... TODO
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ommp_electrostatics_type), | intent(inout) | :: | eel |
The electostatic data structure for which the interaction tensor should be computed |
||
integer(kind=ip), | intent(in) | :: | i |
Index (in the list of polarizable sites) of the source site |
||
integer(kind=ip), | intent(in) | :: | j |
Index (in the list of polarizable sites) of the target site |
||
real(kind=rp), | intent(out), | dimension(3, 3) | :: | tens |
Interaction tensor between sites i and j |
subroutine dipole_T(eel, i, j, tens)
!! This subroutine compute the interaction tensor (rank 3) between
!! two polarizable sites i and j.
!! This tensor is built according to the following rules: ... TODO
use mod_electrostatics, only: screening_rules, damped_coulomb_kernel
use mod_constants, only: eps_rp
implicit none
!
! Compute element of the polarization tensor TTens between
! polarizable cpol atom I and polarizable cpol atom J. On the
! TTens diagonal (I=J) are inverse polarizabilities and on the
! off-diagonal dipole field.
!
! Polarizabilities pol are defined for polarizable atoms only while
! Thole factors are defined for all of them
type(ommp_electrostatics_type), intent(inout) :: eel
!! The electostatic data structure for which the
!! interaction tensor should be computed
integer(ip), intent(in) :: i
!! Index (in the list of polarizable sites) of the source site
integer(ip), intent(in) :: j
!! Index (in the list of polarizable sites) of the target site
real(rp), dimension(3, 3), intent(out) :: tens
!! Interaction tensor between sites i and j
real(rp) :: dr(3)
real(rp) :: kernel(3), scalf
logical :: to_do, to_scale
integer(ip) :: ii, jj
tens = 0.0_rp
if(i == j) then
tens(1, 1) = 1.0_rp / eel%pol(i)
tens(2, 2) = 1.0_rp / eel%pol(i)
tens(3, 3) = 1.0_rp / eel%pol(i)
else
scalf = screening_rules(eel, i, 'P', j, 'P', '-')
if(abs(scalf) > eps_rp) then
call damped_coulomb_kernel(eel, eel%polar_mm(i), &
eel%polar_mm(j), 2, kernel, dr)
! Fill the matrix elemets
do ii=1, 3
do jj=1, 3
if(ii == jj) then
tens(ii, ii) = kernel(2) - 3.0_rp * kernel(3) * dr(ii) ** 2
else
tens(jj, ii) = -3.0_rp * kernel(3) * dr(ii) * dr(jj)
end if
end do
end do
! Scale if needed
if(abs(scalf-1.0) > eps_rp) tens = tens * scalf
end if
end if
end subroutine dipole_T