对所有实粒子粒子进行非正则化密度求和
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particle_type), | intent(inout) | :: | particle |
区域 |
||
| type(nnps_pairs_type), | intent(in) | :: | pairs |
粒子对 |
||
| integer, | intent(in) | :: | n |
实弹性粒子数 |
subroutine denormalized_density_summation(particle, pairs, n)
type(particle_type), intent(inout) :: particle !! 区域
type(nnps_pairs_type), intent(in) :: pairs !! 粒子对
integer, intent(in) :: n !! 实弹性粒子数 \( N_{real} \)
integer :: i
particle%rho(:n) = skf_obj%selfden*particle%mass(:n) ! 计算自身对密度的影响,并初始化当前步长密度值
do i = 1, pairs%len ! 计算密度求和
associate (ip => pairs%items(2*i - 1), jp => pairs%items(2*i))
if (ip <= n .and. jp <= n) then
if (particle%itype(ip) /= particle%itype(jp)) cycle
particle%rho(ip) = particle%rho(ip) + particle%mass(jp)*pairs%wdwdx(1, i)
particle%rho(jp) = particle%rho(jp) + particle%mass(ip)*pairs%wdwdx(1, i)
end if
end associate
end do
end subroutine denormalized_density_summation