• 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

修订版95987bb7e7082972fe73624d76c1815b2c648d78 (tree)
时间2011-11-25 22:56:53
作者Mikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

Atom::GetAtomicBasisValue is implemented. #26391

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

更改概述

差异

--- a/src/base/EularAngle.cpp
+++ b/src/base/EularAngle.cpp
@@ -11,8 +11,9 @@ namespace MolDS_base{
1111
1212 EularAngle::EularAngle(){
1313 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)
1617 this->gamma = 0.0;
1718 }
1819
--- a/src/base/atoms/Atom.cpp
+++ b/src/base/atoms/Atom.cpp
@@ -8,7 +8,9 @@
88 #include<stdexcept>
99 #include"../MolDSException.h"
1010 #include"../Enums.h"
11+#include"../MathUtilities.h"
1112 #include"../MallocerFreer.h"
13+#include"../EularAngle.h"
1214 #include"Atom.h"
1315 using namespace std;
1416 using namespace MolDS_base;
@@ -51,6 +53,12 @@ void Atom::SetMessages(){
5153 this->errorMessageOrbitalType = "\torbital type = ";
5254 this->errorMessageShellType = "\tshell type = ";
5355 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";
5462 this->errorMessageEffectivPrincipalQuantumNumber =
5563 "Error in base::Atom::GetEffectivePrincipalQuantumNumber: invalid shelltype.\n";
5664 this->errorMessageZindoCoreIntegral = "Error in base_atoms::Atom::GetZindoCoreINtegral: Invalid orbitalType.\n";
@@ -129,6 +137,85 @@ vector<OrbitalType> Atom::GetValence(){
129137 return this->valence;
130138 }
131139
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+
132219 double Atom::GetBondingParameter(TheoryType theory, OrbitalType orbital){
133220
134221 double value = 0.0;
--- a/src/base/atoms/Atom.h
+++ b/src/base/atoms/Atom.h
@@ -14,6 +14,11 @@ public:
1414 double* GetPxyz();
1515 void SetPxyz(double px, double py, double pz);
1616 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);
1722 double GetBondingParameter();
1823 double GetBondingParameter(MolDS_base::TheoryType theory,
1924 MolDS_base::OrbitalType orbital);
@@ -167,9 +172,10 @@ protected:
167172 double pm3ParameterL[4];// Table II in ref. [S_1989].
168173 double pm3ParameterM[4];// Table II in ref. [S_1989].
169174 private:
170- void SetMessages();
171175 std::string errorMessageIonPot;
172176 std::string errorMessageAtomType;
177+ std::string errorMessageNumberValences;
178+ std::string errorMessageValenceIndex;
173179 std::string errorMessageOrbitalType;
174180 std::string errorMessageOrbitalExponent;
175181 std::string errorMessageShellType;
@@ -180,6 +186,8 @@ private:
180186 std::string errorMessageMndoCoreIntegral;
181187 std::string errorMessageAm1CoreIntegral;
182188 std::string errorMessagePm3CoreIntegral;
189+ std::string errorMessageGetAtomicBasisValueBadValenceIndex;
190+ std::string errorMessageGetRealAnuglarPartAOBadValence;
183191 std::string errorMessageGetOrbitalExponentBadTheory;
184192 std::string errorMessageTheoryType;
185193 std::string errorMessageGetBondingParameterBadTheoryBadOrbital;
@@ -205,6 +213,9 @@ private:
205213 std::string errorMessageGetNddoGpp2BadTheory;
206214 std::string errorMessageGetNddoHspBadTheory;
207215 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);
208219 int GetEffectivePrincipalQuantumNumber(MolDS_base::ShellType shellType); // Table 1.4 in J. A. Pople book
209220 double GetZindoJss(); // Part of Eq. (13) in [BZ_1979]
210221 double GetZindoJsp(); // Part of Eq. (13) in [BZ_1979]