• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiond2edb109b7fa4b21091946202c303ed5bd683627 (tree)
Time2012-06-04 12:35:35
AuthorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

Cndo2::CalcDiatomicOverlapFirstDerivative is refactored. #28554

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

Change Summary

Incremental Difference

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -3365,12 +3365,12 @@ void Cndo2::CalcOverlap(double** overlap, const Molecule& molecule) const{
33653365 void Cndo2::CalcDiatomicOverlapFirstDerivative(double*** overlapFirstDeri,
33663366 const Atom& atomA,
33673367 const Atom& atomB) const{
3368- double Cartesian[CartesianType_end] = {atomA.GetXyz()[XAxis] - atomB.GetXyz()[XAxis],
3368+ double cartesian[CartesianType_end] = {atomA.GetXyz()[XAxis] - atomB.GetXyz()[XAxis],
33693369 atomA.GetXyz()[YAxis] - atomB.GetXyz()[YAxis],
33703370 atomA.GetXyz()[ZAxis] - atomB.GetXyz()[ZAxis]};
3371- double R = sqrt( pow(Cartesian[XAxis],2.0) +
3372- pow(Cartesian[YAxis],2.0) +
3373- pow(Cartesian[ZAxis],2.0) );
3371+ double R = sqrt( pow(cartesian[XAxis],2.0) +
3372+ pow(cartesian[YAxis],2.0) +
3373+ pow(cartesian[ZAxis],2.0) );
33743374
33753375 double** diatomicOverlap = NULL;
33763376 double** diaOverlapFirstDeri = NULL;
@@ -3378,17 +3378,10 @@ void Cndo2::CalcDiatomicOverlapFirstDerivative(double*** overlapFirstDeri,
33783378 double*** rotMatFirstDerivatives = NULL;
33793379
33803380 try{
3381- MallocerFreer::GetInstance()->Malloc<double>(&diatomicOverlap,
3382- OrbitalType_end,
3383- OrbitalType_end);
3384- MallocerFreer::GetInstance()->Malloc<double>(&diaOverlapFirstDeri, OrbitalType_end, OrbitalType_end);
3385- MallocerFreer::GetInstance()->Malloc<double>(&rotatingMatrix,
3386- OrbitalType_end,
3387- OrbitalType_end);
3388- MallocerFreer::GetInstance()->Malloc<double>(&rotMatFirstDerivatives,
3389- OrbitalType_end,
3390- OrbitalType_end,
3391- CartesianType_end);
3381+ this->MallocDiatomicOverlapFirstDeriTemps(&diatomicOverlap,
3382+ &diaOverlapFirstDeri,
3383+ &rotatingMatrix,
3384+ &rotMatFirstDerivatives);
33923385 this->CalcDiatomicOverlapInDiatomicFrame(diatomicOverlap, atomA, atomB);
33933386 this->CalcDiatomicOverlapFirstDerivativeInDiatomicFrame(diaOverlapFirstDeri, atomA, atomB);
33943387 this->CalcRotatingMatrix(rotatingMatrix, atomA, atomB);
@@ -3407,7 +3400,7 @@ void Cndo2::CalcDiatomicOverlapFirstDerivative(double*** overlapFirstDeri,
34073400 for(int l=0; l<OrbitalType_end; l++){
34083401 temp1 += rotatingMatrix[i][k]
34093402 *rotatingMatrix[j][l]
3410- *(Cartesian[c]/R)
3403+ *(cartesian[c]/R)
34113404 *diaOverlapFirstDeri[k][l];
34123405 temp2 += rotMatFirstDerivatives[i][k][c]
34133406 *rotatingMatrix[j][l]
@@ -3609,6 +3602,16 @@ double Cndo2::GetSecondDerivativeElementFromDistanceDerivatives(double firstDist
36093602 return value;
36103603 }
36113604
3605+void Cndo2::MallocDiatomicOverlapFirstDeriTemps(double*** diatomicOverlap,
3606+ double*** diaOverlapFirstDeri,
3607+ double*** rotatingMatrix,
3608+ double**** rotMatFirstDerivatives) const{
3609+ MallocerFreer::GetInstance()->Malloc<double>(diatomicOverlap, OrbitalType_end, OrbitalType_end);
3610+ MallocerFreer::GetInstance()->Malloc<double>(diaOverlapFirstDeri, OrbitalType_end, OrbitalType_end);
3611+ MallocerFreer::GetInstance()->Malloc<double>(rotatingMatrix, OrbitalType_end, OrbitalType_end);
3612+ MallocerFreer::GetInstance()->Malloc<double>(rotMatFirstDerivatives, OrbitalType_end, OrbitalType_end, CartesianType_end);
3613+}
3614+
36123615 void Cndo2::MallocDiatomicOverlapSecondDeriTemps(double*** diatomicOverlap,
36133616 double*** diaOverlapFirstDeri,
36143617 double*** diaOverlapSecondDeri,
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -175,6 +175,10 @@ protected:
175175 MolDS_base::CartesianType axisA2,
176176 double* cartesian,
177177 double Rab) const;
178+ void MallocDiatomicOverlapFirstDeriTemps(double*** diatomicOverlap,
179+ double*** diaOverlapFirstDeri,
180+ double*** rotatingMatrix,
181+ double**** rotMatFirstDerivatives) const;
178182 void MallocDiatomicOverlapSecondDeriTemps(double*** diatomicOverlap,
179183 double*** diaOverlapFirstDeri,
180184 double*** diaOverlapSecondDeri,