ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/nonbonded/Electrostatic.cpp
(Generate patch)

Comparing trunk/src/nonbonded/Electrostatic.cpp (file contents):
Revision 1925 by gezelter, Wed Aug 7 15:24:16 2013 UTC vs.
Revision 1929 by gezelter, Mon Aug 19 13:12:00 2013 UTC

# Line 888 | Line 888 | namespace OpenMD {
888                          + rdQbr * rhat * (dv22 - 2.0*v22or));
889      }
890      
891 <    if ((a_is_Fluctuating || b_is_Fluctuating) && idat.excluded) {
891 >    if ((a_is_Fluctuating || b_is_Fluctuating)
892 >        && (idat.excluded || idat.sameRegion)) {
893        J = Jij[FQtids[idat.atid1]][FQtids[idat.atid2]];
894      }    
895      
# Line 909 | Line 910 | namespace OpenMD {
910          }
911          
912          // Fluctuating charge forces are handled via Coulomb integrals
913 <        // for excluded pairs (i.e. those connected via bonds) and
914 <        // with the standard charge-charge interaction otherwise.
913 >        // for excluded pairs (i.e. those connected via bonds), atoms
914 >        // within the same region (for metals) and with the standard
915 >        // charge-charge interaction otherwise.
916  
917 <        if (idat.excluded) {          
917 >        if (idat.excluded || idat.sameRegion) {          
918            if (a_is_Fluctuating || b_is_Fluctuating) {
919              coulInt = J->getValueAt( *(idat.rij) );
920              if (a_is_Fluctuating)  dUdCa += coulInt * C_b;
921              if (b_is_Fluctuating)  dUdCb += coulInt * C_a;
922 <            excluded_Pot += C_a * C_b * coulInt;
922 >            if (idat.excluded)
923 >              excluded_Pot += C_a * C_b * coulInt;
924            }          
925          } else {
926            if (a_is_Fluctuating) dUdCa += C_b * pref * v01;
927 <          if (a_is_Fluctuating) dUdCb += C_a * pref * v01;
927 >          if (b_is_Fluctuating) dUdCb += C_a * pref * v01;
928          }
929        }
930  
# Line 1142 | Line 1145 | namespace OpenMD {
1145          
1146      if (i_is_Fluctuating) {
1147        C_a += *(sdat.flucQ);
1148 <      // dVdFQ is really a force, so this is negative the derivative
1146 <      *(sdat.dVdFQ) -=  *(sdat.flucQ) * data.hardness + data.electronegativity;
1148 >      *(sdat.flucQfrc) -=  *(sdat.flucQ) * data.hardness + data.electronegativity;
1149        (*(sdat.excludedPot))[ELECTROSTATIC_FAMILY] += (*sdat.flucQ) *
1150          (*(sdat.flucQ) * data.hardness * 0.5 + data.electronegativity);
1151      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines