9 |
|
!! @author Matthew Meineke |
10 |
|
!! @author Christopher Fennel |
11 |
|
!! @author J. Daniel Gezelter |
12 |
< |
!! @version $Id: calc_sticky_pair.F90,v 1.2 2003-03-12 15:17:52 gezelter Exp $, $Date: 2003-03-12 15:17:52 $, $Name: not supported by cvs2svn $, $Revision: 1.2 $ |
12 |
> |
!! @version $Id: calc_sticky_pair.F90,v 1.6 2003-03-12 22:27:59 gezelter Exp $, $Date: 2003-03-12 22:27:59 $, $Name: not supported by cvs2svn $, $Revision: 1.6 $ |
13 |
|
|
14 |
|
module sticky_pair |
15 |
|
|
16 |
|
use simulation |
17 |
|
use definitions |
18 |
– |
use forceGlobals |
18 |
|
#ifdef IS_MPI |
19 |
|
use mpiSimulation |
20 |
|
#endif |
24 |
|
PRIVATE |
25 |
|
|
26 |
|
logical, save :: sticky_initialized = .false. |
27 |
< |
real( kind = dp ), save :: SSD_w0 |
27 |
> |
real( kind = dp ), save :: SSD_w0 |
28 |
|
real( kind = dp ), save :: SSD_v0 |
29 |
|
real( kind = dp ), save :: SSD_rl |
30 |
|
real( kind = dp ), save :: SSD_ru |
31 |
|
real( kind = dp ), save :: SSD_rup |
32 |
|
|
33 |
< |
public :: initialize_sticky |
33 |
> |
public :: check_sticky_FF |
34 |
> |
public :: set_sticky_params |
35 |
|
public :: do_sticky_pair |
36 |
|
|
37 |
|
contains |
38 |
|
|
39 |
< |
subroutine initialize_sticky(sticky_w0, sticky_v0) |
39 |
> |
subroutine check_sticky_FF(status) |
40 |
> |
integer :: status |
41 |
> |
status = -1 |
42 |
> |
if (sticky_initialized) status = 0 |
43 |
> |
return |
44 |
> |
end subroutine check_sticky_FF |
45 |
> |
|
46 |
> |
subroutine set_sticky_params(sticky_w0, sticky_v0) |
47 |
|
real( kind = dp ), intent(in) :: sticky_w0, sticky_v0 |
48 |
|
|
49 |
|
! we could pass all 5 parameters if we felt like it... |
50 |
< |
|
50 |
> |
|
51 |
|
SSD_w0 = sticky_w0 |
52 |
|
SSD_v0 = sticky_v0 |
53 |
|
SSD_rl = 2.75_DP |
54 |
|
SSD_ru = 3.35_DP |
55 |
|
SSD_rup = 4.0_DP |
56 |
< |
|
56 |
> |
|
57 |
|
sticky_initialized = .true. |
58 |
|
return |
59 |
< |
end subroutine initialize_sticky |
59 |
> |
end subroutine set_sticky_params |
60 |
|
|
61 |
< |
subroutine do_sticky_pair(atom1, atom2, d, rij, A, pot, f, t) |
61 |
> |
subroutine do_sticky_pair(atom1, atom2, d, rij, r2, A, pot, f, t, & |
62 |
> |
do_pot, do_stress) |
63 |
|
|
64 |
|
!! This routine does only the sticky portion of the SSD potential |
65 |
|
!! [Chandra and Ichiye, J. Chem. Phys. 111, 2701 (1999)]. |
71 |
|
!! i and j are pointers to the two SSD atoms |
72 |
|
|
73 |
|
integer, intent(in) :: atom1, atom2 |
74 |
< |
real (kind=dp), intent(inout) :: rij |
74 |
> |
real (kind=dp), intent(inout) :: rij, r2 |
75 |
|
real (kind=dp), dimension(3), intent(in) :: d |
76 |
+ |
real (kind=dp) :: pot |
77 |
|
real (kind=dp), dimension(9,getNlocal()) :: A |
78 |
|
real (kind=dp), dimension(3,getNlocal()) :: f |
79 |
|
real (kind=dp), dimension(3,getNlocal()) :: t |
80 |
+ |
logical, intent(in) :: do_pot, do_stress |
81 |
|
|
82 |
|
real (kind=dp) :: xi, yi, zi, xj, yj, zj, xi2, yi2, zi2, xj2, yj2, zj2 |
83 |
< |
real (kind=dp) :: r2, r3, r5, r6, s, sp, dsdr, dspdr |
83 |
> |
real (kind=dp) :: r3, r5, r6, s, sp, dsdr, dspdr |
84 |
|
real (kind=dp) :: wi, wj, w, wip, wjp, wp |
85 |
|
real (kind=dp) :: dwidx, dwidy, dwidz, dwjdx, dwjdy, dwjdz |
86 |
|
real (kind=dp) :: dwipdx, dwipdy, dwipdz, dwjpdx, dwjpdy, dwjpdz |
98 |
|
return |
99 |
|
endif |
100 |
|
|
91 |
– |
r2 = rij*rij |
101 |
|
r3 = r2*rij |
102 |
|
r5 = r3*r2 |
103 |
|
|
157 |
|
wjp = zjf*zjf*zjs*zjs - SSD_w0 |
158 |
|
wp = wip + wjp |
159 |
|
|
160 |
< |
#ifdef IS_MPI |
161 |
< |
pot_row(atom1) = pot_row(atom1) + 0.25d0*SSD_v0*(s*w + sp*wp) |
162 |
< |
pot_col(atom2) = pot_col(atom2) + 0.25d0*SSD_v0*(s*w + sp*wp) |
160 |
> |
|
161 |
> |
if (do_pot) then |
162 |
> |
#ifdef IS_MPI |
163 |
> |
pot_row(atom1) = pot_row(atom1) + 0.25d0*SSD_v0*(s*w + sp*wp) |
164 |
> |
pot_col(atom2) = pot_col(atom2) + 0.25d0*SSD_v0*(s*w + sp*wp) |
165 |
|
#else |
166 |
< |
pot = pot + 0.5d0*SSD_v0*(s*w + sp*wp) |
167 |
< |
#endif |
166 |
> |
pot = pot + 0.5d0*SSD_v0*(s*w + sp*wp) |
167 |
> |
#endif |
168 |
> |
endif |
169 |
|
|
170 |
|
dwidx = 4.0d0*xi*zi/r3 - 6.0d0*xi*zi*(xi2-yi2)/r5 |
171 |
|
dwidy = - 4.0d0*yi*zi/r3 - 6.0d0*yi*zi*(xi2-yi2)/r5 |
322 |
|
fzjj + fzij) |
323 |
|
#endif |
324 |
|
|
325 |
< |
if (doStress()) then |
325 |
> |
if (do_stress) then |
326 |
|
tau_Temp(1) = tau_Temp(1) + fxradial * d(1) |
327 |
|
tau_Temp(2) = tau_Temp(2) + fxradial * d(2) |
328 |
|
tau_Temp(3) = tau_Temp(3) + fxradial * d(3) |