61 |
|
|
62 |
|
end subroutine createMomentMap |
63 |
|
|
64 |
< |
subroutine do_dipole_pair(atom1, atom2, d, rij, r2, sw, vpair, pot, & |
65 |
< |
u_l, f, t, do_pot, do_stress) |
64 |
> |
subroutine do_dipole_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
65 |
> |
pot, u_l, f, t, do_pot) |
66 |
|
|
67 |
< |
logical :: do_pot, do_stress |
67 |
> |
logical :: do_pot |
68 |
|
|
69 |
|
integer atom1, atom2, me1, me2, id1, id2 |
70 |
|
integer :: localError |
75 |
|
real(kind=dp) :: sw, vpair, vterm |
76 |
|
|
77 |
|
real( kind = dp ) :: pot |
78 |
< |
real( kind = dp ), dimension(3) :: d |
78 |
> |
real( kind = dp ), dimension(3) :: d, fpair |
79 |
|
real( kind = dp ), dimension(3,nLocal) :: u_l |
80 |
|
real( kind = dp ), dimension(3,nLocal) :: f |
81 |
|
real( kind = dp ), dimension(3,nLocal) :: t |
196 |
|
t(3,atom2) = t(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x |
197 |
|
#endif |
198 |
|
|
199 |
– |
if (do_stress) then |
200 |
– |
|
199 |
|
#ifdef IS_MPI |
200 |
< |
id1 = tagRow(atom1) |
201 |
< |
id2 = tagColumn(atom2) |
200 |
> |
id1 = tagRow(atom1) |
201 |
> |
id2 = tagColumn(atom2) |
202 |
|
#else |
203 |
< |
id1 = atom1 |
204 |
< |
id2 = atom2 |
205 |
< |
#endif |
206 |
< |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
207 |
< |
|
208 |
< |
! because the d vector is the rj - ri vector, and |
209 |
< |
! because dudx, dudy, dudz are the (positive) force on |
210 |
< |
! atom i (negative on atom j) we need a negative sign here: |
211 |
< |
|
212 |
< |
tau_Temp(1) = tau_Temp(1) - d(1) * dudx |
215 |
< |
tau_Temp(2) = tau_Temp(2) - d(1) * dudy |
216 |
< |
tau_Temp(3) = tau_Temp(3) - d(1) * dudz |
217 |
< |
tau_Temp(4) = tau_Temp(4) - d(2) * dudx |
218 |
< |
tau_Temp(5) = tau_Temp(5) - d(2) * dudy |
219 |
< |
tau_Temp(6) = tau_Temp(6) - d(2) * dudz |
220 |
< |
tau_Temp(7) = tau_Temp(7) - d(3) * dudx |
221 |
< |
tau_Temp(8) = tau_Temp(8) - d(3) * dudy |
222 |
< |
tau_Temp(9) = tau_Temp(9) - d(3) * dudz |
223 |
< |
|
224 |
< |
virial_Temp = virial_Temp + & |
225 |
< |
(tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) |
226 |
< |
|
227 |
< |
endif |
203 |
> |
id1 = atom1 |
204 |
> |
id2 = atom2 |
205 |
> |
#endif |
206 |
> |
|
207 |
> |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
208 |
> |
|
209 |
> |
fpair(1) = fpair(1) + dudx |
210 |
> |
fpair(2) = fpair(2) + dudy |
211 |
> |
fpair(3) = fpair(3) + dudz |
212 |
> |
|
213 |
|
endif |
214 |
< |
|
214 |
> |
|
215 |
|
return |
216 |
|
end subroutine do_dipole_pair |
217 |
|
|