Révision | 24c26ce8c0c54c30933f649a535491602360d896 (tree) |
---|---|
l'heure | 2012-07-03 01:04:06 |
Auteur | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Cndo2::GetDiatomVdWCorrectionEnergy is refactored. #28554
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@858 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -306,6 +306,19 @@ double Cndo2::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const | ||
306 | 306 | return atomA.GetCoreCharge()*atomB.GetCoreCharge()/distance; |
307 | 307 | } |
308 | 308 | |
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 | + | |
309 | 322 | // See (2) in [G_2004] ((11) in [G_2006]) |
310 | 323 | void Cndo2::CalcVdWCorrectionEnergy(){ |
311 | 324 | double value = 0.0; |
@@ -317,6 +330,11 @@ void Cndo2::CalcVdWCorrectionEnergy(){ | ||
317 | 330 | this->vdWCorrectionEnergy = value; |
318 | 331 | } |
319 | 332 | |
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 | +} | |
320 | 338 | // See (2) in [G_2004] ((11) in [G_2006]) |
321 | 339 | double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{ |
322 | 340 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
@@ -325,25 +343,11 @@ double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const | ||
325 | 343 | double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii(); |
326 | 344 | double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient() |
327 | 345 | /(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); | |
330 | 347 | double scalingFactor = Parameters::GetInstance()->GetVdWScalingFactorSCF(); |
331 | 348 | return -1.0*scalingFactor*vdWCoefficients*pow(distance,-6.0)*damping; |
332 | 349 | } |
333 | 350 | |
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 | - | |
347 | 351 | // First derivative of the vdW correction related to the coordinate of atom A. |
348 | 352 | // See (2) in [G_2004] ((11) in [G_2006]). |
349 | 353 | double Cndo2::GetDiatomVdWCorrectionFirstDerivative(int indexAtomA, int indexAtomB, |
@@ -259,6 +259,7 @@ private: | ||
259 | 259 | void OutputSCFMulliken() const; |
260 | 260 | void CalcCoreRepulsionEnergy(); |
261 | 261 | void CalcVdWCorrectionEnergy(); |
262 | + double GetVdwDampingValue(double vdWDistance, double distance) const; | |
262 | 263 | void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments, |
263 | 264 | double const* const* const* cartesianMatrix, |
264 | 265 | const MolDS_base::Molecule& molecule, |