Revisión | a3ebb27e494a66b650949cf4997d82f8da288419 (tree) |
---|---|
Tiempo | 2013-07-03 22:21:36 |
Autor | Katsuhiko Nishimra <ktns.87@gmai...> |
Commiter | Katsuhiko Nishimra |
Don't take DIIS step if DIIS matrix is singular. #30595
@@ -905,9 +905,20 @@ void Cndo2::DoDIIS(double** orbitalElectronPopulation, | ||
905 | 905 | hasAppliedDIIS = false; |
906 | 906 | if(diisNumErrorVect <= step && diisEndError<diisError && diisError<diisStartError){ |
907 | 907 | hasAppliedDIIS = true; |
908 | - MolDS_wrappers::Lapack::GetInstance()->Dsysv(diisErrorProducts, | |
909 | - diisErrorCoefficients, | |
910 | - diisNumErrorVect+1); | |
908 | + try{ | |
909 | + MolDS_wrappers::Lapack::GetInstance()->Dsysv(diisErrorProducts, | |
910 | + diisErrorCoefficients, | |
911 | + diisNumErrorVect+1); | |
912 | + }catch(MolDSException ex){ | |
913 | + if(ex.HasKey(LapackInfo) && ex.GetKeyValue<int>(LapackInfo) > 0){ | |
914 | + // DIIS matrix is now singular, so not taking DIIS step. | |
915 | + hasAppliedDIIS = false; | |
916 | + return; | |
917 | + } | |
918 | + else{ | |
919 | + throw ex; | |
920 | + } | |
921 | + } | |
911 | 922 | for(int j=0; j<totalNumberAOs; j++){ |
912 | 923 | for(int k=0; k<totalNumberAOs; k++){ |
913 | 924 | orbitalElectronPopulation[j][k] = 0.0; |