• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Révisiona20e915b5fa021e81b8d0c4d162bd118846ec811 (tree)
l'heure2012-07-02 19:16:53
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

Pm3Pddg::GetDiatomCoreRepulsionSecondDerivative is implemented. #28554

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

Change Summary

Modification

--- a/src/pm3/Pm3Pddg.cpp
+++ b/src/pm3/Pm3Pddg.cpp
@@ -181,6 +181,53 @@ double Pm3Pddg::GetDiatomCoreRepulsionFirstDerivative(int atomAIndex,
181181 return pm3Term + additionalTerm;
182182 }
183183
184+// Second derivative of diatomic core repulsion energy.
185+// Both derivative are related to the coordinate of atomA.
186+double Pm3Pddg::GetDiatomCoreRepulsionSecondDerivative(int atomAIndex,
187+ int atomBIndex,
188+ CartesianType axisA1,
189+ CartesianType axisA2) const{
190+ // PM3 term
191+ double pm3Term = Pm3::GetDiatomCoreRepulsionSecondDerivative(atomAIndex, atomBIndex, axisA1, axisA2);
192+
193+ // pddg additional term, first derivative of eq. (4) in [RCJ_2002]
194+ const Atom& atomA = *this->molecule->GetAtom(atomAIndex);
195+ const Atom& atomB = *this->molecule->GetAtom(atomBIndex);
196+ double distance = this->molecule->GetDistanceAtoms(atomAIndex, atomBIndex);
197+ double dCartesian1 = (atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1]);
198+ double dCartesian2 = (atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2]);
199+ int na = atomA.GetNumberValenceElectrons();
200+ int nb = atomB.GetNumberValenceElectrons();
201+ double pddgExponent = -10.0;
202+ double tempFirstDeriv = 0.0;
203+ double tempSecondDeriv = 0.0;
204+ for(int i=0; i<2; i++){
205+ double pa = atomA.GetPm3PddgParameterPa(i);
206+ double da = atomA.GetPm3PddgParameterDa(i);
207+ for(int j=0; j<2; j++){
208+ double pb = atomB.GetPm3PddgParameterPa(j);
209+ double db = atomB.GetPm3PddgParameterDa(j);
210+ tempFirstDeriv += this->GetPddgAdditonalDiatomCoreRepulsionTermFirstDerivative(na, pa, da, nb, pb, db, distance);
211+ tempSecondDeriv += this->GetPddgAdditonalDiatomCoreRepulsionTermSecondDerivative(na, pa, da, nb, pb, db, distance);
212+ }
213+ }
214+ double preFirstDeriv = 0.0;
215+ double preSecondDeriv = 0.0;
216+ if(axisA1 != axisA2){
217+ preFirstDeriv = -dCartesian1*dCartesian2/pow(distance,3.0);
218+ preSecondDeriv = dCartesian1*dCartesian2/pow(distance,2.0);
219+ }
220+ else{
221+ preFirstDeriv = 1.0/distance - dCartesian1*dCartesian1/pow(distance,3.0);
222+ preSecondDeriv = pow(dCartesian1/distance,2.0);
223+ }
224+ preFirstDeriv /= static_cast<double>(na+nb);
225+ preSecondDeriv /= static_cast<double>(na+nb);
226+ double additionalTerm = preFirstDeriv*tempFirstDeriv + preSecondDeriv*tempSecondDeriv;
227+
228+ return pm3Term + additionalTerm;
229+}
230+
184231 // see eq. (4) in [RCJ_2002]
185232 double Pm3Pddg::GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da,
186233 int nb, double pb, double db,
--- a/src/pm3/Pm3Pddg.h
+++ b/src/pm3/Pm3Pddg.h
@@ -34,6 +34,10 @@ protected:
3434 virtual double GetDiatomCoreRepulsionFirstDerivative(int atomAIndex,
3535 int atomBIndex,
3636 MolDS_base::CartesianType axisA) const;
37+ virtual double GetDiatomCoreRepulsionSecondDerivative(int atomAIndex,
38+ int atomBIndex,
39+ MolDS_base::CartesianType axisA1,
40+ MolDS_base::CartesianType axisA2) const;
3741 private:
3842 double GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da,
3943 int nb, double pb, double db,