Revisão | 818049e2c3a2f9916288eb9a3e3fe386515d3b8c (tree) |
---|---|
Hora | 2014-01-04 17:51:32 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Some methods which are not used actually is modified. #32750
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1610 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -164,19 +164,16 @@ double Am1::GetDiatomCoreRepulsionEnergy(const Atom& atomA, const Atom& atomB) c | ||
164 | 164 | |
165 | 165 | // First derivative of diatomic core repulsion energy. |
166 | 166 | // This derivative is related to the coordinate of atomA. |
167 | -double Am1::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
168 | - int indexAtomB, | |
169 | - CartesianType axisA) const{ | |
167 | +double Am1::GetDiatomCoreRepulsion1stDerivative(const Atom& atomA, const Atom& atomB, | |
168 | + CartesianType axisA) const{ | |
170 | 169 | // MNDO term |
171 | - double mndoTerms = Mndo::GetDiatomCoreRepulsion1stDerivative(indexAtomA, indexAtomB, axisA); | |
170 | + double mndoTerms = Mndo::GetDiatomCoreRepulsion1stDerivative(atomA, atomB, axisA); | |
172 | 171 | |
173 | 172 | // additional term, first derivative of eq. (4) in [S_1989] |
174 | 173 | double ang2AU = Parameters::GetInstance()->GetAngstrom2AU(); |
175 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
176 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
177 | 174 | double alphaA = atomA.GetNddoAlpha(this->theory); |
178 | 175 | double alphaB = atomB.GetNddoAlpha(this->theory); |
179 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
176 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
180 | 177 | double dCartesian = (atomA.GetXyz()[axisA] - atomB.GetXyz()[axisA]); |
181 | 178 | double kA, lA, mA; |
182 | 179 | double kB, lB, mB; |
@@ -204,20 +201,18 @@ double Am1::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | ||
204 | 201 | |
205 | 202 | // Second derivative of diatomic core repulsion energy. |
206 | 203 | // Both derivatives are related to the coordinate of atomA. |
207 | -double Am1::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
208 | - int indexAtomB, | |
209 | - CartesianType axisA1, | |
210 | - CartesianType axisA2) const{ | |
204 | +double Am1::GetDiatomCoreRepulsion2ndDerivative(const Atom& atomA, | |
205 | + const Atom& atomB, | |
206 | + CartesianType axisA1, | |
207 | + CartesianType axisA2) const{ | |
211 | 208 | // MNDO term |
212 | - double mndoTerm = Mndo::GetDiatomCoreRepulsion2ndDerivative(indexAtomA, indexAtomB, axisA1, axisA2); | |
209 | + double mndoTerm = Mndo::GetDiatomCoreRepulsion2ndDerivative(atomA, atomB, axisA1, axisA2); | |
213 | 210 | |
214 | 211 | // additional term, first derivative of eq. (4) in [S_1989] |
215 | 212 | double ang2AU = Parameters::GetInstance()->GetAngstrom2AU(); |
216 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
217 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
218 | 213 | double alphaA = atomA.GetNddoAlpha(this->theory); |
219 | 214 | double alphaB = atomB.GetNddoAlpha(this->theory); |
220 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
215 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
221 | 216 | double kA, lA, mA; |
222 | 217 | double kB, lB, mB; |
223 | 218 | double temp1 = 0.0; |
@@ -34,11 +34,11 @@ protected: | ||
34 | 34 | virtual void CalcSCFProperties(); |
35 | 35 | virtual double GetDiatomCoreRepulsionEnergy(const MolDS_base_atoms::Atom& atomA, |
36 | 36 | const MolDS_base_atoms::Atom& atomB) const; |
37 | - virtual double GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
38 | - int indexAtomB, | |
37 | + virtual double GetDiatomCoreRepulsion1stDerivative(const MolDS_base_atoms::Atom& atomA, | |
38 | + const MolDS_base_atoms::Atom& atomB, | |
39 | 39 | MolDS_base::CartesianType axisA) const; |
40 | - virtual double GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
41 | - int indexAtomB, | |
40 | + virtual double GetDiatomCoreRepulsion2ndDerivative(const MolDS_base_atoms::Atom& atomA, | |
41 | + const MolDS_base_atoms::Atom& atomB, | |
42 | 42 | MolDS_base::CartesianType axisA1, |
43 | 43 | MolDS_base::CartesianType axisA2) const; |
44 | 44 | private: |
@@ -382,12 +382,10 @@ double Cndo2::GetAtomCoreEpcCoulombEnergy(const Atom& atom, const Atom& epc) con | ||
382 | 382 | |
383 | 383 | // First derivative of diatomic core repulsion energy. |
384 | 384 | // This derivative is related to the coordinate of atomA. |
385 | -double Cndo2::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, int indexAtomB, | |
385 | +double Cndo2::GetDiatomCoreRepulsion1stDerivative(const Atom& atomA, const Atom& atomB, | |
386 | 386 | CartesianType axisA) const{ |
387 | 387 | double value=0.0; |
388 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
389 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
390 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
388 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
391 | 389 | value = atomA.GetCoreCharge()*atomB.GetCoreCharge(); |
392 | 390 | value *= (atomA.GetXyz()[axisA] - atomB.GetXyz()[axisA])/distance; |
393 | 391 | value *= -1.0/(distance*distance); |
@@ -396,8 +394,8 @@ double Cndo2::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, int indexAtomB | ||
396 | 394 | |
397 | 395 | // Second derivative of diatomic core repulsion energy. |
398 | 396 | // Both derivatives are related to the coordinate of atomA. |
399 | -double Cndo2::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
400 | - int indexAtomB, | |
397 | +double Cndo2::GetDiatomCoreRepulsion2ndDerivative(const Atom& atomA, | |
398 | + const Atom& atomB, | |
401 | 399 | CartesianType axisA1, |
402 | 400 | CartesianType axisA2) const{ |
403 | 401 | stringstream ss; |
@@ -409,10 +407,10 @@ double Cndo2::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | ||
409 | 407 | void Cndo2::CalcVdWCorrectionEnergy(){ |
410 | 408 | double value = 0.0; |
411 | 409 | for(int i=0; i<this->molecule->GetRealAtomVect().size(); i++){ |
412 | - const int indexAtomI = this->molecule->GetRealAtomVect()[i]->GetIndex(); | |
410 | + const Atom& atomI = *this->molecule->GetAtomVect()[i]; | |
413 | 411 | for(int j=i+1; j<this->molecule->GetRealAtomVect().size(); j++){ |
414 | - const int indexAtomJ = this->molecule->GetRealAtomVect()[j]->GetIndex(); | |
415 | - value += this->GetDiatomVdWCorrectionEnergy(indexAtomI, indexAtomJ); | |
412 | + const Atom& atomJ = *this->molecule->GetAtomVect()[j]; | |
413 | + value += this->GetDiatomVdWCorrectionEnergy(atomI, atomJ); | |
416 | 414 | } |
417 | 415 | } |
418 | 416 | this->vdWCorrectionEnergy = value; |
@@ -444,10 +442,8 @@ double Cndo2::GetVdwDampingValue2ndDerivative(double vdWDistance, double distanc | ||
444 | 442 | } |
445 | 443 | |
446 | 444 | // See (2) in [G_2004] ((11) in [G_2006]) |
447 | -double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{ | |
448 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
449 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
450 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
445 | +double Cndo2::GetDiatomVdWCorrectionEnergy(const Atom& atomA, const Atom& atomB) const{ | |
446 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
451 | 447 | double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii(); |
452 | 448 | double tmpSum = atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient(); |
453 | 449 | if(tmpSum<=0e0){return 0e0;} |
@@ -460,11 +456,9 @@ double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const | ||
460 | 456 | |
461 | 457 | // First derivative of the vdW correction related to the coordinate of atom A. |
462 | 458 | // See (2) in [G_2004] ((11) in [G_2006]). |
463 | -double Cndo2::GetDiatomVdWCorrection1stDerivative(int indexAtomA, int indexAtomB, | |
459 | +double Cndo2::GetDiatomVdWCorrection1stDerivative(const Atom& atomA, const Atom& atomB, | |
464 | 460 | CartesianType axisA) const{ |
465 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
466 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
467 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
461 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
468 | 462 | double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii(); |
469 | 463 | double tmpSum = atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient(); |
470 | 464 | if(tmpSum<=0e0){return 0e0;} |
@@ -485,13 +479,11 @@ double Cndo2::GetDiatomVdWCorrection1stDerivative(int indexAtomA, int indexAtomB | ||
485 | 479 | // Second derivative of the vdW correction. |
486 | 480 | // Both derivative sare related to the coordinate of atom A. |
487 | 481 | // See (2) in [G_2004] ((11) in [G_2006]). |
488 | -double Cndo2::GetDiatomVdWCorrection2ndDerivative(int indexAtomA, | |
489 | - int indexAtomB, | |
490 | - CartesianType axisA1, | |
491 | - CartesianType axisA2) const{ | |
492 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
493 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
494 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
482 | +double Cndo2::GetDiatomVdWCorrection2ndDerivative(const Atom& atomA, | |
483 | + const Atom& atomB, | |
484 | + CartesianType axisA1, | |
485 | + CartesianType axisA2) const{ | |
486 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
495 | 487 | double dCartesian1 = atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1]; |
496 | 488 | double dCartesian2 = atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2]; |
497 | 489 | double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii(); |
@@ -136,19 +136,20 @@ protected: | ||
136 | 136 | const MolDS_base_atoms::Atom& epc) const; |
137 | 137 | virtual double GetDiatomCoreRepulsionEnergy(const MolDS_base_atoms::Atom& atomA, |
138 | 138 | const MolDS_base_atoms::Atom& atomB) const; |
139 | - virtual double GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
140 | - int indexAtomB, | |
139 | + virtual double GetDiatomCoreRepulsion1stDerivative(const MolDS_base_atoms::Atom& atomA, | |
140 | + const MolDS_base_atoms::Atom& atomB, | |
141 | 141 | MolDS_base::CartesianType axisA) const; |
142 | - virtual double GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
143 | - int indexAtomB, | |
142 | + virtual double GetDiatomCoreRepulsion2ndDerivative(const MolDS_base_atoms::Atom& atomA, | |
143 | + const MolDS_base_atoms::Atom& atomB, | |
144 | 144 | MolDS_base::CartesianType axisA1, |
145 | 145 | MolDS_base::CartesianType axisA2) const; |
146 | - virtual double GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const; | |
147 | - virtual double GetDiatomVdWCorrection1stDerivative(int indexAtomA, | |
148 | - int indexAtomB, | |
146 | + virtual double GetDiatomVdWCorrectionEnergy(const MolDS_base_atoms::Atom& atomA, | |
147 | + const MolDS_base_atoms::Atom& atomB) const; | |
148 | + virtual double GetDiatomVdWCorrection1stDerivative(const MolDS_base_atoms::Atom& atomA, | |
149 | + const MolDS_base_atoms::Atom& atomB, | |
149 | 150 | MolDS_base::CartesianType axisA) const; |
150 | - virtual double GetDiatomVdWCorrection2ndDerivative(int indexAtomA, | |
151 | - int indexAtomB, | |
151 | + virtual double GetDiatomVdWCorrection2ndDerivative(const MolDS_base_atoms::Atom& atomA, | |
152 | + const MolDS_base_atoms::Atom& atomB, | |
152 | 153 | MolDS_base::CartesianType axisA1, |
153 | 154 | MolDS_base::CartesianType axisA2) const; |
154 | 155 | double GetReducedOverlapAOs (int na, int nb, double alpha, double beta) const; |
@@ -331,14 +331,11 @@ double Mndo::GetAtomCoreEpcCoulombEnergy(const Atom& atom, const Atom& epc) cons | ||
331 | 331 | |
332 | 332 | // First derivative of diatomic core repulsion energy. |
333 | 333 | // This derivative is related to the coordinate of atomA. |
334 | -double Mndo::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
335 | - int indexAtomB, | |
334 | +double Mndo::GetDiatomCoreRepulsion1stDerivative(const Atom& atomA, const Atom& atomB, | |
336 | 335 | CartesianType axisA) const{ |
337 | 336 | double value =0.0; |
338 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
339 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
340 | - double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
341 | - double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s]; | |
337 | + double distanceAB = this->molecule->GetDistanceAtoms(atomA, atomB); | |
338 | + double twoElecInt = this->twoElecsTwoAtomCores[atomA.GetIndex()][atomB.GetIndex()][s][s][s][s]; | |
342 | 339 | double twoElecInt1stDeriv = this->GetNddoRepulsionIntegral1stDerivative( |
343 | 340 | atomA, s, s, atomB, s, s, axisA); |
344 | 341 | double tmp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, atomB, distanceAB); |
@@ -350,15 +347,13 @@ double Mndo::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | ||
350 | 347 | |
351 | 348 | // Second derivative of diatomic core repulsion energy. |
352 | 349 | // Both derivatives are related to the coordinate of atomA. |
353 | -double Mndo::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
354 | - int indexAtomB, | |
355 | - CartesianType axisA1, | |
356 | - CartesianType axisA2) const{ | |
350 | +double Mndo::GetDiatomCoreRepulsion2ndDerivative(const Atom& atomA, | |
351 | + const Atom& atomB, | |
352 | + CartesianType axisA1, | |
353 | + CartesianType axisA2) const{ | |
357 | 354 | double value =0.0; |
358 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
359 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
360 | - double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
361 | - double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s]; | |
355 | + double distanceAB = this->molecule->GetDistanceAtoms(atomA, atomB); | |
356 | + double twoElecInt = this->twoElecsTwoAtomCores[atomA.GetIndex()][atomB.GetIndex()][s][s][s][s]; | |
362 | 357 | double twoElecInt1stDeriv1 = this->GetNddoRepulsionIntegral1stDerivative(atomA, s, s, |
363 | 358 | atomB, s, s, |
364 | 359 | axisA1); |
@@ -1595,14 +1590,14 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1595 | 1590 | } |
1596 | 1591 | |
1597 | 1592 | // second derivatives of the nuclear repulsions |
1598 | - value += this->GetDiatomCoreRepulsion2ndDerivative(indexAtomA, | |
1599 | - indexAtomC, | |
1593 | + value += this->GetDiatomCoreRepulsion2ndDerivative(atomA, | |
1594 | + atomC, | |
1600 | 1595 | static_cast<CartesianType>(axisA1), |
1601 | 1596 | static_cast<CartesianType>(axisA2)); |
1602 | 1597 | // second derivatives of the van der waals corrections |
1603 | 1598 | if(Parameters::GetInstance()->RequiresVdWSCF()){ |
1604 | - value += this->GetDiatomVdWCorrection2ndDerivative(indexAtomA, | |
1605 | - indexAtomC, | |
1599 | + value += this->GetDiatomVdWCorrection2ndDerivative(atomA, | |
1600 | + atomC, | |
1606 | 1601 | static_cast<CartesianType>(axisA1), |
1607 | 1602 | static_cast<CartesianType>(axisA2)); |
1608 | 1603 | } |
@@ -1759,14 +1754,14 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1759 | 1754 | } |
1760 | 1755 | |
1761 | 1756 | // second derivatives of the nuclear repulsions |
1762 | - value -= this->GetDiatomCoreRepulsion2ndDerivative(indexAtomA, | |
1763 | - indexAtomB, | |
1757 | + value -= this->GetDiatomCoreRepulsion2ndDerivative(atomA, | |
1758 | + atomB, | |
1764 | 1759 | static_cast<CartesianType>(axisA), |
1765 | 1760 | static_cast<CartesianType>(axisB)); |
1766 | 1761 | // second derivatives of the van der waals corrections |
1767 | 1762 | if(Parameters::GetInstance()->RequiresVdWSCF()){ |
1768 | - value -= this->GetDiatomVdWCorrection2ndDerivative(indexAtomA, | |
1769 | - indexAtomB, | |
1763 | + value -= this->GetDiatomVdWCorrection2ndDerivative(atomA, | |
1764 | + atomB, | |
1770 | 1765 | static_cast<CartesianType>(axisA), |
1771 | 1766 | static_cast<CartesianType>(axisB)); |
1772 | 1767 | } |
@@ -2723,10 +2718,10 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2723 | 2718 | double coreRepulsion[CartesianType_end] = {0.0,0.0,0.0}; |
2724 | 2719 | for(int i=0; i<CartesianType_end; i++){ |
2725 | 2720 | coreRepulsion[i] += this->GetDiatomCoreRepulsion1stDerivative( |
2726 | - a, b, (CartesianType)i); | |
2721 | + atomA, atomB, (CartesianType)i); | |
2727 | 2722 | if(Parameters::GetInstance()->RequiresVdWSCF()){ |
2728 | 2723 | coreRepulsion[i] += this->GetDiatomVdWCorrection1stDerivative( |
2729 | - a, b, (CartesianType)i); | |
2724 | + atomA, atomB, (CartesianType)i); | |
2730 | 2725 | } |
2731 | 2726 | } |
2732 | 2727 | // electron core attraction part (ground state) |
@@ -56,11 +56,11 @@ protected: | ||
56 | 56 | const MolDS_base_atoms::Atom& epc) const; |
57 | 57 | virtual double GetDiatomCoreRepulsionEnergy(const MolDS_base_atoms::Atom& atomA, |
58 | 58 | const MolDS_base_atoms::Atom& atomB) const; |
59 | - virtual double GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
60 | - int indexAtomB, | |
59 | + virtual double GetDiatomCoreRepulsion1stDerivative(const MolDS_base_atoms::Atom& atomA, | |
60 | + const MolDS_base_atoms::Atom& atomB, | |
61 | 61 | MolDS_base::CartesianType axisA) const; |
62 | - virtual double GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
63 | - int indexAtomB, | |
62 | + virtual double GetDiatomCoreRepulsion2ndDerivative(const MolDS_base_atoms::Atom& atomA, | |
63 | + const MolDS_base_atoms::Atom& atomB, | |
64 | 64 | MolDS_base::CartesianType axisA1, |
65 | 65 | MolDS_base::CartesianType axisA2) const; |
66 | 66 | virtual double GetFockDiagElement(const MolDS_base_atoms::Atom& atomA, |
@@ -163,18 +163,15 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(const Atom& atomA, const Atom& atom | ||
163 | 163 | |
164 | 164 | // First derivative of diatomic core repulsion energy. |
165 | 165 | // This derivative is related to the coordinate of atomA. |
166 | -double Pm3Pddg::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
167 | - int indexAtomB, | |
166 | +double Pm3Pddg::GetDiatomCoreRepulsion1stDerivative(const Atom& atomA, const Atom& atomB, | |
168 | 167 | CartesianType axisA) const{ |
169 | 168 | // PM3 term |
170 | - double pm3Term = Pm3::GetDiatomCoreRepulsion1stDerivative(indexAtomA, indexAtomB, axisA); | |
169 | + double pm3Term = Pm3::GetDiatomCoreRepulsion1stDerivative(atomA, atomB, axisA); | |
171 | 170 | |
172 | 171 | // pddg additional term, first derivative of eq. (4) in [RCJ_2002] |
173 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
174 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
175 | 172 | int na = atomA.GetNumberValenceElectrons(); |
176 | 173 | int nb = atomB.GetNumberValenceElectrons(); |
177 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
174 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
178 | 175 | double temp = 0.0; |
179 | 176 | for(int i=0; i<2; i++){ |
180 | 177 | double pa = atomA.GetPm3PddgParameterPa(i); |
@@ -193,17 +190,15 @@ double Pm3Pddg::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | ||
193 | 190 | |
194 | 191 | // Second derivative of diatomic core repulsion energy. |
195 | 192 | // Both derivative are related to the coordinate of atomA. |
196 | -double Pm3Pddg::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
197 | - int indexAtomB, | |
198 | - CartesianType axisA1, | |
199 | - CartesianType axisA2) const{ | |
193 | +double Pm3Pddg::GetDiatomCoreRepulsion2ndDerivative(const Atom& atomA, | |
194 | + const Atom& atomB, | |
195 | + CartesianType axisA1, | |
196 | + CartesianType axisA2) const{ | |
200 | 197 | // PM3 term |
201 | - double pm3Term = Pm3::GetDiatomCoreRepulsion2ndDerivative(indexAtomA, indexAtomB, axisA1, axisA2); | |
198 | + double pm3Term = Pm3::GetDiatomCoreRepulsion2ndDerivative(atomA, atomB, axisA1, axisA2); | |
202 | 199 | |
203 | 200 | // pddg additional term, first derivative of eq. (4) in [RCJ_2002] |
204 | - const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA]; | |
205 | - const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB]; | |
206 | - double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
201 | + double distance = this->molecule->GetDistanceAtoms(atomA, atomB); | |
207 | 202 | double dCartesian1 = (atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1]); |
208 | 203 | double dCartesian2 = (atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2]); |
209 | 204 | int na = atomA.GetNumberValenceElectrons(); |
@@ -32,11 +32,11 @@ protected: | ||
32 | 32 | virtual void SetEnableAtomTypes(); |
33 | 33 | virtual double GetDiatomCoreRepulsionEnergy(const MolDS_base_atoms::Atom& atomA, |
34 | 34 | const MolDS_base_atoms::Atom& atomB) const; |
35 | - virtual double GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | |
36 | - int indexAtomB, | |
35 | + virtual double GetDiatomCoreRepulsion1stDerivative(const MolDS_base_atoms::Atom& atomA, | |
36 | + const MolDS_base_atoms::Atom& atomB, | |
37 | 37 | MolDS_base::CartesianType axisA) const; |
38 | - virtual double GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | |
39 | - int indexAtomB, | |
38 | + virtual double GetDiatomCoreRepulsion2ndDerivative(const MolDS_base_atoms::Atom& atomA, | |
39 | + const MolDS_base_atoms::Atom& atomB, | |
40 | 40 | MolDS_base::CartesianType axisA1, |
41 | 41 | MolDS_base::CartesianType axisA2) const; |
42 | 42 | private: |
@@ -3717,9 +3717,9 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3717 | 3717 | double forceElecCoreAttPart[CartesianType_end] = {0.0,0.0,0.0}; |
3718 | 3718 | for(int i=0; i<CartesianType_end; i++){ |
3719 | 3719 | // core repulsion part (ground state) |
3720 | - coreRepulsion[i] = this->GetDiatomCoreRepulsion1stDerivative(a, b, static_cast<CartesianType>(i)); | |
3720 | + coreRepulsion[i] = this->GetDiatomCoreRepulsion1stDerivative(atomA, atomB, static_cast<CartesianType>(i)); | |
3721 | 3721 | if(Parameters::GetInstance()->RequiresVdWSCF()){ |
3722 | - coreRepulsion[i] += this->GetDiatomVdWCorrection1stDerivative(a, b, static_cast<CartesianType>(i)); | |
3722 | + coreRepulsion[i] += this->GetDiatomVdWCorrection1stDerivative(atomA, atomB, static_cast<CartesianType>(i)); | |
3723 | 3723 | } |
3724 | 3724 | // electron core attraction part (ground state) |
3725 | 3725 | forceElecCoreAttPart[i] = ( atomA.GetCoreCharge()*atomicElectronPopulation[b] |
@@ -3867,10 +3867,10 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3867 | 3867 | |
3868 | 3868 | // Calculation of core repusion force |
3869 | 3869 | coreRepulsion += this->GetDiatomCoreRepulsion1stDerivative( |
3870 | - a, b, (CartesianType)i); | |
3870 | + atomA, atomB, (CartesianType)i); | |
3871 | 3871 | if(Parameters::GetInstance()->RequiresVdWSCF()){ |
3872 | 3872 | coreRepulsion += this->GetDiatomVdWCorrection1stDerivative( |
3873 | - a, b, (CartesianType)i); | |
3873 | + atomA, atomB, (CartesianType)i); | |
3874 | 3874 | } |
3875 | 3875 | |
3876 | 3876 | // Calculate force arise from electronic part. |