| 47 |
|
end subroutine set_gb_pair_params |
| 48 |
|
|
| 49 |
|
|
| 50 |
< |
subroutine do_gb_pair(atom1, atom2, d, r, r2, sw, vpair, pot, u_l, f, t, & |
| 51 |
< |
do_pot, do_stress) |
| 50 |
> |
subroutine do_gb_pair(atom1, atom2, d, r, r2, sw, vpair, fpair, & |
| 51 |
> |
pot, u_l, f, t, do_pot) |
| 52 |
|
|
| 53 |
|
integer, intent(in) :: atom1, atom2 |
| 54 |
|
integer :: id1, id2 |
| 55 |
|
real (kind=dp), intent(inout) :: r, r2 |
| 56 |
|
real (kind=dp), dimension(3), intent(in) :: d |
| 57 |
+ |
real (kind=dp), dimension(3), intent(inout) :: fpair |
| 58 |
|
real (kind=dp) :: pot, sw, vpair |
| 59 |
|
real (kind=dp), dimension(3,nLocal) :: u_l |
| 60 |
|
real (kind=dp), dimension(3,nLocal) :: f |
| 61 |
|
real (kind=dp), dimension(3,nLocal) :: t |
| 62 |
< |
logical, intent(in) :: do_pot, do_stress |
| 62 |
> |
logical, intent(in) :: do_pot |
| 63 |
|
real (kind = dp), dimension(3) :: ul1 |
| 64 |
|
real (kind = dp), dimension(3) :: ul2 |
| 65 |
|
|
| 352 |
|
t(2,atom2) = t(2,atom2) - ul2(3)*dUdu2x + ul2(1)*dUdu2z |
| 353 |
|
t(3,atom2) = t(3,atom2) - ul2(1)*dUdu2y + ul2(2)*dUdu2x |
| 354 |
|
#endif |
| 355 |
< |
|
| 355 |
< |
if (do_stress) then |
| 356 |
< |
|
| 357 |
< |
#ifdef IS_MPI |
| 358 |
< |
id1 = tagRow(atom1) |
| 359 |
< |
id2 = tagColumn(atom2) |
| 360 |
< |
#else |
| 361 |
< |
id1 = atom1 |
| 362 |
< |
id2 = atom2 |
| 363 |
< |
#endif |
| 364 |
< |
|
| 365 |
< |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
| 366 |
< |
|
| 367 |
< |
! because the d vector is the rj - ri vector, and |
| 368 |
< |
! because dUdx, dUdy, dUdz are the force on atom i, we need a |
| 369 |
< |
! negative sign here: |
| 370 |
< |
|
| 371 |
< |
tau_Temp(1) = tau_Temp(1) - d(1) * dUdx |
| 372 |
< |
tau_Temp(2) = tau_Temp(2) - d(1) * dUdy |
| 373 |
< |
tau_Temp(3) = tau_Temp(3) - d(1) * dUdz |
| 374 |
< |
tau_Temp(4) = tau_Temp(4) - d(2) * dUdx |
| 375 |
< |
tau_Temp(5) = tau_Temp(5) - d(2) * dUdy |
| 376 |
< |
tau_Temp(6) = tau_Temp(6) - d(2) * dUdz |
| 377 |
< |
tau_Temp(7) = tau_Temp(7) - d(3) * dUdx |
| 378 |
< |
tau_Temp(8) = tau_Temp(8) - d(3) * dUdy |
| 379 |
< |
tau_Temp(9) = tau_Temp(9) - d(3) * dUdz |
| 380 |
< |
|
| 381 |
< |
virial_Temp = virial_Temp + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) |
| 382 |
< |
endif |
| 383 |
< |
endif |
| 384 |
< |
|
| 355 |
> |
|
| 356 |
|
if (do_pot) then |
| 357 |
|
#ifdef IS_MPI |
| 358 |
|
pot_row(atom1) = pot_row(atom1) + 2.0d0*eps*R126*sw |
| 363 |
|
endif |
| 364 |
|
|
| 365 |
|
vpair = vpair + 4.0*eps*R126 |
| 366 |
+ |
fpair(1) = fpair(1) + dUdx |
| 367 |
+ |
fpair(2) = fpair(2) + dUdy |
| 368 |
+ |
fpair(3) = fpair(3) + dUdz |
| 369 |
|
|
| 370 |
|
return |
| 371 |
|
end subroutine do_gb_pair |