Révision | a20e915b5fa021e81b8d0c4d162bd118846ec811 (tree) |
---|---|
l'heure | 2012-07-02 19:16:53 |
Auteur | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Pm3Pddg::GetDiatomCoreRepulsionSecondDerivative is implemented. #28554
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@857 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -181,6 +181,53 @@ double Pm3Pddg::GetDiatomCoreRepulsionFirstDerivative(int atomAIndex, | ||
181 | 181 | return pm3Term + additionalTerm; |
182 | 182 | } |
183 | 183 | |
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 | + | |
184 | 231 | // see eq. (4) in [RCJ_2002] |
185 | 232 | double Pm3Pddg::GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da, |
186 | 233 | int nb, double pb, double db, |
@@ -34,6 +34,10 @@ protected: | ||
34 | 34 | virtual double GetDiatomCoreRepulsionFirstDerivative(int atomAIndex, |
35 | 35 | int atomBIndex, |
36 | 36 | 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; | |
37 | 41 | private: |
38 | 42 | double GetPddgAdditonalDiatomCoreRepulsionTerm(int na, double pa, double da, |
39 | 43 | int nb, double pb, double db, |