Revision | e3ec9af7417a89860f202e33335f33f24bd97624 (tree) |
---|---|
Time | 2013-08-29 16:35:30 |
Author | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Total number of AOs is cached. #30621
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1514 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -909,14 +909,15 @@ void Cndo2::DoDamp(double rmsDensity, | ||
909 | 909 | const Molecule& molecule) const{ |
910 | 910 | double dampingThresh = Parameters::GetInstance()->GetDampingThreshSCF(); |
911 | 911 | double dampingWeight = Parameters::GetInstance()->GetDampingWeightSCF(); |
912 | + int totalNumberAOs = molecule.GetTotalNumberAOs(); | |
912 | 913 | hasAppliedDamping = false; |
913 | 914 | if(0.0 < dampingWeight && dampingThresh < rmsDensity){ |
914 | 915 | hasAppliedDamping = true; |
915 | 916 | stringstream ompErrors; |
916 | 917 | #pragma omp parallel for schedule(auto) |
917 | - for(int j=0; j<molecule.GetTotalNumberAOs(); j++){ | |
918 | + for(int j=0; j<totalNumberAOs; j++){ | |
918 | 919 | try{ |
919 | - for(int k=0; k<molecule.GetTotalNumberAOs(); k++){ | |
920 | + for(int k=0; k<totalNumberAOs; k++){ | |
920 | 921 | orbitalElectronPopulation[j][k] *= (1.0 - dampingWeight); |
921 | 922 | orbitalElectronPopulation[j][k] += dampingWeight*oldOrbitalElectronPopulation[j][k]; |
922 | 923 | } |
@@ -936,10 +937,12 @@ void Cndo2::DoDamp(double rmsDensity, | ||
936 | 937 | |
937 | 938 | void Cndo2::OutputMOEnergies() const{ |
938 | 939 | double eV2AU = Parameters::GetInstance()->GetEV2AU(); |
940 | + int totalNumberAOs = this->molecule->GetTotalNumberAOs(); | |
941 | + int totalNumberOccs = this->molecule->GetTotalNumberValenceElectrons()/2; | |
939 | 942 | this->OutputLog(this->messageEnergyMOTitle); |
940 | - for(int mo=0; mo<this->molecule->GetTotalNumberAOs(); mo++){ | |
943 | + for(int mo=0; mo<totalNumberAOs; mo++){ | |
941 | 944 | string occUnOcc = this->messageUnOcc; |
942 | - if(mo < this->molecule->GetTotalNumberValenceElectrons()/2){ | |
945 | + if(mo < totalNumberOccs){ | |
943 | 946 | occUnOcc = this->messageOcc; |
944 | 947 | } |
945 | 948 | 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, | ||
1456 | 1459 | |
1457 | 1460 | /* |
1458 | 1461 | 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++){ | |
1461 | 1464 | this->OutputLog(boost::format("%lf\t") % fockMatrix[o][p]); |
1462 | 1465 | } |
1463 | 1466 | this->OutputLog("\n"); |
@@ -1522,8 +1525,9 @@ double Cndo2::GetFockOffDiagElement(const Atom& atomA, | ||
1522 | 1525 | } |
1523 | 1526 | |
1524 | 1527 | 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++){ | |
1527 | 1531 | transposedFockMatrix[j][i] = this->fockMatrix[i][j]; |
1528 | 1532 | } |
1529 | 1533 | } |
@@ -4000,8 +4004,8 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{ | ||
4000 | 4004 | |
4001 | 4005 | /* |
4002 | 4006 | 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++){ | |
4005 | 4009 | this->OutputLog(boost::format("%lf\t") % overlapAOs[o][p]); |
4006 | 4010 | } |
4007 | 4011 | this->OutputLog("\n"); |
@@ -4343,8 +4347,8 @@ void Cndo2::CalcOverlapAOsByGTOExpansion(double** overlapAOs, | ||
4343 | 4347 | } |
4344 | 4348 | /* |
4345 | 4349 | 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++){ | |
4348 | 4352 | this->OutputLog(boost::format("%lf\t") % overlapAOs[o][p]); |
4349 | 4353 | } |
4350 | 4354 | this->OutputLog("\n"); |