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

Comparing trunk/OOPSE-4/src/UseTheForce/DarkSide/electrostatic.F90 (file contents):
Revision 2971 by chrisfen, Mon Jul 3 13:18:43 2006 UTC vs.
Revision 2972 by chrisfen, Mon Aug 14 20:32:20 2006 UTC

# Line 1070 | Line 1070 | contains
1070  
1071      if (i_is_Quadrupole) then
1072         if (j_is_Charge) then
1073 +          ! precompute some necessary variables
1074 +          cx2 = cx_i * cx_i
1075 +          cy2 = cy_i * cy_i
1076 +          cz2 = cz_i * cz_i
1077 +          pref = pre14 * q_j * one_third
1078 +
1079            if (screeningMethod .eq. DAMPED) then
1080               ! assemble the damping variables
1081               call lookupUniformSpline1d(erfcSpline, rij, erfcVal, derfcVal)
# Line 1084 | Line 1090 | contains
1090               c4 = 5.0_dp*c3*riji*riji
1091            endif
1092            
1093 <          ! precompute some variables
1088 <          cx2 = cx_i * cx_i
1089 <          cy2 = cy_i * cy_i
1090 <          cz2 = cz_i * cz_i
1091 <          pref = pre14 * q_j * one_third
1092 <
1093 <          ! calculate the potential
1094 <          pot_term = ( qxx_i * (cx2*c3 - c2ri) + qyy_i * (cy2*c3 - c2ri) + &
1095 <               qzz_i * (cz2*c3 - c2ri) )
1096 <
1097 <          vterm = pref * pot_term
1098 <          vpair = vpair + vterm
1099 <          epot = epot + sw*vterm
1100 <
1101 <          ! precompute variables for convenience
1093 >          ! precompute some variables for convenience
1094            preSw = sw*pref
1095            c2ri = c2*riji
1096            c3ri = c3*riji
# Line 1109 | Line 1101 | contains
1101            xhatc4 = xhat*c4rij
1102            yhatc4 = yhat*c4rij
1103            zhatc4 = zhat*c4rij
1104 +
1105 +          ! calculate the potential
1106 +          pot_term = ( qxx_i * (cx2*c3 - c2ri) + qyy_i * (cy2*c3 - c2ri) + &
1107 +               qzz_i * (cz2*c3 - c2ri) )
1108 +
1109 +          vterm = pref * pot_term
1110 +          vpair = vpair + vterm
1111 +          epot = epot + sw*vterm
1112  
1113            ! calculate the derivatives for the forces and torques
1114            dudx = dudx - preSw * ( &

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines