• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版9fc28b3838554ef223e395d3bbd7b789dffd505b (tree)
时间2013-02-07 21:54:28
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

tmp levelshift

更改概述

差异

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -585,6 +585,27 @@ void Cndo2::DoSCF(bool requiresGuess){
585585 this->OutputLog(boost::format("SCF Iter=%d: RMS commutator [F,D]=%f\n") % iterationStep
586586 % sqrt(normSquaredCommutatorFD));
587587
588+ // Level Shift
589+ double levelShifter = 2.0;
590+ if(iterationStep > 0){
591+ stringstream ompErrors;
592+#pragma omp parallel for schedule(auto)
593+ for(int i = 0; i < totalAONumber; i++){
594+ try{
595+ for(int j = 0; j < totalAONumber; j++){
596+ this->fockMatrix[i][j] -= levelShifter * oldOrbitalElectronPopulation[i][j] / 2.0;
597+ }
598+ }
599+ catch(MolDSException ex){
600+#pragma omp critical
601+ ompErrors << ex.what() << endl;
602+ }
603+ }
604+ if(!ompErrors.str().empty()){
605+ throw MolDSException(ompErrors.str());
606+ }
607+ }
608+
588609 // diagonalization of the Fock matrix
589610 bool calcEigenVectors = true;
590611 MolDS_wrappers::Lapack::GetInstance()->Dsyevd(this->fockMatrix,
@@ -606,6 +627,27 @@ void Cndo2::DoSCF(bool requiresGuess){
606627 hasAppliedDIIS);
607628 if(hasConverged){
608629 this->OutputLog(this->messageSCFMetConvergence);
630+
631+ // Re-calculate without any level-shift
632+ this->CalcFockMatrix(this->fockMatrix,
633+ *this->molecule,
634+ this->overlapAOs,
635+ this->gammaAB,
636+ this->orbitalElectronPopulation,
637+ this->atomicElectronPopulation,
638+ this->twoElecTwoCore,
639+ isGuess);
640+
641+ bool calcEigenVectors = true;
642+ MolDS_wrappers::Lapack::GetInstance()->Dsyevd(this->fockMatrix,
643+ this->energiesMO,
644+ this->molecule->GetTotalNumberAOs(),
645+ calcEigenVectors);
646+
647+ this->CalcOrbitalElectronPopulation(this->orbitalElectronPopulation,
648+ *this->molecule,
649+ this->fockMatrix);
650+
609651 this->CalcSCFProperties();
610652 this->OutputSCFResults();
611653 break;