• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónf57178675691c1ba0a7254678e21a85fa7f34ef2 (tree)
Tiempo2012-07-02 15:30:29
AutorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

Pm3Pddg::GetDiatomCoreRepulsionEnergy is refactored. #28554

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@851 1136aad2-a195-0410-b898-f5ea1d11b9d8

Cambiar Resumen

Diferencia incremental

--- a/src/pm3/Pm3Pddg.cpp
+++ b/src/pm3/Pm3Pddg.cpp
@@ -132,10 +132,9 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) con
132132 // pddg additional term, eq. (4) in [RCJ_2002]
133133 const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
134134 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();
137137 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
138- double pddgExponent = -10.0;
139138 double temp = 0.0;
140139 for(int i=0; i<2; i++){
141140 double pa = atomA.GetPm3PddgParameterPa(i);
@@ -143,7 +142,7 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) con
143142 for(int j=0; j<2; j++){
144143 double pb = atomB.GetPm3PddgParameterPa(j);
145144 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);
147146 }
148147 }
149148 double additionalTerm = temp/(na+nb);
@@ -183,6 +182,13 @@ double Pm3Pddg::GetDiatomCoreRepulsionFirstDerivative(int atomAIndex,
183182 return pm3Term + additionalTerm;
184183 }
185184
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+}
186192
187193 }
188194
--- a/src/pm3/Pm3Pddg.h
+++ b/src/pm3/Pm3Pddg.h
@@ -35,6 +35,10 @@ protected:
3535 int atomBIndex,
3636 MolDS_base::CartesianType axisA) const;
3737 private:
38+ double GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da,
39+ int nb, double pb, double db,
40+ double distance) const;
41+
3842 };
3943
4044 }