47 |
|
end subroutine set_gb_pair_params |
48 |
|
|
49 |
|
|
50 |
< |
subroutine do_gb_pair(atom1, atom2, d, r, r2, u_l, pot, f, t, & |
50 |
> |
subroutine do_gb_pair(atom1, atom2, d, r, r2, sw, vpair, pot, u_l, f, t, & |
51 |
|
do_pot, do_stress) |
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) :: pot |
57 |
> |
real (kind=dp) :: pot, sw, vpair |
58 |
|
real (kind=dp), dimension(3,nLocal) :: u_l |
59 |
|
real (kind=dp), dimension(3,nLocal) :: f |
60 |
|
real (kind=dp), dimension(3,nLocal) :: t |
307 |
|
mess1 = gmu*R137 |
308 |
|
mess2 = R126*gb_mu*gmum |
309 |
|
|
310 |
< |
dUdx = 4.0d0*gb_eps*enu*(mess1*dBigRdx + mess2*dgpdx) |
311 |
< |
dUdy = 4.0d0*gb_eps*enu*(mess1*dBigRdy + mess2*dgpdy) |
312 |
< |
dUdz = 4.0d0*gb_eps*enu*(mess1*dBigRdz + mess2*dgpdz) |
310 |
> |
dUdx = 4.0d0*gb_eps*enu*(mess1*dBigRdx + mess2*dgpdx)*sw |
311 |
> |
dUdy = 4.0d0*gb_eps*enu*(mess1*dBigRdy + mess2*dgpdy)*sw |
312 |
> |
dUdz = 4.0d0*gb_eps*enu*(mess1*dBigRdz + mess2*dgpdz)*sw |
313 |
|
|
314 |
< |
dUdu1x = 4.0d0*(R126*depsdu1x + eps*R137*dBigRdu1x) |
315 |
< |
dUdu1y = 4.0d0*(R126*depsdu1y + eps*R137*dBigRdu1y) |
316 |
< |
dUdu1z = 4.0d0*(R126*depsdu1z + eps*R137*dBigRdu1z) |
317 |
< |
dUdu2x = 4.0d0*(R126*depsdu2x + eps*R137*dBigRdu2x) |
318 |
< |
dUdu2y = 4.0d0*(R126*depsdu2y + eps*R137*dBigRdu2y) |
319 |
< |
dUdu2z = 4.0d0*(R126*depsdu2z + eps*R137*dBigRdu2z) |
314 |
> |
dUdu1x = 4.0d0*(R126*depsdu1x + eps*R137*dBigRdu1x)*sw |
315 |
> |
dUdu1y = 4.0d0*(R126*depsdu1y + eps*R137*dBigRdu1y)*sw |
316 |
> |
dUdu1z = 4.0d0*(R126*depsdu1z + eps*R137*dBigRdu1z)*sw |
317 |
> |
dUdu2x = 4.0d0*(R126*depsdu2x + eps*R137*dBigRdu2x)*sw |
318 |
> |
dUdu2y = 4.0d0*(R126*depsdu2y + eps*R137*dBigRdu2y)*sw |
319 |
> |
dUdu2z = 4.0d0*(R126*depsdu2z + eps*R137*dBigRdu2z)*sw |
320 |
|
|
321 |
|
#ifdef IS_MPI |
322 |
|
f_Row(1,atom1) = f_Row(1,atom1) + dUdx |
384 |
|
|
385 |
|
if (do_pot) then |
386 |
|
#ifdef IS_MPI |
387 |
< |
pot_row(atom1) = pot_row(atom1) + 2.0d0*eps*R126 |
388 |
< |
pot_col(atom2) = pot_col(atom2) + 2.0d0*eps*R126 |
387 |
> |
pot_row(atom1) = pot_row(atom1) + 2.0d0*eps*R126*sw |
388 |
> |
pot_col(atom2) = pot_col(atom2) + 2.0d0*eps*R126*sw |
389 |
|
#else |
390 |
< |
pot = pot + 4.0*eps*R126 |
390 |
> |
pot = pot + 4.0*eps*R126*sw |
391 |
|
#endif |
392 |
|
endif |
393 |
+ |
|
394 |
+ |
vpair = vpair + 4.0*eps*R126 |
395 |
|
|
396 |
|
return |
397 |
|
end subroutine do_gb_pair |