Revisão | e87d80377d6fa1ecc6871824a5dcb3c35de9c374 (tree) |
---|---|
Hora | 2013-11-30 17:30:37 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
The coulomb interaction between cores of qm-atoms is refactored to use cache. #32469
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1571 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -317,11 +317,13 @@ double Mndo::GetAuxiliaryDiatomCoreRepulsionEnergy2ndDerivative(const Atom& atom | ||
317 | 317 | double Mndo::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const{ |
318 | 318 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
319 | 319 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
320 | - double temp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, | |
321 | - atomB, | |
322 | - this->molecule->GetDistanceAtoms(atomA, atomB)); | |
323 | - double twoElecInt = this->GetNddoRepulsionIntegral(atomA, s, s, atomB, s, s); | |
324 | - return atomA.GetCoreCharge()*atomB.GetCoreCharge()*twoElecInt*temp; | |
320 | + double tmp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, | |
321 | + atomB, | |
322 | + this->molecule->GetDistanceAtoms(atomA, atomB)); | |
323 | + return atomA.GetCoreCharge() | |
324 | + *atomB.GetCoreCharge() | |
325 | + *this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s] | |
326 | + *tmp; | |
325 | 327 | } |
326 | 328 | |
327 | 329 | // First derivative of diatomic core repulsion energy. |
@@ -333,13 +335,13 @@ double Mndo::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, | ||
333 | 335 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
334 | 336 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
335 | 337 | double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); |
336 | - double twoElecInt = this->GetNddoRepulsionIntegral(atomA, s, s, atomB, s, s); | |
338 | + double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s]; | |
337 | 339 | double twoElecInt1stDeriv = this->GetNddoRepulsionIntegral1stDerivative( |
338 | 340 | atomA, s, s, atomB, s, s, axisA); |
339 | - double temp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, atomB, distanceAB); | |
340 | - double tempDeriv = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, atomB, distanceAB, axisA); | |
341 | + double tmp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, atomB, distanceAB); | |
342 | + double tmpDeriv = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, atomB, distanceAB, axisA); | |
341 | 343 | value = atomA.GetCoreCharge()*atomB.GetCoreCharge() |
342 | - *(twoElecInt1stDeriv*temp + twoElecInt*tempDeriv); | |
344 | + *(twoElecInt1stDeriv*tmp + twoElecInt*tmpDeriv); | |
343 | 345 | return value; |
344 | 346 | } |
345 | 347 |
@@ -353,8 +355,7 @@ double Mndo::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | ||
353 | 355 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
354 | 356 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
355 | 357 | double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); |
356 | - double twoElecInt = this->GetNddoRepulsionIntegral(atomA, s, s, | |
357 | - atomB, s, s); | |
358 | + double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s]; | |
358 | 359 | double twoElecInt1stDeriv1 = this->GetNddoRepulsionIntegral1stDerivative(atomA, s, s, |
359 | 360 | atomB, s, s, |
360 | 361 | axisA1); |
@@ -366,28 +367,28 @@ double Mndo::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA, | ||
366 | 367 | axisA1, |
367 | 368 | axisA2); |
368 | 369 | |
369 | - double temp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, | |
370 | - atomB, | |
371 | - distanceAB); | |
372 | - double temp1stDeriv1 = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, | |
373 | - atomB, | |
374 | - distanceAB, | |
375 | - axisA1); | |
376 | - double temp1stDeriv2 = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, | |
377 | - atomB, | |
378 | - distanceAB, | |
379 | - axisA2); | |
380 | - double temp2ndDeriv = this->GetAuxiliaryDiatomCoreRepulsionEnergy2ndDerivative(atomA, | |
370 | + double tmp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA, | |
371 | + atomB, | |
372 | + distanceAB); | |
373 | + double tmp1stDeriv1 = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, | |
374 | + atomB, | |
375 | + distanceAB, | |
376 | + axisA1); | |
377 | + double tmp1stDeriv2 = this->GetAuxiliaryDiatomCoreRepulsionEnergy1stDerivative(atomA, | |
381 | 378 | atomB, |
382 | 379 | distanceAB, |
383 | - axisA1, | |
384 | 380 | axisA2); |
381 | + double tmp2ndDeriv = this->GetAuxiliaryDiatomCoreRepulsionEnergy2ndDerivative(atomA, | |
382 | + atomB, | |
383 | + distanceAB, | |
384 | + axisA1, | |
385 | + axisA2); | |
385 | 386 | |
386 | 387 | value = atomA.GetCoreCharge()*atomB.GetCoreCharge(); |
387 | - value *= twoElecInt*temp2ndDeriv | |
388 | - +twoElecInt1stDeriv1*temp1stDeriv2 | |
389 | - +twoElecInt1stDeriv2*temp1stDeriv1 | |
390 | - +twoElecInt2ndDeriv*temp; | |
388 | + value *= twoElecInt*tmp2ndDeriv | |
389 | + +twoElecInt1stDeriv1*tmp1stDeriv2 | |
390 | + +twoElecInt1stDeriv2*tmp1stDeriv1 | |
391 | + +twoElecInt2ndDeriv*tmp; | |
391 | 392 | return value; |
392 | 393 | } |
393 | 394 |