• 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

Revisione3ec9af7417a89860f202e33335f33f24bd97624 (tree)
Time2013-08-29 16:35:30
AuthorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

Total number of AOs is cached. #30621

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

Change Summary

Incremental Difference

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -909,14 +909,15 @@ void Cndo2::DoDamp(double rmsDensity,
909909 const Molecule& molecule) const{
910910 double dampingThresh = Parameters::GetInstance()->GetDampingThreshSCF();
911911 double dampingWeight = Parameters::GetInstance()->GetDampingWeightSCF();
912+ int totalNumberAOs = molecule.GetTotalNumberAOs();
912913 hasAppliedDamping = false;
913914 if(0.0 < dampingWeight && dampingThresh < rmsDensity){
914915 hasAppliedDamping = true;
915916 stringstream ompErrors;
916917 #pragma omp parallel for schedule(auto)
917- for(int j=0; j<molecule.GetTotalNumberAOs(); j++){
918+ for(int j=0; j<totalNumberAOs; j++){
918919 try{
919- for(int k=0; k<molecule.GetTotalNumberAOs(); k++){
920+ for(int k=0; k<totalNumberAOs; k++){
920921 orbitalElectronPopulation[j][k] *= (1.0 - dampingWeight);
921922 orbitalElectronPopulation[j][k] += dampingWeight*oldOrbitalElectronPopulation[j][k];
922923 }
@@ -936,10 +937,12 @@ void Cndo2::DoDamp(double rmsDensity,
936937
937938 void Cndo2::OutputMOEnergies() const{
938939 double eV2AU = Parameters::GetInstance()->GetEV2AU();
940+ int totalNumberAOs = this->molecule->GetTotalNumberAOs();
941+ int totalNumberOccs = this->molecule->GetTotalNumberValenceElectrons()/2;
939942 this->OutputLog(this->messageEnergyMOTitle);
940- for(int mo=0; mo<this->molecule->GetTotalNumberAOs(); mo++){
943+ for(int mo=0; mo<totalNumberAOs; mo++){
941944 string occUnOcc = this->messageUnOcc;
942- if(mo < this->molecule->GetTotalNumberValenceElectrons()/2){
945+ if(mo < totalNumberOccs){
943946 occUnOcc = this->messageOcc;
944947 }
945948 this->OutputLog(boost::format("%s\t%d\t%s\t%e\t%e\n") % this->messageEnergyMO
@@ -1456,8 +1459,8 @@ void Cndo2::CalcFockMatrix(double** fockMatrix,
14561459
14571460 /*
14581461 this->OutputLog("fock matrix\n");
1459- for(int o=0; o<this->molecule.GetTotalNumberAOs(); o++){
1460- for(int p=0; p<this->molecule.GetTotalNumberAOs(); p++){
1462+ for(int o=0; o<totalNumberAOs; o++){
1463+ for(int p=0; p<totalNumberAOs; p++){
14611464 this->OutputLog(boost::format("%lf\t") % fockMatrix[o][p]);
14621465 }
14631466 this->OutputLog("\n");
@@ -1522,8 +1525,9 @@ double Cndo2::GetFockOffDiagElement(const Atom& atomA,
15221525 }
15231526
15241527 void Cndo2::TransposeFockMatrixMatrix(double** transposedFockMatrix) const{
1525- for(int i=0; i<this->molecule->GetTotalNumberAOs(); i++){
1526- for(int j=0; j<this->molecule->GetTotalNumberAOs(); j++){
1528+ const int totalNumberAOs = this->molecule->GetTotalNumberAOs();
1529+ for(int i=0; i<totalNumberAOs; i++){
1530+ for(int j=0; j<totalNumberAOs; j++){
15271531 transposedFockMatrix[j][i] = this->fockMatrix[i][j];
15281532 }
15291533 }
@@ -4000,8 +4004,8 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{
40004004
40014005 /*
40024006 this->OutputLog("overlapAOs matrix\n");
4003- for(int o=0; o<molecule.GetTotalNumberAOs(); o++){
4004- for(int p=0; p<molecule.GetTotalNumberAOs(); p++){
4007+ for(int o=0; o<totalAONumber; o++){
4008+ for(int p=0; p<totalAONumber; p++){
40054009 this->OutputLog(boost::format("%lf\t") % overlapAOs[o][p]);
40064010 }
40074011 this->OutputLog("\n");
@@ -4343,8 +4347,8 @@ void Cndo2::CalcOverlapAOsByGTOExpansion(double** overlapAOs,
43434347 }
43444348 /*
43454349 this->OutputLog("overlapAOs matrix by STOnG\n");
4346- for(int o=0; o<molecule.GetTotalNumberAOs(); o++){
4347- for(int p=0; p<molecule.GetTotalNumberAOs(); p++){
4350+ for(int o=0; o<totalAONumber; o++){
4351+ for(int p=0; p<totalAONumber; p++){
43484352 this->OutputLog(boost::format("%lf\t") % overlapAOs[o][p]);
43494353 }
43504354 this->OutputLog("\n");