• 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

修订版332c5485ee9a3cca6a97b422f2857c9883f72f43 (tree)
时间2011-11-08 00:39:31
作者Mikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

ZindoS::CalcForce is modified for secure use.

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

更改概述

差异

--- a/src/input.in
+++ b/src/input.in
@@ -2,10 +2,10 @@
22 THEORY
33 //cndo/2
44 //indo
5- //zindo/s
5+ zindo/s
66 //mndo
77 //am1
8- pm3
8+ //pm3
99 //none
1010 //principal_axes
1111 //translate
--- a/src/zindo/ZindoS.h
+++ b/src/zindo/ZindoS.h
@@ -71,6 +71,8 @@ protected:
7171 virtual void CalcForce(vector<int> elecStates);
7272 void CheckMatrixForce(vector<int> elecStates);
7373 private:
74+ string errorMessageCalcForceNotGroundState;
75+ string errorMessageElecState;
7476 double** matrixCIS;
7577 double* excitedEnergies;
7678 int matrixCISdimension;
@@ -179,6 +181,9 @@ void ZindoS::SetMessages(){
179181 this->errorMessageDavidsonNotConverged = "Error in zindo::ZindoS::DoesCISDavidson: Davidson did not met convergence criterion. \n";
180182 this->errorMessageDavidsonMaxIter = "Davidson roop reaches max_iter=";
181183 this->errorMessageDavidsonMaxDim = "Dimension of the expansion vectors reaches max_dim=";
184+ this->errorMessageCalcForceNotGroundState
185+ = "Error in zindo::ZindoS::CalcForce: Only ground state is enable in ZindoS.";
186+ this->errorMessageElecState = "Electronic State = ";
182187 this->messageSCFMetConvergence = "\n\n\n\t\tZINDO/S-SCF met convergence criterion(^^b\n\n\n";
183188 this->messageStartSCF = "********** START: ZINDO/S-SCF **********\n";
184189 this->messageDoneSCF = "********** DONE: ZINDO/S-SCF **********\n\n\n";
@@ -1444,6 +1449,15 @@ void ZindoS::CheckMatrixForce(vector<int> elecStates){
14441449 // electronicStates is indeces of the electroinc eigen states.
14451450 // The index = 0 means electronic ground state.
14461451 void ZindoS::CalcForce(vector<int> elecStates){
1452+ int elecState = elecStates[0];
1453+ int groundState = 0;
1454+ if(elecState != groundState){
1455+ stringstream ss;
1456+ ss << this->errorMessageCalcForceNotGroundState;
1457+ ss << this->errorMessageElecState << elecState << "\n";
1458+ throw MolDSException(ss.str());
1459+ }
1460+
14471461 this->CheckMatrixForce(elecStates);
14481462 #pragma omp parallel
14491463 {
@@ -1501,10 +1515,10 @@ void ZindoS::CalcForce(vector<int> elecStates){
15011515 }
15021516 }
15031517 for(int i=0; i<CartesianType_end; i++){
1504- this->matrixForce[0][a][i] = -1.0*(coreRepulsion[i]
1505- -electronicForce1[i]
1506- +electronicForce2[i]
1507- +electronicForce3[i]);
1518+ this->matrixForce[elecState][a][i] = -1.0*(coreRepulsion[i]
1519+ -electronicForce1[i]
1520+ +electronicForce2[i]
1521+ +electronicForce3[i]);
15081522 }
15091523 }
15101524 }