Révision | bd6d4e83df0647295472f1938fa27c2de9ddb57e (tree) |
---|---|
l'heure | 2012-07-03 02:59:44 |
Auteur | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Cndo2::GetDiatomVdWCorrectionSecondDerivative is added. #28554
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@861 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -344,6 +344,17 @@ double Cndo2::GetVdwDampingValueFirstDerivative(double vdWDistance, double dista | ||
344 | 344 | *pow(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)),-2.0); |
345 | 345 | } |
346 | 346 | |
347 | +// See damping function in (2) in [G_2004] ((11) in [G_2006]) | |
348 | +double Cndo2::GetVdwDampingValueSecondDerivative(double vdWDistance, double distance) const{ | |
349 | + double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); | |
350 | + double exponent = -1.0*dampingFactor*(distance/vdWDistance - 1.0); | |
351 | + double pre = dampingFactor/vdWDistance; | |
352 | + double dominator = 1.0+exp(exponent); | |
353 | + | |
354 | + return 2.0*pow(dominator,-3.0)*pre*pre*exp(2.0*exponent) | |
355 | + - pow(dominator,-2.0)*pre*pre*exp( exponent); | |
356 | +} | |
357 | + | |
347 | 358 | // See (2) in [G_2004] ((11) in [G_2006]) |
348 | 359 | double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{ |
349 | 360 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
@@ -378,6 +389,49 @@ double Cndo2::GetDiatomVdWCorrectionFirstDerivative(int indexAtomA, int indexAto | ||
378 | 389 | return value; |
379 | 390 | } |
380 | 391 | |
392 | +// Second derivative of the vdW correction. | |
393 | +// Both derivative sare related to the coordinate of atom A. | |
394 | +// See (2) in [G_2004] ((11) in [G_2006]). | |
395 | +double Cndo2::GetDiatomVdWCorrectionSecondDerivative(int indexAtomA, | |
396 | + int indexAtomB, | |
397 | + CartesianType axisA1, | |
398 | + CartesianType axisA2) const{ | |
399 | + const Atom& atomA = *this->molecule->GetAtom(indexAtomA); | |
400 | + const Atom& atomB = *this->molecule->GetAtom(indexAtomB); | |
401 | + double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB); | |
402 | + double dCartesian1 = atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1]; | |
403 | + double dCartesian2 = atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2]; | |
404 | + double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii(); | |
405 | + double vdWScalingFacotor = Parameters::GetInstance()->GetVdWScalingFactorSCF(); | |
406 | + double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient() | |
407 | + /(atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient()); | |
408 | + double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); | |
409 | + double damping = this->GetVdwDampingValue(vdWDistance, distance); | |
410 | + double dampingFirstDerivative = this->GetVdwDampingValueFirstDerivative(vdWDistance, distance); | |
411 | + double dampingSecondDerivative = this->GetVdwDampingValueSecondDerivative(vdWDistance, distance); | |
412 | + | |
413 | + double temp1 = -6.0*pow(distance,-7.0)*damping | |
414 | + + pow(distance,-6.0)*dampingFirstDerivative; | |
415 | + double temp2 = 42.0*pow(distance,-8.0)*damping | |
416 | + -12.0*pow(distance,-7.0)*dampingFirstDerivative | |
417 | + + pow(distance,-6.0)*dampingSecondDerivative; | |
418 | + | |
419 | + double pre1=0.0; | |
420 | + double pre2=0.0; | |
421 | + if(axisA1 != axisA2){ | |
422 | + pre1 = -dCartesian1*dCartesian2/pow(distance,3.0); | |
423 | + pre2 = dCartesian1*dCartesian2/pow(distance,2.0); | |
424 | + } | |
425 | + else{ | |
426 | + pre1 = 1.0/distance - dCartesian1*dCartesian1/pow(distance,3.0); | |
427 | + pre2 = pow(dCartesian1/distance,2.0); | |
428 | + } | |
429 | + | |
430 | + double value= pre1*temp1 + pre2*temp2; | |
431 | + value *= -1.0*vdWScalingFacotor*vdWCoefficients; | |
432 | + return value; | |
433 | +} | |
434 | + | |
381 | 435 | /******* |
382 | 436 | * |
383 | 437 | * Call Cndo2::SetMolecule(Molecule* molecule) at least once, |
@@ -110,6 +110,10 @@ protected: | ||
110 | 110 | virtual double GetDiatomVdWCorrectionFirstDerivative(int indexAtomA, |
111 | 111 | int indexAtomB, |
112 | 112 | MolDS_base::CartesianType axisA) const; |
113 | + virtual double GetDiatomVdWCorrectionSecondDerivative(int indexAtomA, | |
114 | + int indexAtomB, | |
115 | + MolDS_base::CartesianType axisA1, | |
116 | + MolDS_base::CartesianType axisA2) const; | |
113 | 117 | double GetReducedOverlap(int na, int la, int m, |
114 | 118 | int nb, int lb, double alpha, double beta) const; |
115 | 119 | double GetReducedOverlap(int na, int nb, double alpha, double beta) const; |
@@ -261,6 +265,7 @@ private: | ||
261 | 265 | void CalcVdWCorrectionEnergy(); |
262 | 266 | double GetVdwDampingValue(double vdWDistance, double distance) const; |
263 | 267 | double GetVdwDampingValueFirstDerivative(double vdWDistance, double distance) const; |
268 | + double GetVdwDampingValueSecondDerivative(double vdWDistance, double distance) const; | |
264 | 269 | void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments, |
265 | 270 | double const* const* const* cartesianMatrix, |
266 | 271 | const MolDS_base::Molecule& molecule, |