• 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évision24c26ce8c0c54c30933f649a535491602360d896 (tree)
l'heure2012-07-03 01:04:06
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

Cndo2::GetDiatomVdWCorrectionEnergy is refactored. #28554

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

Change Summary

Modification

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -306,6 +306,19 @@ double Cndo2::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const
306306 return atomA.GetCoreCharge()*atomB.GetCoreCharge()/distance;
307307 }
308308
309+// First derivative of the core repulsion related to the coordinate of atom A.
310+double Cndo2::GetDiatomCoreRepulsionFirstDerivative(int indexAtomA, int indexAtomB,
311+ CartesianType axisA) const{
312+ double value=0.0;
313+ const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
314+ const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
315+ double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
316+ value = atomA.GetCoreCharge()*atomB.GetCoreCharge();
317+ value *= (atomA.GetXyz()[axisA] - atomB.GetXyz()[axisA])/distance;
318+ value *= -1.0/pow(distance,2.0);
319+ return value;
320+}
321+
309322 // See (2) in [G_2004] ((11) in [G_2006])
310323 void Cndo2::CalcVdWCorrectionEnergy(){
311324 double value = 0.0;
@@ -317,6 +330,11 @@ void Cndo2::CalcVdWCorrectionEnergy(){
317330 this->vdWCorrectionEnergy = value;
318331 }
319332
333+// See damping function in (2) in [G_2004] ((11) in [G_2006])
334+double Cndo2::GetVdwDampingValue(double vdWDistance, double distance) const{
335+ double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF();
336+ return 1.0/(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)));
337+}
320338 // See (2) in [G_2004] ((11) in [G_2006])
321339 double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{
322340 const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
@@ -325,25 +343,11 @@ double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const
325343 double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii();
326344 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()
327345 /(atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient());
328- double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF();
329- double damping = 1.0/(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)));
346+ double damping = this->GetVdwDampingValue(vdWDistance, distance);
330347 double scalingFactor = Parameters::GetInstance()->GetVdWScalingFactorSCF();
331348 return -1.0*scalingFactor*vdWCoefficients*pow(distance,-6.0)*damping;
332349 }
333350
334-// First derivative of the core repulsion related to the coordinate of atom A.
335-double Cndo2::GetDiatomCoreRepulsionFirstDerivative(int indexAtomA, int indexAtomB,
336- CartesianType axisA) const{
337- double value=0.0;
338- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
339- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
340- double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
341- value = atomA.GetCoreCharge()*atomB.GetCoreCharge();
342- value *= (atomA.GetXyz()[axisA] - atomB.GetXyz()[axisA])/distance;
343- value *= -1.0/pow(distance,2.0);
344- return value;
345-}
346-
347351 // First derivative of the vdW correction related to the coordinate of atom A.
348352 // See (2) in [G_2004] ((11) in [G_2006]).
349353 double Cndo2::GetDiatomVdWCorrectionFirstDerivative(int indexAtomA, int indexAtomB,
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -259,6 +259,7 @@ private:
259259 void OutputSCFMulliken() const;
260260 void CalcCoreRepulsionEnergy();
261261 void CalcVdWCorrectionEnergy();
262+ double GetVdwDampingValue(double vdWDistance, double distance) const;
262263 void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments,
263264 double const* const* const* cartesianMatrix,
264265 const MolDS_base::Molecule& molecule,