リビジョン | 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
@@ -54,18 +54,25 @@ int main(){ | ||
54 | 54 | // Parse input |
55 | 55 | InputParser::GetInstance()->Parse(molecule); |
56 | 56 | |
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 | + } | |
68 | 72 | |
73 | + // ZINDO/S | |
74 | + else if(Parameters::GetInstance()->GetCurrentTheory() == ZINDOS){ | |
75 | + } | |
69 | 76 | |
70 | 77 | /*** test lapack *** |
71 | 78 | { |
@@ -7,6 +7,13 @@ | ||
7 | 7 | |
8 | 8 | namespace MolDS_base{ |
9 | 9 | |
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 | + | |
10 | 17 | RENUMSTR_BEGIN( ShellType, ShellTypeStr ) |
11 | 18 | RENUMSTR( k, "k" ) |
12 | 19 | RENUMSTR( l, "l" ) |
@@ -41,6 +41,11 @@ private: | ||
41 | 41 | string stringCommentOut; |
42 | 42 | string stringGeometry; |
43 | 43 | string stringGeometryEnd; |
44 | + string stringTheory; | |
45 | + string stringTheoryEnd; | |
46 | + string stringTheoryCNDO2; | |
47 | + string stringTheoryINDO; | |
48 | + string stringTheoryZINDOS; | |
44 | 49 | string stringScf; |
45 | 50 | string stringScfEnd; |
46 | 51 | string stringScfMaxIter; |
@@ -77,10 +82,15 @@ InputParser::InputParser(){ | ||
77 | 82 | this->stringCommentOut = "//"; |
78 | 83 | this->stringGeometry = "geometry"; |
79 | 84 | this->stringGeometryEnd = "geometry_end"; |
85 | + this->stringTheory = "theory"; | |
86 | + this->stringTheoryEnd = "theory_end"; | |
80 | 87 | this->stringScf = "scf"; |
81 | 88 | this->stringScfEnd = "scf_end"; |
82 | 89 | this->stringScfMaxIter = "max_iter"; |
83 | 90 | this->stringScfRmsDensity = "rms_density"; |
91 | + this->stringTheoryCNDO2 = "cndo/2"; | |
92 | + this->stringTheoryINDO = "indo"; | |
93 | + this->stringTheoryZINDOS = "zindo/s"; | |
84 | 94 | } |
85 | 95 | |
86 | 96 | InputParser::~InputParser(){ |
@@ -192,6 +202,29 @@ void InputParser::Parse(Molecule* molecule){ | ||
192 | 202 | i = j; |
193 | 203 | } |
194 | 204 | |
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 | + } | |
195 | 228 | |
196 | 229 | } |
197 | 230 |
@@ -24,6 +24,7 @@ private: | ||
24 | 24 | double eV2AU; |
25 | 25 | double angstrom2AU; |
26 | 26 | double bondingAdjustParameterK; //see (3.79) in J. A. Pople book |
27 | + TheoryType currentTheory; | |
27 | 28 | |
28 | 29 | public: |
29 | 30 | static Parameters* GetInstance(); |
@@ -36,6 +37,8 @@ public: | ||
36 | 37 | double GetEV2AU(); |
37 | 38 | double GetAngstrom2AU(); |
38 | 39 | double GetBondingAdjustParameterK(); |
40 | + TheoryType GetCurrentTheory(); | |
41 | + void SetCurrentTheory(TheoryType theory); | |
39 | 42 | |
40 | 43 | }; |
41 | 44 | Parameters* Parameters::parameters = NULL; |
@@ -67,6 +70,7 @@ void Parameters::SetDefaultValues(){ | ||
67 | 70 | this->thresholdSCF = pow(10.0, -8.0); |
68 | 71 | this->maxIterationsSCF = 100; |
69 | 72 | this->bondingAdjustParameterK = 0.75; |
73 | + this->currentTheory = CNDO2; | |
70 | 74 | } |
71 | 75 | |
72 | 76 | double Parameters::GetThresholdSCF(){ |
@@ -97,6 +101,14 @@ double Parameters::GetBondingAdjustParameterK(){ | ||
97 | 101 | return this->bondingAdjustParameterK; |
98 | 102 | } |
99 | 103 | |
104 | +TheoryType Parameters::GetCurrentTheory(){ | |
105 | + return this->currentTheory; | |
106 | +} | |
107 | + | |
108 | +void Parameters::SetCurrentTheory(TheoryType theory){ | |
109 | + this->currentTheory = theory; | |
110 | +} | |
111 | + | |
100 | 112 | } |
101 | 113 | #endif |
102 | 114 |
@@ -3,6 +3,11 @@ SCF | ||
3 | 3 | rms_density 0.00000001 |
4 | 4 | SCF_END |
5 | 5 | |
6 | +THEORY | |
7 | + //cndo/2 | |
8 | + indo | |
9 | + //zindo/s | |
10 | +THEORY_END | |
6 | 11 | |
7 | 12 | //metane |
8 | 13 | //GEOMETRY |
@@ -33,11 +38,11 @@ SCF_END | ||
33 | 38 | //GEOMETRY_END |
34 | 39 | |
35 | 40 | // 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 | |
41 | 46 | |
42 | 47 | // benzene |
43 | 48 | //GEOMETRY |
@@ -56,12 +61,12 @@ GEOMETRY_END | ||
56 | 61 | //GEOMETRY_END |
57 | 62 | |
58 | 63 | // 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 | |
65 | 70 | |
66 | 71 | // acetylene2 |
67 | 72 | //GEOMETRY |