50 |
|
!! @author Matthew Meineke |
51 |
|
!! @author Christopher Fennell |
52 |
|
!! @author J. Daniel Gezelter |
53 |
< |
!! @version $Id: sticky.F90,v 1.12 2005-05-18 19:06:22 chrisfen Exp $, $Date: 2005-05-18 19:06:22 $, $Name: not supported by cvs2svn $, $Revision: 1.12 $ |
53 |
> |
!! @version $Id: sticky.F90,v 1.14 2005-08-26 21:30:41 chrisfen Exp $, $Date: 2005-08-26 21:30:41 $, $Name: not supported by cvs2svn $, $Revision: 1.14 $ |
54 |
|
|
55 |
|
module sticky |
56 |
|
|
71 |
|
public :: do_sticky_pair |
72 |
|
public :: destroyStickyTypes |
73 |
|
public :: do_sticky_power_pair |
74 |
+ |
public :: getStickyCut |
75 |
+ |
public :: getStickyPowerCut |
76 |
|
|
75 |
– |
|
77 |
|
type :: StickyList |
78 |
|
integer :: c_ident |
79 |
|
real( kind = dp ) :: w0 = 0.0_dp |
148 |
|
|
149 |
|
return |
150 |
|
end subroutine newStickyType |
151 |
+ |
|
152 |
+ |
function getStickyCut(atomID) result(cutValue) |
153 |
+ |
integer, intent(in) :: atomID |
154 |
+ |
real(kind=dp) :: cutValue |
155 |
+ |
|
156 |
+ |
cutValue = StickyMap(atomID)%rbig |
157 |
+ |
end function getStickyCut |
158 |
+ |
|
159 |
+ |
function getStickyPowerCut(atomID) result(cutValue) |
160 |
+ |
integer, intent(in) :: atomID |
161 |
+ |
real(kind=dp) :: cutValue |
162 |
|
|
163 |
+ |
cutValue = StickyMap(atomID)%rbig |
164 |
+ |
end function getStickyPowerCut |
165 |
+ |
|
166 |
|
subroutine do_sticky_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
167 |
|
pot, A, f, t, do_pot) |
168 |
|
|
527 |
|
if(allocated(StickyMap)) deallocate(StickyMap) |
528 |
|
end subroutine destroyStickyTypes |
529 |
|
|
530 |
< |
subroutine do_sticky_power_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
531 |
< |
pot, A, f, t, do_pot, ebalance) |
530 |
> |
subroutine do_sticky_power_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & |
531 |
> |
pot, A, f, t, do_pot) |
532 |
|
!! We assume that the rotation matrices have already been calculated |
533 |
|
!! and placed in the A array. |
534 |
< |
|
534 |
> |
|
535 |
|
!! i and j are pointers to the two SSD atoms |
536 |
< |
|
536 |
> |
|
537 |
|
integer, intent(in) :: atom1, atom2 |
538 |
|
real (kind=dp), intent(inout) :: rij, r2 |
539 |
|
real (kind=dp), dimension(3), intent(in) :: d |
542 |
|
real (kind=dp), dimension(9,nLocal) :: A |
543 |
|
real (kind=dp), dimension(3,nLocal) :: f |
544 |
|
real (kind=dp), dimension(3,nLocal) :: t |
530 |
– |
real (kind=dp), intent(in) :: ebalance |
545 |
|
logical, intent(in) :: do_pot |
546 |
|
|
547 |
|
real (kind=dp) :: xi, yi, zi, xj, yj, zj, xi2, yi2, zi2, xj2, yj2, zj2 |
548 |
|
real (kind=dp) :: xihat, yihat, zihat, xjhat, yjhat, zjhat |
549 |
|
real (kind=dp) :: rI, rI2, rI3, rI4, rI5, rI6, rI7, s, sp, dsdr, dspdr |
550 |
< |
real (kind=dp) :: wi, wj, w, wi2, wj2 |
550 |
> |
real (kind=dp) :: wi, wj, w, wi2, wj2, eScale, v0scale |
551 |
|
real (kind=dp) :: dwidx, dwidy, dwidz, dwjdx, dwjdy, dwjdz |
552 |
|
real (kind=dp) :: dwidux, dwiduy, dwiduz, dwjdux, dwjduy, dwjduz |
553 |
|
real (kind=dp) :: drdx, drdy, drdz |
665 |
|
|
666 |
|
call calc_sw_fnc(rij, rl, ru, rlp, rup, s, sp, dsdr, dspdr) |
667 |
|
|
668 |
< |
frac1 = 1.5d0 |
669 |
< |
frac2 = 0.5d0 |
668 |
> |
frac1 = 0.25d0 |
669 |
> |
frac2 = 0.75d0 |
670 |
|
|
671 |
|
wi = 2.0d0*(xi2-yi2)*zi*rI3 |
672 |
|
wj = 2.0d0*(xj2-yj2)*zj*rI3 |
674 |
|
wi2 = wi*wi |
675 |
|
wj2 = wj*wj |
676 |
|
|
677 |
< |
w = frac1*wi*wi2 + frac2*wi + frac1*wj*wj2 + frac2*wj |
677 |
> |
w = frac1*wi*wi2 + frac2*wi + frac1*wj*wj2 + frac2*wj + v0p |
678 |
|
|
679 |
< |
vpair = vpair + 0.5d0*(v0*s*w) + ebalance |
679 |
> |
vpair = vpair + 0.5d0*(v0*s*w) |
680 |
|
|
681 |
|
if (do_pot) then |
682 |
|
#ifdef IS_MPI |
683 |
|
pot_row(atom1) = pot_row(atom1) + 0.25d0*(v0*s*w)*sw |
684 |
|
pot_col(atom2) = pot_col(atom2) + 0.25d0*(v0*s*w)*sw |
685 |
|
#else |
686 |
< |
pot = pot + 0.5d0*(v0*s*w)*sw + ebalance |
686 |
> |
pot = pot + 0.5d0*(v0*s*w)*sw |
687 |
|
#endif |
688 |
|
endif |
689 |
|
|
819 |
|
|
820 |
|
! now assemble these with the radial-only terms: |
821 |
|
|
822 |
< |
fxradial = 0.5d0*(v0*dsdr*w*drdx + fxii + fxji + ebalance*xihat) |
823 |
< |
fyradial = 0.5d0*(v0*dsdr*w*drdy + fyii + fyji + ebalance*yihat) |
824 |
< |
fzradial = 0.5d0*(v0*dsdr*w*drdz + fzii + fzji + ebalance*zihat) |
822 |
> |
fxradial = 0.5d0*(v0*dsdr*w*drdx + fxii + fxji) |
823 |
> |
fyradial = 0.5d0*(v0*dsdr*w*drdy + fyii + fyji) |
824 |
> |
fzradial = 0.5d0*(v0*dsdr*w*drdz + fzii + fzji) |
825 |
|
|
826 |
|
#ifdef IS_MPI |
827 |
|
f_Row(1,atom1) = f_Row(1,atom1) + fxradial |