• 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évisionbd6d4e83df0647295472f1938fa27c2de9ddb57e (tree)
l'heure2012-07-03 02:59:44
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

Cndo2::GetDiatomVdWCorrectionSecondDerivative is added. #28554

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

Change Summary

Modification

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -344,6 +344,17 @@ double Cndo2::GetVdwDampingValueFirstDerivative(double vdWDistance, double dista
344344 *pow(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)),-2.0);
345345 }
346346
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+
347358 // See (2) in [G_2004] ((11) in [G_2006])
348359 double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{
349360 const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
@@ -378,6 +389,49 @@ double Cndo2::GetDiatomVdWCorrectionFirstDerivative(int indexAtomA, int indexAto
378389 return value;
379390 }
380391
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+
381435 /*******
382436 *
383437 * Call Cndo2::SetMolecule(Molecule* molecule) at least once,
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -110,6 +110,10 @@ protected:
110110 virtual double GetDiatomVdWCorrectionFirstDerivative(int indexAtomA,
111111 int indexAtomB,
112112 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;
113117 double GetReducedOverlap(int na, int la, int m,
114118 int nb, int lb, double alpha, double beta) const;
115119 double GetReducedOverlap(int na, int nb, double alpha, double beta) const;
@@ -261,6 +265,7 @@ private:
261265 void CalcVdWCorrectionEnergy();
262266 double GetVdwDampingValue(double vdWDistance, double distance) const;
263267 double GetVdwDampingValueFirstDerivative(double vdWDistance, double distance) const;
268+ double GetVdwDampingValueSecondDerivative(double vdWDistance, double distance) const;
264269 void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments,
265270 double const* const* const* cartesianMatrix,
266271 const MolDS_base::Molecule& molecule,