ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/UseTheForce/DarkSide/electrostatic.F90
(Generate patch)

Comparing trunk/OOPSE-2.0/src/UseTheForce/DarkSide/electrostatic.F90 (file contents):
Revision 2381 by chrisfen, Tue Oct 18 15:01:42 2005 UTC vs.
Revision 2390 by chrisfen, Wed Oct 19 19:24:40 2005 UTC

# Line 1216 | Line 1216 | contains
1216  
1217      return
1218    end subroutine doElectrostaticPair
1219
1220  !! calculates the switching functions and their derivatives for a given
1221  subroutine calc_switch(r, mu, scale, dscale)
1222
1223    real (kind=dp), intent(in) :: r, mu
1224    real (kind=dp), intent(inout) :: scale, dscale
1225    real (kind=dp) :: rl, ru, mulow, minRatio, temp, scaleVal
1219  
1227    ! distances must be in angstroms
1228    rl = 2.75d0
1229    ru = 3.75d0
1230    mulow = 0.0d0 !3.3856d0 ! 1.84 * 1.84
1231    minRatio = mulow / (mu*mu)
1232    scaleVal = 1.0d0 - minRatio
1233    
1234    if (r.lt.rl) then
1235       scale = minRatio
1236       dscale = 0.0d0
1237    elseif (r.gt.ru) then
1238       scale = 1.0d0
1239       dscale = 0.0d0
1240    else
1241       scale = 1.0d0 - scaleVal*((ru + 2.0d0*r - 3.0d0*rl) * (ru-r)**2) &
1242                        / ((ru - rl)**3)
1243       dscale = -scaleVal * 6.0d0 * (r-ru)*(r-rl)/((ru - rl)**3)    
1244    endif
1245        
1246    return
1247  end subroutine calc_switch
1248
1220    subroutine destroyElectrostaticTypes()
1221  
1222      if(allocated(ElectrostaticMap)) deallocate(ElectrostaticMap)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines