修订版 | 95987bb7e7082972fe73624d76c1815b2c648d78 (tree) |
---|---|
时间 | 2011-11-25 22:56:53 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Atom::GetAtomicBasisValue is implemented. #26391
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@318 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -11,8 +11,9 @@ namespace MolDS_base{ | ||
11 | 11 | |
12 | 12 | EularAngle::EularAngle(){ |
13 | 13 | this->SetMessage(); |
14 | - this->alpha = 0.0; | |
15 | - this->beta = 0.0; | |
14 | + // e the [BFB_1997] for defenitions of alpha, beta, gamma; | |
15 | + this->alpha = 0.0; // (= "phi" in P25 in J. A. Pople book) | |
16 | + this->beta = 0.0; // (= "theta" in P25 in J. A. Pople book) | |
16 | 17 | this->gamma = 0.0; |
17 | 18 | } |
18 | 19 |
@@ -8,7 +8,9 @@ | ||
8 | 8 | #include<stdexcept> |
9 | 9 | #include"../MolDSException.h" |
10 | 10 | #include"../Enums.h" |
11 | +#include"../MathUtilities.h" | |
11 | 12 | #include"../MallocerFreer.h" |
13 | +#include"../EularAngle.h" | |
12 | 14 | #include"Atom.h" |
13 | 15 | using namespace std; |
14 | 16 | using namespace MolDS_base; |
@@ -51,6 +53,12 @@ void Atom::SetMessages(){ | ||
51 | 53 | this->errorMessageOrbitalType = "\torbital type = "; |
52 | 54 | this->errorMessageShellType = "\tshell type = "; |
53 | 55 | this->errorMessageTheoryType = "\tTheory = "; |
56 | + this->errorMessageNumberValences = "\tnumber of valences = "; | |
57 | + this->errorMessageValenceIndex = "\tvalenceIndex = "; | |
58 | + this->errorMessageGetAtomicBasisValueBadValenceIndex | |
59 | + = "Error in molds_atoms::Atom::GetAtomicBasisValue: Bad valenceIndex is set.\n"; | |
60 | + this->errorMessageGetRealAnuglarPartAOBadValence | |
61 | + = "Error in molds_atoms::Atom::GetRealAnuglarPartAO: Bad valence orbital is set.\n"; | |
54 | 62 | this->errorMessageEffectivPrincipalQuantumNumber = |
55 | 63 | "Error in base::Atom::GetEffectivePrincipalQuantumNumber: invalid shelltype.\n"; |
56 | 64 | this->errorMessageZindoCoreIntegral = "Error in base_atoms::Atom::GetZindoCoreINtegral: Invalid orbitalType.\n"; |
@@ -129,6 +137,85 @@ vector<OrbitalType> Atom::GetValence(){ | ||
129 | 137 | return this->valence; |
130 | 138 | } |
131 | 139 | |
140 | +double Atom::GetAtomicBasisValue(double x, | |
141 | + double y, | |
142 | + double z, | |
143 | + int valenceIndex, | |
144 | + TheoryType theory){ | |
145 | + if(this->valence.size()<=valenceIndex){ | |
146 | + stringstream ss; | |
147 | + ss << this->errorMessageGetAtomicBasisValueBadValenceIndex; | |
148 | + ss << this->errorMessageAtomType << AtomTypeStr(this->atomType) << endl; | |
149 | + ss << this->errorMessageNumberValences << this->valence.size() << endl; | |
150 | + ss << this->errorMessageValenceIndex << valenceIndex << endl; | |
151 | + throw MolDSException(ss.str()); | |
152 | + } | |
153 | + double dx = x - this->xyz[XAxis]; | |
154 | + double dy = y - this->xyz[YAxis]; | |
155 | + double dz = z - this->xyz[ZAxis]; | |
156 | + double dr = sqrt( pow(dx,2.0) + pow(dy,2.0) + pow(dz,2.0) ); | |
157 | + EularAngle eularAngle(dx, dy, dz); | |
158 | + double angularPart = this->GetRealAnuglarPartAO(eularAngle.GetBeta(), | |
159 | + eularAngle.GetAlpha(), | |
160 | + this->valence[valenceIndex]); | |
161 | + double orbitalExponent = this->GetOrbitalExponent(this->valenceShellType, | |
162 | + this->valence[valenceIndex], | |
163 | + theory); | |
164 | + double radialPart = this->GetRadialPartAO(dr, orbitalExponent, this->valenceShellType); | |
165 | + return angularPart*radialPart; | |
166 | +} | |
167 | + | |
168 | +// See (1.74) & (1.72) in J. A. Pople book. | |
169 | +double Atom::GetRadialPartAO(double dr, double orbitalExponent, MolDS_base::ShellType shell){ | |
170 | + int principalQuantumNumber = (int)shell + 1; | |
171 | + double temp1 = pow(2.0*orbitalExponent,(double)principalQuantumNumber+0.5); | |
172 | + double temp2 = pow(Factorial(2*principalQuantumNumber),-0.5); | |
173 | + return temp1*temp2*pow(dr,principalQuantumNumber-1)*exp(-1.0*orbitalExponent*dr); | |
174 | +} | |
175 | + | |
176 | +// See Table 1 in [BFB_1997] or Table 1.2 in J. A. Pople book. | |
177 | +// See Table 1 in [BFB_1997] or p25 in J. A. Pople book for defenitions of theta and phi. | |
178 | +double Atom::GetRealAnuglarPartAO(double theta, double phi, OrbitalType orbital){ | |
179 | + double value=0.0; | |
180 | + switch(orbital){ | |
181 | + case s: | |
182 | + value = pow(4.0*M_PI,-0.5); | |
183 | + break; | |
184 | + case py: | |
185 | + value = pow(3.0/(4.0*M_PI),0.5)*sin(theta)*sin(phi); | |
186 | + break; | |
187 | + case pz: | |
188 | + value = pow(3.0/(4.0*M_PI),0.5)*cos(theta); | |
189 | + break; | |
190 | + case px: | |
191 | + value = pow(3.0/(4.0*M_PI),0.5)*sin(theta)*cos(phi); | |
192 | + break; | |
193 | + case dxy: | |
194 | + value = pow(15.0/(16.0*M_PI),0.5)*pow(sin(theta),2.0)*sin(2.0*phi); | |
195 | + break; | |
196 | + case dyz: | |
197 | + value = pow(15.0/(16.0*M_PI),0.5)*sin(2.0*theta)*sin(phi); | |
198 | + break; | |
199 | + case dzz: | |
200 | + value = pow(5.0/(16.0*M_PI),0.5)*(3.0*pow(cos(theta),2.0) - 1.0); | |
201 | + break; | |
202 | + case dzx: | |
203 | + value = pow(15.0/(16.0*M_PI),0.5)*sin(2.0*theta)*cos(phi); | |
204 | + break; | |
205 | + case dxxyy: | |
206 | + value = pow(15.0/(16.0*M_PI),0.5)*pow(sin(theta),2.0)*cos(2.0*phi); | |
207 | + break; | |
208 | + default: | |
209 | + stringstream ss; | |
210 | + ss << this->errorMessageGetRealAnuglarPartAOBadValence; | |
211 | + ss << this->errorMessageAtomType << AtomTypeStr(this->atomType) << endl; | |
212 | + ss << this->errorMessageOrbitalType << OrbitalTypeStr(orbital) << endl; | |
213 | + throw MolDSException(ss.str()); | |
214 | + } | |
215 | + return value; | |
216 | +} | |
217 | + | |
218 | + | |
132 | 219 | double Atom::GetBondingParameter(TheoryType theory, OrbitalType orbital){ |
133 | 220 | |
134 | 221 | double value = 0.0; |
@@ -14,6 +14,11 @@ public: | ||
14 | 14 | double* GetPxyz(); |
15 | 15 | void SetPxyz(double px, double py, double pz); |
16 | 16 | std::vector<MolDS_base::OrbitalType> GetValence(); |
17 | + double GetAtomicBasisValue(double x, | |
18 | + double y, | |
19 | + double z, | |
20 | + int valenceIndex, | |
21 | + MolDS_base::TheoryType theory); | |
17 | 22 | double GetBondingParameter(); |
18 | 23 | double GetBondingParameter(MolDS_base::TheoryType theory, |
19 | 24 | MolDS_base::OrbitalType orbital); |
@@ -167,9 +172,10 @@ protected: | ||
167 | 172 | double pm3ParameterL[4];// Table II in ref. [S_1989]. |
168 | 173 | double pm3ParameterM[4];// Table II in ref. [S_1989]. |
169 | 174 | private: |
170 | - void SetMessages(); | |
171 | 175 | std::string errorMessageIonPot; |
172 | 176 | std::string errorMessageAtomType; |
177 | + std::string errorMessageNumberValences; | |
178 | + std::string errorMessageValenceIndex; | |
173 | 179 | std::string errorMessageOrbitalType; |
174 | 180 | std::string errorMessageOrbitalExponent; |
175 | 181 | std::string errorMessageShellType; |
@@ -180,6 +186,8 @@ private: | ||
180 | 186 | std::string errorMessageMndoCoreIntegral; |
181 | 187 | std::string errorMessageAm1CoreIntegral; |
182 | 188 | std::string errorMessagePm3CoreIntegral; |
189 | + std::string errorMessageGetAtomicBasisValueBadValenceIndex; | |
190 | + std::string errorMessageGetRealAnuglarPartAOBadValence; | |
183 | 191 | std::string errorMessageGetOrbitalExponentBadTheory; |
184 | 192 | std::string errorMessageTheoryType; |
185 | 193 | std::string errorMessageGetBondingParameterBadTheoryBadOrbital; |
@@ -205,6 +213,9 @@ private: | ||
205 | 213 | std::string errorMessageGetNddoGpp2BadTheory; |
206 | 214 | std::string errorMessageGetNddoHspBadTheory; |
207 | 215 | std::string errorMessageGetNddoHppBadTheory; |
216 | + void SetMessages(); | |
217 | + double GetRealAnuglarPartAO(double theta, double phi, MolDS_base::OrbitalType orbital); | |
218 | + double GetRadialPartAO(double dr, double orbitalExponent, MolDS_base::ShellType shell); | |
208 | 219 | int GetEffectivePrincipalQuantumNumber(MolDS_base::ShellType shellType); // Table 1.4 in J. A. Pople book |
209 | 220 | double GetZindoJss(); // Part of Eq. (13) in [BZ_1979] |
210 | 221 | double GetZindoJsp(); // Part of Eq. (13) in [BZ_1979] |