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

Comparing branches/development/src/nonbonded/Electrostatic.cpp (file contents):
Revision 1585 by gezelter, Fri Jun 17 20:16:35 2011 UTC vs.
Revision 1586 by gezelter, Tue Jun 21 06:34:35 2011 UTC

# Line 52 | Line 52 | namespace OpenMD {
52   namespace OpenMD {
53    
54    Electrostatic::Electrostatic(): name_("Electrostatic"), initialized_(false),
55 <                                  forceField_(NULL), info_(NULL) {}
55 >                                  forceField_(NULL), info_(NULL), haveCutoffRadius_(false),
56 >                                  haveDampingAlpha_(false), haveDielectric_(false),
57 >                                  haveElectroSpline_(false)
58 > {}
59    
60    void Electrostatic::initialize() {
61  
# Line 97 | Line 100 | namespace OpenMD {
100      screeningMethod_ = UNDAMPED;
101      dielectric_ = 1.0;
102      one_third_ = 1.0 / 3.0;
100    haveCutoffRadius_ = false;
101    haveDampingAlpha_ = false;
102    haveDielectric_ = false;  
103    haveElectroSpline_ = false;
103    
104      // check the summation method:
105      if (simParams_->haveElectrostaticSummationMethod()) {
# Line 1036 | Line 1035 | namespace OpenMD {
1035      RealType mu1, preVal, chg1, self;
1036      
1037      if (!initialized_) initialize();
1038 <    
1038 >
1039      ElectrostaticAtomData data = ElectrostaticMap[sdat.atype];
1040    
1041      // logicals
1043
1042      bool i_is_Charge = data.is_Charge;
1043      bool i_is_Dipole = data.is_Dipole;
1044  
# Line 1048 | Line 1046 | namespace OpenMD {
1046        if (i_is_Dipole) {
1047          mu1 = data.dipole_moment;          
1048          preVal = pre22_ * preRF2_ * mu1 * mu1;
1049 <        sdat.pot[2] -= 0.5 * preVal;
1049 >        (*(sdat.pot))[ELECTROSTATIC_FAMILY] -= 0.5 * preVal;
1050          
1051          // The self-correction term adds into the reaction field vector
1052          Vector3d uz_i = sdat.eFrame->getColumn(2);
# Line 1065 | Line 1063 | namespace OpenMD {
1063          } else {        
1064            self = - 0.5 * rcuti_ * chg1 * (chg1 +  *(sdat.skippedCharge)) * pre11_;
1065          }
1066 <        sdat.pot[ELECTROSTATIC_FAMILY] += self;
1066 >        (*(sdat.pot))[ELECTROSTATIC_FAMILY] += self;
1067        }
1068      }
1069    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines