9 |
|
!! @author Matthew Meineke |
10 |
|
!! @author Christopher Fennel |
11 |
|
!! @author J. Daniel Gezelter |
12 |
< |
!! @version $Id: calc_sticky_pair.F90,v 1.13 2003-08-27 16:16:01 tim Exp $, $Date: 2003-08-27 16:16:01 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $ |
12 |
> |
!! @version $Id: calc_sticky_pair.F90,v 1.19 2004-05-24 21:03:25 gezelter Exp $, $Date: 2004-05-24 21:03:25 $, $Name: not supported by cvs2svn $, $Revision: 1.19 $ |
13 |
|
|
14 |
|
module sticky_pair |
15 |
|
|
74 |
|
return |
75 |
|
end subroutine set_sticky_params |
76 |
|
|
77 |
< |
subroutine do_sticky_pair(atom1, atom2, d, rij, r2, A, pot, f, t, & |
78 |
< |
do_pot, do_stress) |
79 |
< |
|
77 |
> |
subroutine do_sticky_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
78 |
> |
pot, A, f, t, do_pot) |
79 |
> |
|
80 |
|
!! This routine does only the sticky portion of the SSD potential |
81 |
|
!! [Chandra and Ichiye, J. Chem. Phys. 111, 2701 (1999)]. |
82 |
|
!! The Lennard-Jones and dipolar interaction must be handled separately. |
83 |
< |
|
83 |
> |
|
84 |
|
!! We assume that the rotation matrices have already been calculated |
85 |
|
!! and placed in the A array. |
86 |
|
|
89 |
|
integer, intent(in) :: atom1, atom2 |
90 |
|
real (kind=dp), intent(inout) :: rij, r2 |
91 |
|
real (kind=dp), dimension(3), intent(in) :: d |
92 |
< |
real (kind=dp) :: pot |
93 |
< |
real (kind=dp), dimension(9,getNlocal()) :: A |
94 |
< |
real (kind=dp), dimension(3,getNlocal()) :: f |
95 |
< |
real (kind=dp), dimension(3,getNlocal()) :: t |
96 |
< |
logical, intent(in) :: do_pot, do_stress |
92 |
> |
real (kind=dp), dimension(3), intent(inout) :: fpair |
93 |
> |
real (kind=dp) :: pot, vpair, sw |
94 |
> |
real (kind=dp), dimension(9,nLocal) :: A |
95 |
> |
real (kind=dp), dimension(3,nLocal) :: f |
96 |
> |
real (kind=dp), dimension(3,nLocal) :: t |
97 |
> |
logical, intent(in) :: do_pot |
98 |
|
|
99 |
|
real (kind=dp) :: xi, yi, zi, xj, yj, zj, xi2, yi2, zi2, xj2, yj2, zj2 |
100 |
|
real (kind=dp) :: r3, r5, r6, s, sp, dsdr, dspdr |
119 |
|
return |
120 |
|
endif |
121 |
|
|
122 |
+ |
|
123 |
|
if ( rij .LE. SSD_rbig ) then |
124 |
|
|
125 |
|
r3 = r2*rij |
181 |
|
wjp = zjf*zjf*zjs*zjs - SSD_w0 |
182 |
|
wp = wip + wjp |
183 |
|
|
184 |
+ |
vpair = vpair + 0.5d0*(SSD_v0*s*w + SSD_v0p*sp*wp) |
185 |
|
if (do_pot) then |
186 |
|
#ifdef IS_MPI |
187 |
< |
pot_row(atom1) = pot_row(atom1) + 0.25d0*(SSD_v0*s*w + SSD_v0p*sp*wp) |
188 |
< |
pot_col(atom2) = pot_col(atom2) + 0.25d0*(SSD_v0*s*w + SSD_v0p*sp*wp) |
187 |
> |
pot_row(atom1) = pot_row(atom1) + 0.25d0*(SSD_v0*s*w + SSD_v0p*sp*wp)*sw |
188 |
> |
pot_col(atom2) = pot_col(atom2) + 0.25d0*(SSD_v0*s*w + SSD_v0p*sp*wp)*sw |
189 |
|
#else |
190 |
< |
pot = pot + 0.5d0*(SSD_v0*s*w + SSD_v0p*sp*wp) |
190 |
> |
pot = pot + 0.5d0*(SSD_v0*s*w + SSD_v0p*sp*wp)*sw |
191 |
|
#endif |
192 |
|
endif |
193 |
|
|
229 |
|
! do the torques first since they are easy: |
230 |
|
! remember that these are still in the body fixed axes |
231 |
|
|
232 |
< |
txi = 0.5d0*(SSD_v0*s*dwidux + SSD_v0p*sp*dwipdux) |
233 |
< |
tyi = 0.5d0*(SSD_v0*s*dwiduy + SSD_v0p*sp*dwipduy) |
234 |
< |
tzi = 0.5d0*(SSD_v0*s*dwiduz + SSD_v0p*sp*dwipduz) |
232 |
> |
txi = 0.5d0*(SSD_v0*s*dwidux + SSD_v0p*sp*dwipdux)*sw |
233 |
> |
tyi = 0.5d0*(SSD_v0*s*dwiduy + SSD_v0p*sp*dwipduy)*sw |
234 |
> |
tzi = 0.5d0*(SSD_v0*s*dwiduz + SSD_v0p*sp*dwipduz)*sw |
235 |
|
|
236 |
< |
txj = 0.5d0*(SSD_v0*s*dwjdux + SSD_v0p*sp*dwjpdux) |
237 |
< |
tyj = 0.5d0*(SSD_v0*s*dwjduy + SSD_v0p*sp*dwjpduy) |
238 |
< |
tzj = 0.5d0*(SSD_v0*s*dwjduz + SSD_v0p*sp*dwjpduz) |
236 |
> |
txj = 0.5d0*(SSD_v0*s*dwjdux + SSD_v0p*sp*dwjpdux)*sw |
237 |
> |
tyj = 0.5d0*(SSD_v0*s*dwjduy + SSD_v0p*sp*dwjpduy)*sw |
238 |
> |
tzj = 0.5d0*(SSD_v0*s*dwjduz + SSD_v0p*sp*dwjpduz)*sw |
239 |
|
|
240 |
|
! go back to lab frame using transpose of rotation matrix: |
241 |
|
|
266 |
|
|
267 |
|
! first rotate the i terms back into the lab frame: |
268 |
|
|
269 |
< |
radcomxi = SSD_v0*s*dwidx+SSD_v0p*sp*dwipdx |
270 |
< |
radcomyi = SSD_v0*s*dwidy+SSD_v0p*sp*dwipdy |
271 |
< |
radcomzi = SSD_v0*s*dwidz+SSD_v0p*sp*dwipdz |
269 |
> |
radcomxi = (SSD_v0*s*dwidx+SSD_v0p*sp*dwipdx)*sw |
270 |
> |
radcomyi = (SSD_v0*s*dwidy+SSD_v0p*sp*dwipdy)*sw |
271 |
> |
radcomzi = (SSD_v0*s*dwidz+SSD_v0p*sp*dwipdz)*sw |
272 |
|
|
273 |
< |
radcomxj = SSD_v0*s*dwjdx+SSD_v0p*sp*dwjpdx |
274 |
< |
radcomyj = SSD_v0*s*dwjdy+SSD_v0p*sp*dwjpdy |
275 |
< |
radcomzj = SSD_v0*s*dwjdz+SSD_v0p*sp*dwjpdz |
273 |
> |
radcomxj = (SSD_v0*s*dwjdx+SSD_v0p*sp*dwjpdx)*sw |
274 |
> |
radcomyj = (SSD_v0*s*dwjdy+SSD_v0p*sp*dwjpdy)*sw |
275 |
> |
radcomzj = (SSD_v0*s*dwjdz+SSD_v0p*sp*dwjpdz)*sw |
276 |
|
|
277 |
|
#ifdef IS_MPI |
278 |
|
fxii = a_Row(1,atom1)*(radcomxi) + & |
349 |
|
#endif |
350 |
|
|
351 |
|
#ifdef IS_MPI |
352 |
< |
id1 = tagRow(atom1) |
353 |
< |
id2 = tagColumn(atom2) |
352 |
> |
id1 = tagRow(atom1) |
353 |
> |
id2 = tagColumn(atom2) |
354 |
|
#else |
355 |
< |
id1 = atom1 |
356 |
< |
id2 = atom2 |
355 |
> |
id1 = atom1 |
356 |
> |
id2 = atom2 |
357 |
|
#endif |
358 |
< |
|
359 |
< |
if (do_stress) then |
360 |
< |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
361 |
< |
|
362 |
< |
! because the d vector is the rj - ri vector, and |
363 |
< |
! because fxradial, fyradial, and fzradial are the |
364 |
< |
! (positive) force on atom i (negative on atom j) we need |
362 |
< |
! a negative sign here: |
363 |
< |
|
364 |
< |
tau_Temp(1) = tau_Temp(1) - d(1) * fxradial |
365 |
< |
tau_Temp(2) = tau_Temp(2) - d(1) * fyradial |
366 |
< |
tau_Temp(3) = tau_Temp(3) - d(1) * fzradial |
367 |
< |
tau_Temp(4) = tau_Temp(4) - d(2) * fxradial |
368 |
< |
tau_Temp(5) = tau_Temp(5) - d(2) * fyradial |
369 |
< |
tau_Temp(6) = tau_Temp(6) - d(2) * fzradial |
370 |
< |
tau_Temp(7) = tau_Temp(7) - d(3) * fxradial |
371 |
< |
tau_Temp(8) = tau_Temp(8) - d(3) * fyradial |
372 |
< |
tau_Temp(9) = tau_Temp(9) - d(3) * fzradial |
373 |
< |
|
374 |
< |
virial_Temp = virial_Temp + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) |
375 |
< |
endif |
358 |
> |
|
359 |
> |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
360 |
> |
|
361 |
> |
fpair(1) = fpair(1) + fxradial |
362 |
> |
fpair(2) = fpair(2) + fyradial |
363 |
> |
fpair(3) = fpair(3) + fzradial |
364 |
> |
|
365 |
|
endif |
366 |
|
endif |
378 |
– |
|
367 |
|
end subroutine do_sticky_pair |
368 |
|
|
369 |
|
!! calculates the switching functions and their derivatives for a given |