Revisión | f57178675691c1ba0a7254678e21a85fa7f34ef2 (tree) |
---|---|
Tiempo | 2012-07-02 15:30:29 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Pm3Pddg::GetDiatomCoreRepulsionEnergy is refactored. #28554
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@851 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -132,10 +132,9 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) con | ||
132 | 132 | // pddg additional term, eq. (4) in [RCJ_2002] |
133 | 133 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
134 | 134 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
135 | - double na = static_cast<double>(atomA.GetNumberValenceElectrons()); | |
136 | - double nb = static_cast<double>(atomB.GetNumberValenceElectrons()); | |
135 | + int na = atomA.GetNumberValenceElectrons(); | |
136 | + int nb = atomB.GetNumberValenceElectrons(); | |
137 | 137 | double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); |
138 | - double pddgExponent = -10.0; | |
139 | 138 | double temp = 0.0; |
140 | 139 | for(int i=0; i<2; i++){ |
141 | 140 | double pa = atomA.GetPm3PddgParameterPa(i); |
@@ -143,7 +142,7 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) con | ||
143 | 142 | for(int j=0; j<2; j++){ |
144 | 143 | double pb = atomB.GetPm3PddgParameterPa(j); |
145 | 144 | double db = atomB.GetPm3PddgParameterDa(j); |
146 | - temp += (na*pa +nb*pb)*exp(pddgExponent*pow((distance-da-db),2.0)); | |
145 | + temp += this->GetPddgAdditonalDiatomCoreRepulsionTerm(na, pa, da, nb, pb, db, distance); | |
147 | 146 | } |
148 | 147 | } |
149 | 148 | double additionalTerm = temp/(na+nb); |
@@ -183,6 +182,13 @@ double Pm3Pddg::GetDiatomCoreRepulsionFirstDerivative(int atomAIndex, | ||
183 | 182 | return pm3Term + additionalTerm; |
184 | 183 | } |
185 | 184 | |
185 | +// see eq. (4) in [RCJ_2002] | |
186 | +double Pm3Pddg::GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da, | |
187 | + int nb, double pb, double db, | |
188 | + double distance) const{ | |
189 | + double pddgExponent = -10.0; | |
190 | + return (static_cast<double>(na)*pa +static_cast<double>(nb)*pb)*exp(pddgExponent*pow((distance-da-db),2.0)); | |
191 | +} | |
186 | 192 | |
187 | 193 | } |
188 | 194 |
@@ -35,6 +35,10 @@ protected: | ||
35 | 35 | int atomBIndex, |
36 | 36 | MolDS_base::CartesianType axisA) const; |
37 | 37 | private: |
38 | + double GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da, | |
39 | + int nb, double pb, double db, | |
40 | + double distance) const; | |
41 | + | |
38 | 42 | }; |
39 | 43 | |
40 | 44 | } |