• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

コミットメタ情報

リビジョン46d92a1ff328d72e3c31b194e5f5f4f44d38f270 (tree)
日時2010-12-08 16:52:35
作者Mikiya Fujii <mikiya.fujii@gmai...>
コミッターMikiya Fujii

ログメッセージ

theory type is added.

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

変更サマリ

差分

--- a/src/MolDS.cpp
+++ b/src/MolDS.cpp
@@ -54,18 +54,25 @@ int main(){
5454 // Parse input
5555 InputParser::GetInstance()->Parse(molecule);
5656
57- // cndo2
58- MolDS_cndo::Cndo2* cndo2 = new MolDS_cndo::Cndo2();
59- cndo2->SetMolecule(molecule);
60- cndo2->DoesSCF();
61- delete cndo2;
62-
63- // indo
64- MolDS_indo::Indo* indo = new MolDS_indo::Indo();
65- indo->SetMolecule(molecule);
66- indo->DoesSCF();
67- delete indo;
57+ // CNDO/2
58+ if(Parameters::GetInstance()->GetCurrentTheory() == CNDO2){
59+ MolDS_cndo::Cndo2* cndo2 = new MolDS_cndo::Cndo2();
60+ cndo2->SetMolecule(molecule);
61+ cndo2->DoesSCF();
62+ delete cndo2;
63+ }
64+
65+ // INDO
66+ else if(Parameters::GetInstance()->GetCurrentTheory() == INDO){
67+ MolDS_indo::Indo* indo = new MolDS_indo::Indo();
68+ indo->SetMolecule(molecule);
69+ indo->DoesSCF();
70+ delete indo;
71+ }
6872
73+ // ZINDO/S
74+ else if(Parameters::GetInstance()->GetCurrentTheory() == ZINDOS){
75+ }
6976
7077 /*** test lapack ***
7178 {
--- a/src/base/Enums.h
+++ b/src/base/Enums.h
@@ -7,6 +7,13 @@
77
88 namespace MolDS_base{
99
10+RENUMSTR_BEGIN( TheoryType, TheoryTypeStr )
11+ RENUMSTR( CNDO2, "CNDO/2" )
12+ RENUMSTR( INDO, "INDO" )
13+ RENUMSTR( ZINDOS, "ZINDO/S" )
14+ RENUMSTR( TheoryType_end, "TheoryType_end" )
15+RENUMSTR_END()
16+
1017 RENUMSTR_BEGIN( ShellType, ShellTypeStr )
1118 RENUMSTR( k, "k" )
1219 RENUMSTR( l, "l" )
--- a/src/base/InputParser.h
+++ b/src/base/InputParser.h
@@ -41,6 +41,11 @@ private:
4141 string stringCommentOut;
4242 string stringGeometry;
4343 string stringGeometryEnd;
44+ string stringTheory;
45+ string stringTheoryEnd;
46+ string stringTheoryCNDO2;
47+ string stringTheoryINDO;
48+ string stringTheoryZINDOS;
4449 string stringScf;
4550 string stringScfEnd;
4651 string stringScfMaxIter;
@@ -77,10 +82,15 @@ InputParser::InputParser(){
7782 this->stringCommentOut = "//";
7883 this->stringGeometry = "geometry";
7984 this->stringGeometryEnd = "geometry_end";
85+ this->stringTheory = "theory";
86+ this->stringTheoryEnd = "theory_end";
8087 this->stringScf = "scf";
8188 this->stringScfEnd = "scf_end";
8289 this->stringScfMaxIter = "max_iter";
8390 this->stringScfRmsDensity = "rms_density";
91+ this->stringTheoryCNDO2 = "cndo/2";
92+ this->stringTheoryINDO = "indo";
93+ this->stringTheoryZINDOS = "zindo/s";
8494 }
8595
8696 InputParser::~InputParser(){
@@ -192,6 +202,29 @@ void InputParser::Parse(Molecule* molecule){
192202 i = j;
193203 }
194204
205+ // theory
206+ if(inputTerms[i].compare(this->stringTheory) == 0){
207+ int j=i+1;
208+ while(inputTerms[j].compare(this->stringTheoryEnd) != 0){
209+
210+ // CNDO/2
211+ if(inputTerms[j].compare(this->stringTheoryCNDO2) == 0){
212+ Parameters::GetInstance()->SetCurrentTheory(CNDO2);
213+ }
214+
215+ // INDO
216+ else if(inputTerms[j].compare(this->stringTheoryINDO) == 0){
217+ Parameters::GetInstance()->SetCurrentTheory(INDO);
218+ }
219+
220+ // ZINDO/S
221+ else if(inputTerms[j].compare(this->stringTheoryZINDOS) == 0){
222+ Parameters::GetInstance()->SetCurrentTheory(ZINDOS);
223+ }
224+ j++;
225+ }
226+ i = j;
227+ }
195228
196229 }
197230
--- a/src/base/Parameters.h
+++ b/src/base/Parameters.h
@@ -24,6 +24,7 @@ private:
2424 double eV2AU;
2525 double angstrom2AU;
2626 double bondingAdjustParameterK; //see (3.79) in J. A. Pople book
27+ TheoryType currentTheory;
2728
2829 public:
2930 static Parameters* GetInstance();
@@ -36,6 +37,8 @@ public:
3637 double GetEV2AU();
3738 double GetAngstrom2AU();
3839 double GetBondingAdjustParameterK();
40+ TheoryType GetCurrentTheory();
41+ void SetCurrentTheory(TheoryType theory);
3942
4043 };
4144 Parameters* Parameters::parameters = NULL;
@@ -67,6 +70,7 @@ void Parameters::SetDefaultValues(){
6770 this->thresholdSCF = pow(10.0, -8.0);
6871 this->maxIterationsSCF = 100;
6972 this->bondingAdjustParameterK = 0.75;
73+ this->currentTheory = CNDO2;
7074 }
7175
7276 double Parameters::GetThresholdSCF(){
@@ -97,6 +101,14 @@ double Parameters::GetBondingAdjustParameterK(){
97101 return this->bondingAdjustParameterK;
98102 }
99103
104+TheoryType Parameters::GetCurrentTheory(){
105+ return this->currentTheory;
106+}
107+
108+void Parameters::SetCurrentTheory(TheoryType theory){
109+ this->currentTheory = theory;
110+}
111+
100112 }
101113 #endif
102114
--- a/src/input.in
+++ b/src/input.in
@@ -3,6 +3,11 @@ SCF
33 rms_density 0.00000001
44 SCF_END
55
6+THEORY
7+ //cndo/2
8+ indo
9+ //zindo/s
10+THEORY_END
611
712 //metane
813 //GEOMETRY
@@ -33,11 +38,11 @@ SCF_END
3338 //GEOMETRY_END
3439
3540 // sh2
36-GEOMETRY
37- S -0.559299 0.471698 0.000000
38- H 0.750701 0.471698 0.000000
39- H -0.996586 1.706558 0.000000
40-GEOMETRY_END
41+//GEOMETRY
42+// S -0.559299 0.471698 0.000000
43+// H 0.750701 0.471698 0.000000
44+// H -0.996586 1.706558 0.000000
45+//GEOMETRY_END
4146
4247 // benzene
4348 //GEOMETRY
@@ -56,12 +61,12 @@ GEOMETRY_END
5661 //GEOMETRY_END
5762
5863 // acetylene
59-//GEOMETRY
60-// C 0.24933 0.0 0.0
61-// C 1.45053 0.0 0.0
62-// H -0.82067 0.0 0.0
63-// H 2.52053 0.0 0.0
64-//GEOMETRY_END
64+GEOMETRY
65+ C 0.24933 0.0 0.0
66+ C 1.45053 0.0 0.0
67+ H -0.82067 0.0 0.0
68+ H 2.52053 0.0 0.0
69+GEOMETRY_END
6570
6671 // acetylene2
6772 //GEOMETRY