修订版 | c5ef493f4cc9b9ada4f1537c1ba51e75428db726 (tree) |
---|---|
时间 | 2010-12-09 12:38:53 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Core and Exchnge integral for INDO and ZINDO are moved from Atom class to INDO and ZINDOS class, respectively.
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@18 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -23,6 +23,7 @@ | ||
23 | 23 | #include"base/Parameters.h" |
24 | 24 | #include"cndo/Cndo2.h" |
25 | 25 | #include"indo/Indo.h" |
26 | +#include"zindo/ZindoS.h" | |
26 | 27 | #include"mkl_wrapper/LapackWrapper.h" |
27 | 28 | |
28 | 29 |
@@ -72,6 +73,10 @@ int main(){ | ||
72 | 73 | |
73 | 74 | // ZINDO/S |
74 | 75 | else if(Parameters::GetInstance()->GetCurrentTheory() == ZINDOS){ |
76 | + MolDS_zindo::ZindoS* zindoS = new MolDS_zindo::ZindoS(); | |
77 | + //zindoS->SetMolecule(molecule); | |
78 | + //zindoS->DoesSCF(); | |
79 | + delete zindoS; | |
75 | 80 | } |
76 | 81 | |
77 | 82 | /*** test lapack *** |
@@ -17,8 +17,6 @@ private: | ||
17 | 17 | void SetMessages(); |
18 | 18 | string errorMessageImuAmu; |
19 | 19 | string errorMessageOrbitalExponent; |
20 | - string errorMessageIndoCoulombInt; | |
21 | - string errorMessageIndoExchangeInt; | |
22 | 20 | string errorMessageShellType; |
23 | 21 | string errorMessageEffectivPrincipalQuantumNumber; |
24 | 22 | string errorMessageZindoCoreIntegral; |
@@ -83,9 +81,9 @@ public: | ||
83 | 81 | int GetNumberValenceElectrons(); |
84 | 82 | double GetImuAmu(OrbitalType orbitalType); // return 0.5*(I_mu + A_mu) |
85 | 83 | double GetOrbitalExponent(ShellType shellType, OrbitalType orbitalType); // (1.73) in J. A. Pople book. |
86 | - double GetIndoCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma); // (3.87) - (3.91) in J. A. Pople book. | |
87 | - double GetIndoExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma); // (3.87) - (3.91) in J. A. Pople book. | |
88 | 84 | virtual double GetCoreIntegral(OrbitalType orbital, double gamma, bool isGuess, TheoryType theory) = 0; // P82 - 83 in J. A. Pople book for INDO or Eq. (13) in [BZ_1979] for ZINDO/S |
85 | + double GetIndoF2(); | |
86 | + double GetIndoG1(); | |
89 | 87 | }; |
90 | 88 | |
91 | 89 | Atom::Atom(){ |
@@ -111,8 +109,6 @@ Atom::~Atom(){ | ||
111 | 109 | void Atom::SetMessages(){ |
112 | 110 | this->errorMessageImuAmu = "Error in base_atoms::Atom::GetImuAmu: Invalid orbitalType.\n"; |
113 | 111 | this->errorMessageOrbitalExponent = "Error in base_atoms::Atom::GetOrbitalExponent: Invalid shelltype or orbitalType.\n"; |
114 | - this->errorMessageIndoCoulombInt = "Error in base_atoms::Atom::GetIndoCoulombInt: Invalid orbitalType.\n"; | |
115 | - this->errorMessageIndoExchangeInt = "Error in base_atoms::Atom::GetIndoExchangeInt: Invalid orbitalType.\n"; | |
116 | 112 | this->errorMessageIndoCoreIntegral = "Error in base_atoms::Atom::GetCoreIntegral: Invalid orbitalType for INDO.\n"; |
117 | 113 | this->errorMessageZindoSCoreIntegral = "Error in base_atoms::Atom::GetCoreIntegral: Invalid orbitalType for ZINDO/S.\n"; |
118 | 114 | this->errorMessageAtomType = "\tatom type = "; |
@@ -239,69 +235,6 @@ double Atom::GetOrbitalExponent(ShellType shellType, OrbitalType orbitalType){ | ||
239 | 235 | } |
240 | 236 | |
241 | 237 | |
242 | -// (3.87) - (3.91) in J. A. Pople book. | |
243 | -// Indo Coulomb Interaction | |
244 | -double Atom::GetIndoCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma){ | |
245 | - | |
246 | - double value=0.0; | |
247 | - if( orbital1 == s && orbital2 == s){ | |
248 | - value = gamma; | |
249 | - } | |
250 | - else if( orbital1 == s && ( orbital2 == px || orbital2 == py || orbital2 == pz )){ | |
251 | - value = gamma; | |
252 | - } | |
253 | - else if( (orbital1 == px || orbital1 == py || orbital1 == pz ) && orbital2 == s){ | |
254 | - value = gamma; | |
255 | - } | |
256 | - else if( (orbital1 == orbital2) && ( orbital1 == px || orbital1 == py || orbital1 == pz )){ | |
257 | - value = gamma + 4.0*this->indoF2/25.0; | |
258 | - } | |
259 | - else if( (orbital1 != orbital2) | |
260 | - && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
261 | - && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
262 | - value = gamma - 2.0*this->indoF2/25.0; | |
263 | - } | |
264 | - else{ | |
265 | - cout << this->errorMessageIndoCoulombInt; | |
266 | - cout << this->errorMessageAtomType << AtomTypeStr(this->atomType) << "\n"; | |
267 | - cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
268 | - cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
269 | - exit(EXIT_FAILURE); | |
270 | - } | |
271 | - | |
272 | - return value; | |
273 | -} | |
274 | - | |
275 | -// (3.87) - (3.91) in J. A. Pople book. | |
276 | -// Indo Exchange interaction | |
277 | -double Atom::GetIndoExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma){ | |
278 | - double value=0.0; | |
279 | - | |
280 | - if( orbital1 == orbital2){ | |
281 | - value = this->GetIndoCoulombInt(orbital1, orbital2, gamma); | |
282 | - } | |
283 | - else if( (orbital1 == s) && (orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
284 | - value = this->indoG1/3.0; | |
285 | - } | |
286 | - else if( (orbital1 == px || orbital1 == py || orbital1 == pz) && orbital2 == s ){ | |
287 | - value = this->indoG1/3.0; | |
288 | - } | |
289 | - else if( (orbital1 != orbital2) | |
290 | - && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
291 | - && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
292 | - value = 3.0*this->indoF2/25.0; | |
293 | - } | |
294 | - else{ | |
295 | - cout << this->errorMessageIndoExchangeInt; | |
296 | - cout << this->errorMessageAtomType << AtomTypeStr(this->atomType) << "\n"; | |
297 | - cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
298 | - cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
299 | - exit(EXIT_FAILURE); | |
300 | - } | |
301 | - | |
302 | - return value; | |
303 | -} | |
304 | - | |
305 | 238 | // Part of Eq. (13) in [BZ_1979] |
306 | 239 | double Atom::GetJss(){ |
307 | 240 | return this->zindoF0ss; |
@@ -367,6 +300,13 @@ double Atom::GetZindoCoreIntegral(OrbitalType orbital, int l, int m, int n){ | ||
367 | 300 | return value; |
368 | 301 | } |
369 | 302 | |
303 | +double Atom::GetIndoF2(){ | |
304 | + return this->indoF2; | |
305 | +} | |
306 | + | |
307 | +double Atom::GetIndoG1(){ | |
308 | + return this->indoG1; | |
309 | +} | |
370 | 310 | |
371 | 311 | |
372 | 312 |
@@ -24,7 +24,6 @@ namespace MolDS_cndo{ | ||
24 | 24 | */ |
25 | 25 | class Cndo2{ |
26 | 26 | private: |
27 | - string errorMessageAtomType; | |
28 | 27 | string messageEnergiesMOs; |
29 | 28 | string messageEnergiesMOsTitle; |
30 | 29 | string messageMullikenAtoms; |
@@ -73,10 +72,14 @@ private: | ||
73 | 72 | void CheckNumberValenceElectrons(Molecule* molecule); |
74 | 73 | |
75 | 74 | protected: |
75 | + string errorMessageAtomType; | |
76 | + string errorMessageOrbitalType; | |
76 | 77 | string errorMessageSCFNotConverged; |
77 | 78 | string errorMessageMoleculeNotSet; |
78 | 79 | string errorMessageOddTotalValenceElectrions; |
79 | 80 | string errorMessageNotEnebleAtomType; |
81 | + string errorMessageCoulombInt; | |
82 | + string errorMessageExchangeInt; | |
80 | 83 | string messageSCFMetConvergence; |
81 | 84 | string messageStartSCF; |
82 | 85 | string messageDoneSCF; |
@@ -156,8 +159,8 @@ void Cndo2::SetMessages(){ | ||
156 | 159 | = "Error in cndo::Cndo2::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
157 | 160 | this->errorMessageNotEnebleAtomType |
158 | 161 | = "Error in cndo::Cndo2::ChecEnableAtomType: Not enable atom is contained.\n"; |
159 | - this->errorMessageAtomType | |
160 | - = "\tatom type = "; | |
162 | + this->errorMessageAtomType = "\tatom type = "; | |
163 | + this->errorMessageOrbitalType = "\torbital type = "; | |
161 | 164 | this->messageSCFMetConvergence = "\n\n\n\t\tCNDO/2-SCF met convergence criterion(^^b\n\n\n"; |
162 | 165 | this->messageStartSCF = "********** START: CNDO/2-SCF **********\n"; |
163 | 166 | this->messageDoneSCF = "********** DONE: CNDO/2-SCF **********\n\n\n"; |
@@ -18,20 +18,24 @@ namespace MolDS_indo{ | ||
18 | 18 | * Refferences for Indo are [PB_1970] and [PS_1966]. |
19 | 19 | */ |
20 | 20 | class Indo : public MolDS_cndo::Cndo2{ |
21 | -public: | |
22 | - Indo(); | |
23 | - ~Indo(); | |
21 | +private: | |
22 | + double GetCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom); // Indo Coulomb Interaction, (3.87) - (3.91) in J. A. Pople book. | |
23 | + double GetExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom); // Indo Exchange Interaction, (3.87) - (3.91) in J. A. Pople book. | |
24 | 24 | protected: |
25 | - void SetMessages(); | |
26 | - double GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA, | |
27 | - int mu, Molecule* molecule, double** gammaAB, | |
28 | - double** orbitalElectronPopulation, double* atomicElectronPopulation, | |
29 | - bool isGuess); | |
30 | - double GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int atomBIndex, | |
25 | + virtual void SetMessages(); | |
26 | + virtual double GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA, | |
27 | + int mu, Molecule* molecule, double** gammaAB, | |
28 | + double** orbitalElectronPopulation, double* atomicElectronPopulation, | |
29 | + bool isGuess); | |
30 | + virtual double GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int atomBIndex, | |
31 | 31 | int firstAOIndexA, int firstAOIndexB, |
32 | 32 | int mu, int nu, Molecule* molecule, double** gammaAB, double** overelap, |
33 | 33 | double** orbitalElectronPopulation, bool isGuess); |
34 | - void SetEnableAtomTypes(); | |
34 | + virtual void SetEnableAtomTypes(); | |
35 | + | |
36 | +public: | |
37 | + Indo(); | |
38 | + ~Indo(); | |
35 | 39 | }; |
36 | 40 | |
37 | 41 | Indo::Indo() : MolDS_cndo::Cndo2(){ |
@@ -54,6 +58,8 @@ void Indo::SetMessages(){ | ||
54 | 58 | = "Error in indo::Indo::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
55 | 59 | this->errorMessageNotEnebleAtomType |
56 | 60 | = "Error in indo::Indo::ChecEnableAtomType: Not enable atom is contained.\n"; |
61 | + this->errorMessageCoulombInt = "Error in base_indo::Indo::GetCoulombInt: Invalid orbitalType.\n"; | |
62 | + this->errorMessageExchangeInt = "Error in base_indo::Indo::GetExchangeInt: Invalid orbitalType.\n"; | |
57 | 63 | this->messageSCFMetConvergence = "\n\n\n\t\tINDO-SCF met convergence criterion(^^b\n\n\n"; |
58 | 64 | this->messageStartSCF = "********** START: INDO-SCF **********\n"; |
59 | 65 | this->messageDoneSCF = "********** DONE: INDO-SCF **********\n\n\n"; |
@@ -88,8 +94,8 @@ double Indo::GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA, | ||
88 | 94 | OrbitalType orbitalMu = atomA->GetValence()[mu-firstAOIndexA]; |
89 | 95 | for(int v=0; v<atomA->GetValence().size(); v++){ |
90 | 96 | OrbitalType orbitalLam = atomA->GetValence()[v]; |
91 | - coulomb = atomA->GetIndoCoulombInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex]); | |
92 | - exchange = atomA->GetIndoExchangeInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex]); | |
97 | + coulomb = this->GetCoulombInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex], atomA); | |
98 | + exchange = this->GetExchangeInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex], atomA); | |
93 | 99 | lammda = firstAOIndexA + v; |
94 | 100 | temp += orbitalElectronPopulation[lammda][lammda]*(coulomb - 0.5*exchange); |
95 | 101 | } |
@@ -129,8 +135,8 @@ double Indo::GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int | ||
129 | 135 | if(atomAIndex == atomBIndex){ |
130 | 136 | OrbitalType orbitalMu = atomA->GetValence()[mu-firstAOIndexA]; |
131 | 137 | OrbitalType orbitalNu = atomA->GetValence()[nu-firstAOIndexA]; |
132 | - coulomb = atomA->GetIndoCoulombInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex]); | |
133 | - exchange = atomA->GetIndoExchangeInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex]); | |
138 | + coulomb = this->GetCoulombInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex], atomA); | |
139 | + exchange = this->GetExchangeInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex], atomA); | |
134 | 140 | value = (1.5*exchange - 0.5*coulomb)*orbitalElectronPopulation[mu][nu]; |
135 | 141 | } |
136 | 142 | else{ |
@@ -142,6 +148,71 @@ double Indo::GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int | ||
142 | 148 | return value; |
143 | 149 | } |
144 | 150 | |
151 | +// (3.87) - (3.91) in J. A. Pople book. | |
152 | +// Indo Coulomb Interaction | |
153 | +double Indo::GetCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom){ | |
154 | + | |
155 | + double value=0.0; | |
156 | + if( orbital1 == s && orbital2 == s){ | |
157 | + value = gamma; | |
158 | + } | |
159 | + else if( orbital1 == s && ( orbital2 == px || orbital2 == py || orbital2 == pz )){ | |
160 | + value = gamma; | |
161 | + } | |
162 | + else if( (orbital1 == px || orbital1 == py || orbital1 == pz ) && orbital2 == s){ | |
163 | + value = gamma; | |
164 | + } | |
165 | + else if( (orbital1 == orbital2) && ( orbital1 == px || orbital1 == py || orbital1 == pz )){ | |
166 | + value = gamma + 4.0*atom->GetIndoF2()/25.0; | |
167 | + } | |
168 | + else if( (orbital1 != orbital2) | |
169 | + && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
170 | + && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
171 | + value = gamma - 2.0*atom->GetIndoF2()/25.0; | |
172 | + } | |
173 | + else{ | |
174 | + cout << this->errorMessageCoulombInt; | |
175 | + cout << this->errorMessageAtomType << AtomTypeStr(atom->GetAtomType()) << "\n"; | |
176 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
177 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
178 | + exit(EXIT_FAILURE); | |
179 | + } | |
180 | + | |
181 | + return value; | |
182 | + | |
183 | +} | |
184 | + | |
185 | +// (3.87) - (3.91) in J. A. Pople book. | |
186 | +// Indo Exchange Interaction | |
187 | +double Indo::GetExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom){ | |
188 | + | |
189 | + double value=0.0; | |
190 | + | |
191 | + if( orbital1 == orbital2){ | |
192 | + value = this->GetCoulombInt(orbital1, orbital2, gamma, atom); | |
193 | + } | |
194 | + else if( (orbital1 == s) && (orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
195 | + value = atom->GetIndoG1()/3.0; | |
196 | + } | |
197 | + else if( (orbital1 == px || orbital1 == py || orbital1 == pz) && orbital2 == s ){ | |
198 | + value = atom->GetIndoG1()/3.0; | |
199 | + } | |
200 | + else if( (orbital1 != orbital2) | |
201 | + && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
202 | + && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
203 | + value = 3.0*atom->GetIndoF2()/25.0; | |
204 | + } | |
205 | + else{ | |
206 | + cout << this->errorMessageExchangeInt; | |
207 | + cout << this->errorMessageAtomType << AtomTypeStr(atom->GetAtomType()) << "\n"; | |
208 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
209 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
210 | + exit(EXIT_FAILURE); | |
211 | + } | |
212 | + | |
213 | + return value; | |
214 | + | |
215 | +} | |
145 | 216 | |
146 | 217 | |
147 | 218 | } |
@@ -45,29 +45,29 @@ THEORY_END | ||
45 | 45 | //GEOMETRY_END |
46 | 46 | |
47 | 47 | // benzene |
48 | -//GEOMETRY | |
49 | -// C -0.505391 0.552561 0.000000 | |
50 | -// C 0.889769 0.552561 0.000000 | |
51 | -// C 1.587307 1.760312 0.000000 | |
52 | -// C 0.889653 2.968821 -0.001199 | |
53 | -// C -0.505172 2.968743 -0.001678 | |
54 | -// C -1.202773 1.760537 -0.000682 | |
55 | -// H -1.055150 -0.399756 0.000450 | |
56 | -// H 1.439277 -0.399952 0.001315 | |
57 | -// H 2.686987 1.760392 0.000634 | |
58 | -// H 1.439853 3.920964 -0.001258 | |
59 | -// H -1.055294 3.921024 -0.002631 | |
60 | -// H -2.302377 1.760720 -0.000862 | |
61 | -//GEOMETRY_END | |
62 | - | |
63 | -// acetylene | |
64 | 48 | 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 | |
49 | + C -0.505391 0.552561 0.000000 | |
50 | + C 0.889769 0.552561 0.000000 | |
51 | + C 1.587307 1.760312 0.000000 | |
52 | + C 0.889653 2.968821 -0.001199 | |
53 | + C -0.505172 2.968743 -0.001678 | |
54 | + C -1.202773 1.760537 -0.000682 | |
55 | + H -1.055150 -0.399756 0.000450 | |
56 | + H 1.439277 -0.399952 0.001315 | |
57 | + H 2.686987 1.760392 0.000634 | |
58 | + H 1.439853 3.920964 -0.001258 | |
59 | + H -1.055294 3.921024 -0.002631 | |
60 | + H -2.302377 1.760720 -0.000862 | |
69 | 61 | GEOMETRY_END |
70 | 62 | |
63 | +// acetylene | |
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 | |
70 | + | |
71 | 71 | // acetylene2 |
72 | 72 | //GEOMETRY |
73 | 73 | // C 0.0, 0.0 0.24933 |
@@ -1,5 +1,5 @@ | ||
1 | -#ifndef INCLUDED_INDO | |
2 | -#define INCLUDED_INDO | |
1 | +#ifndef INCLUDED_ZINDOS | |
2 | +#define INCLUDED_ZINDOS | |
3 | 3 | |
4 | 4 | #include<stdio.h> |
5 | 5 | #include<stdlib.h> |
@@ -15,24 +15,27 @@ using namespace MolDS_base_atoms; | ||
15 | 15 | namespace MolDS_zindo{ |
16 | 16 | |
17 | 17 | /*** |
18 | - * Refferences for Indo are [PB_1970] and [PS_1966]. | |
18 | + * Refferences for | |
19 | 19 | */ |
20 | 20 | class ZindoS : public MolDS_cndo::Cndo2{ |
21 | +private: | |
22 | + double GetCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom); // Apendix in [BZ_1979] | |
23 | + double GetExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom); // Apendix in [BZ_1979] | |
24 | +protected: | |
25 | + virtual void CalcGammaAB(double** gammaAB, Molecule* molecule); | |
26 | + virtual void SetMessages(); | |
27 | + virtual double GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA, | |
28 | + int mu, Molecule* molecule, double** gammaAB, | |
29 | + double** orbitalElectronPopulation, double* atomicElectronPopulation, | |
30 | + bool isGuess); | |
31 | + virtual double GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int atomBIndex, | |
32 | + int firstAOIndexA, int firstAOIndexB, | |
33 | + int mu, int nu, Molecule* molecule, double** gammaAB, double** overelap, | |
34 | + double** orbitalElectronPopulation, bool isGuess); | |
35 | + virtual void SetEnableAtomTypes(); | |
21 | 36 | public: |
22 | 37 | ZindoS(); |
23 | 38 | ~ZindoS(); |
24 | -protected: | |
25 | - void CalcGammaAB(double** gammaAB, Molecule* molecule); | |
26 | - void SetMessages(); | |
27 | - double GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA, | |
28 | - int mu, Molecule* molecule, double** gammaAB, | |
29 | - double** orbitalElectronPopulation, double* atomicElectronPopulation, | |
30 | - bool isGuess); | |
31 | - double GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, int atomBIndex, | |
32 | - int firstAOIndexA, int firstAOIndexB, | |
33 | - int mu, int nu, Molecule* molecule, double** gammaAB, double** overelap, | |
34 | - double** orbitalElectronPopulation, bool isGuess); | |
35 | - void SetEnableAtomTypes(); | |
36 | 39 | }; |
37 | 40 | |
38 | 41 | ZindoS::ZindoS() : MolDS_cndo::Cndo2(){ |
@@ -55,6 +58,8 @@ void ZindoS::SetMessages(){ | ||
55 | 58 | = "Error in zindo::ZindoS::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
56 | 59 | this->errorMessageNotEnebleAtomType |
57 | 60 | = "Error in zindo::ZindoS::CheckEnableAtomType: Not enable atom is contained.\n"; |
61 | + this->errorMessageCoulombInt = "Error in base_zindo::ZindoS::GetCoulombInt: Invalid orbitalType.\n"; | |
62 | + this->errorMessageExchangeInt = "Error in base_zindo::ZindoS::GetExchangeInt: Invalid orbitalType.\n"; | |
58 | 63 | this->messageSCFMetConvergence = "\n\n\n\t\tZINDO/S-SCF met convergence criterion(^^b\n\n\n"; |
59 | 64 | this->messageStartSCF = "********** START: ZINDO/S-SCF **********\n"; |
60 | 65 | this->messageDoneSCF = "********** DONE: ZINDO/S-SCF **********\n\n\n"; |
@@ -74,10 +79,9 @@ double ZindoS::GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA | ||
74 | 79 | double** orbitalElectronPopulation, double* atomicElectronPopulation, |
75 | 80 | bool isGuess){ |
76 | 81 | double value; |
77 | - value = atomA->GetIndoCoreIntegral(atomA->GetValence()[mu-firstAOIndexA], | |
82 | + value = atomA->GetCoreIntegral(atomA->GetValence()[mu-firstAOIndexA], | |
78 | 83 | gammaAB[atomAIndex][atomAIndex], |
79 | - isGuess); | |
80 | - | |
84 | + isGuess, this->theory); | |
81 | 85 | if(!isGuess){ |
82 | 86 | double temp = 0.0; |
83 | 87 | double coulomb = 0.0; |
@@ -86,8 +90,8 @@ double ZindoS::GetFockDiagElement(Atom* atomA, int atomAIndex, int firstAOIndexA | ||
86 | 90 | OrbitalType orbitalMu = atomA->GetValence()[mu-firstAOIndexA]; |
87 | 91 | for(int v=0; v<atomA->GetValence().size(); v++){ |
88 | 92 | OrbitalType orbitalLam = atomA->GetValence()[v]; |
89 | - coulomb = atomA->GetIndoCoulombInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex]); | |
90 | - exchange = atomA->GetIndoExchangeInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex]); | |
93 | + coulomb = this->GetCoulombInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex], atomA); | |
94 | + exchange = this->GetExchangeInt(orbitalMu, orbitalLam, gammaAB[atomAIndex][atomAIndex], atomA); | |
91 | 95 | lammda = firstAOIndexA + v; |
92 | 96 | temp += orbitalElectronPopulation[lammda][lammda]*(coulomb - 0.5*exchange); |
93 | 97 | } |
@@ -127,8 +131,8 @@ double ZindoS::GetFockOffDiagElement(Atom* atomA, Atom* atomB, int atomAIndex, i | ||
127 | 131 | if(atomAIndex == atomBIndex){ |
128 | 132 | OrbitalType orbitalMu = atomA->GetValence()[mu-firstAOIndexA]; |
129 | 133 | OrbitalType orbitalNu = atomA->GetValence()[nu-firstAOIndexA]; |
130 | - coulomb = atomA->GetIndoCoulombInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex]); | |
131 | - exchange = atomA->GetIndoExchangeInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex]); | |
134 | + coulomb = this->GetCoulombInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex], atomA); | |
135 | + exchange = this->GetExchangeInt(orbitalMu, orbitalNu, gammaAB[atomAIndex][atomAIndex], atomA); | |
132 | 136 | value = (1.5*exchange - 0.5*coulomb)*orbitalElectronPopulation[mu][nu]; |
133 | 137 | } |
134 | 138 | else{ |
@@ -144,6 +148,76 @@ void ZindoS::CalcGammaAB(double** gammaAB, Molecule* molecule){ | ||
144 | 148 | // Do nothing; |
145 | 149 | } |
146 | 150 | |
151 | +// Apendix in [BZ_1972] | |
152 | +// ZINDO Coulomb Interaction | |
153 | +double ZindoS::GetCoulombInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom){ | |
154 | + | |
155 | + double value=0.0; | |
156 | + | |
157 | + // ToDo: Coulomb interaction | |
158 | + /* | |
159 | + if( orbital1 == s && orbital2 == s){ | |
160 | + value = gamma; | |
161 | + } | |
162 | + else if( orbital1 == s && ( orbital2 == px || orbital2 == py || orbital2 == pz )){ | |
163 | + value = gamma; | |
164 | + } | |
165 | + else if( (orbital1 == px || orbital1 == py || orbital1 == pz ) && orbital2 == s){ | |
166 | + value = gamma; | |
167 | + } | |
168 | + else if( (orbital1 == orbital2) && ( orbital1 == px || orbital1 == py || orbital1 == pz )){ | |
169 | + value = gamma + 4.0*atom->GetIndoF2()/25.0; | |
170 | + } | |
171 | + else if( (orbital1 != orbital2) | |
172 | + && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
173 | + && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
174 | + value = gamma - 2.0*atom->GetIndoF2()/25.0; | |
175 | + } | |
176 | + else{ | |
177 | + cout << this->errorMessageCoulombInt; | |
178 | + cout << this->errorMessageAtomType << AtomTypeStr(atom->GetAtomType()) << "\n"; | |
179 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
180 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
181 | + exit(EXIT_FAILURE); | |
182 | + } | |
183 | + */ | |
184 | + return value; | |
185 | + | |
186 | +} | |
187 | + | |
188 | +// Apendix in [BZ_1972] | |
189 | +// ZINDO Exchange Interaction | |
190 | +double ZindoS::GetExchangeInt(OrbitalType orbital1, OrbitalType orbital2, double gamma, Atom* atom){ | |
191 | + | |
192 | + double value=0.0; | |
193 | + | |
194 | + // ToDo: Exchange interaction | |
195 | + /* | |
196 | + if( orbital1 == orbital2){ | |
197 | + value = this->GetCoulombInt(orbital1, orbital2, gamma, atom); | |
198 | + } | |
199 | + else if( (orbital1 == s) && (orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
200 | + value = atom->GetIndoG1()/3.0; | |
201 | + } | |
202 | + else if( (orbital1 == px || orbital1 == py || orbital1 == pz) && orbital2 == s ){ | |
203 | + value = atom->GetIndoG1()/3.0; | |
204 | + } | |
205 | + else if( (orbital1 != orbital2) | |
206 | + && ( orbital1 == px || orbital1 == py || orbital1 == pz ) | |
207 | + && ( orbital2 == px || orbital2 == py || orbital2 == pz ) ){ | |
208 | + value = 3.0*atom->GetIndoF2()/25.0; | |
209 | + } | |
210 | + else{ | |
211 | + cout << this->errorMessageExchangeInt; | |
212 | + cout << this->errorMessageAtomType << AtomTypeStr(atom->GetAtomType()) << "\n"; | |
213 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital1) << "\n"; | |
214 | + cout << this->errorMessageOrbitalType << OrbitalTypeStr(orbital2) << "\n"; | |
215 | + exit(EXIT_FAILURE); | |
216 | + } | |
217 | + */ | |
218 | + | |
219 | + return value; | |
220 | +} | |
147 | 221 | |
148 | 222 | } |
149 | 223 | #endif |