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

Comparing trunk/OOPSE-3.0/src/UseTheForce/DarkSide/electrostatic.F90 (file contents):
Revision 2302 by chrisfen, Fri Sep 16 16:07:39 2005 UTC vs.
Revision 2306 by chrisfen, Fri Sep 16 20:37:05 2005 UTC

# Line 83 | Line 83 | module electrostatic_module
83    real(kind=DP), save :: constERFC = 0.0_DP
84    real(kind=DP), save :: constEXP = 0.0_DP
85    logical, save :: haveDWAconstants = .false.
86 +  real(kind=dp), save :: rcuti = 0.0_dp
87 +  real(kind=dp), save :: rcuti2 = 0.0_dp
88 +  real(kind=dp), save :: rcuti3 = 0.0_dp
89 +  real(kind=dp), save :: rcuti4 = 0.0_dp
90  
91  
92    public :: setElectrostaticSummationMethod
# Line 356 | Line 360 | contains
360    end function getDipoleMoment
361  
362    subroutine checkSummationMethod()
363 +
364 +    if (.not.haveDefaultCutoff) then
365 +       call handleError("checkSummationMethod", "no Default Cutoff set!")
366 +    endif
367 +
368 +    rcuti = 1.0d0 / defaultCutoff
369 +    rcuti2 = rcuti*rcuti
370 +    rcuti3 = rcuti2*rcuti
371 +    rcuti4 = rcuti2*rcuti2
372  
373      if (summationMethod .eq. DAMPED_WOLF) then
374         if (.not.haveDWAconstants) then
# Line 387 | Line 400 | contains
400  
401  
402    subroutine doElectrostaticPair(atom1, atom2, d, rij, r2, sw, &
403 <       vpair, fpair, pot, eFrame, f, t, do_pot, corrMethod, rcuti)
403 >       vpair, fpair, pot, eFrame, f, t, do_pot)
404  
405      logical, intent(in) :: do_pot
406  
407      integer, intent(in) :: atom1, atom2
408      integer :: localError
396    integer, intent(in) :: corrMethod
409  
410 <    real(kind=dp), intent(in) :: rij, r2, sw, rcuti
410 >    real(kind=dp), intent(in) :: rij, r2, sw
411      real(kind=dp), intent(in), dimension(3) :: d
412      real(kind=dp), intent(inout) :: vpair
413      real(kind=dp), intent(inout), dimension(3) :: fpair
# Line 426 | Line 438 | contains
438      real (kind=dp) :: xhat, yhat, zhat
439      real (kind=dp) :: dudx, dudy, dudz
440      real (kind=dp) :: scale, sc2, bigR, switcher, dswitcher
429    real (kind=dp) :: rcuti2, rcuti3, rcuti4
441  
442      if (.not.allocated(ElectrostaticMap)) then
443         call handleError("electrostatic", "no ElectrostaticMap was present before first call of do_electrostatic_pair!")
# Line 454 | Line 465 | contains
465      yhat = d(2) * riji
466      zhat = d(3) * riji
467  
457    rcuti2 = rcuti*rcuti
458    rcuti3 = rcuti2*rcuti
459    rcuti4 = rcuti2*rcuti2
460
468      swi = 1.0d0 / sw
469  
470      !! logicals
# Line 603 | Line 610 | contains
610  
611         if (j_is_Charge) then
612  
613 <          if (corrMethod .eq. 1) then
613 >          if (summationMethod .eq. 1) then
614               vterm = pre11 * q_i * q_j * (riji - rcuti)
615  
616               vpair = vpair + vterm
# Line 635 | Line 642 | contains
642  
643            pref = sw * pre12 * q_i * mu_j
644  
645 <          if (corrMethod .eq. 1) then
645 >          if (summationMethod .eq. 1) then
646               ri2 = riji * riji
647               ri3 = ri2 * riji
648  
# Line 702 | Line 709 | contains
709  
710            pref =  sw * pre14 * q_i / 3.0_dp
711  
712 <          if (corrMethod .eq. 1) then
712 >          if (summationMethod .eq. 1) then
713               vterm1 = pref * ri3*( qxx_j * (3.0_dp*cx2 - 1.0_dp) + &
714                    qyy_j * (3.0_dp*cy2 - 1.0_dp) + &
715                    qzz_j * (3.0_dp*cz2 - 1.0_dp) )
# Line 800 | Line 807 | contains
807  
808            pref = sw * pre12 * q_j * mu_i
809  
810 <          if (corrMethod .eq. 1) then
810 >          if (summationMethod .eq. 1) then
811               ri2 = riji * riji
812               ri3 = ri2 * riji
813  
# Line 855 | Line 862 | contains
862  
863            pref = sw * pre22 * mu_i * mu_j
864  
865 <          if (corrMethod .eq. 1) then
865 >          if (summationMethod .eq. 1) then
866               ri2 = riji * riji
867               ri3 = ri2 * riji
868               ri4 = ri2 * ri2
# Line 958 | Line 965 | contains
965  
966            pref = sw * pre14 * q_j / 3.0_dp
967  
968 <          if (corrMethod .eq. 1) then
968 >          if (summationMethod .eq. 1) then
969               vterm1 = pref * ri3*( qxx_i * (3.0_dp*cx2 - 1.0_dp) + &
970                    qyy_i * (3.0_dp*cy2 - 1.0_dp) + &
971                    qzz_i * (3.0_dp*cz2 - 1.0_dp) )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines