修订版 | 1ec4a1fe9717c2b2a7dcc04f409287c5e5198c12 (tree) |
---|---|
时间 | 2011-10-19 22:14:12 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Heats of formation in MNDO is implemented. #26393
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@229 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -46,6 +46,7 @@ protected: | ||
46 | 46 | string messageUnitSec; |
47 | 47 | vector<AtomType> enableAtomTypes; |
48 | 48 | double coreRepulsionEnergy; |
49 | + virtual void CalcHFProperties(); | |
49 | 50 | virtual void CalcCoreRepulsionEnergy(); |
50 | 51 | virtual double GetDiatomCoreRepulsionFirstDerivative(int indexAtomA, |
51 | 52 | int indexAtomB, |
@@ -87,6 +88,10 @@ protected: | ||
87 | 88 | Molecule* molecule, double** fockMatrix, double** gammaAB); |
88 | 89 | virtual void CalcTwoElecTowCore(double****** twoElecTwoCore, Molecule* molecule); |
89 | 90 | virtual void CalcForce(int electronicStateIndex); |
91 | + virtual void OutputHFResults(double** fockMatrix, | |
92 | + double* energiesMO, | |
93 | + double* atomicElectronPopulation, | |
94 | + Molecule* molecule); | |
90 | 95 | TheoryType theory; |
91 | 96 | Molecule* molecule; |
92 | 97 | double** fockMatrix; |
@@ -189,8 +194,6 @@ private: | ||
189 | 194 | int diisNumErrorVect, |
190 | 195 | Molecule* molecule, |
191 | 196 | int step); |
192 | - void OutputResults(double** fockMatrix, double* energiesMO, | |
193 | - double* atomicElectronPopulation, Molecule* molecule); | |
194 | 197 | void CheckEnableAtomType(Molecule* molecule); |
195 | 198 | void CheckNumberValenceElectrons(Molecule* molecule); |
196 | 199 | void FreeDiatomicOverlapAndRotatingMatrix(double*** diatomicOverlap, |
@@ -505,22 +508,11 @@ void Cndo2::DoesSCF(bool requiresGuess){ | ||
505 | 508 | |
506 | 509 | // calc. some properties. |
507 | 510 | // e.g. electronic energy, electron population in each atom, and core replsion. |
508 | - this->CalcAtomicElectronPopulation(this->atomicElectronPopulation, | |
509 | - this->orbitalElectronPopulation, | |
510 | - this->molecule); | |
511 | - | |
512 | - this->CalcCoreRepulsionEnergy(); | |
513 | - this->CalcElecEnergy(&this->elecEnergy, | |
514 | - this->molecule, | |
515 | - this->energiesMO, | |
516 | - this->fockMatrix, | |
517 | - this->gammaAB, | |
518 | - this->coreRepulsionEnergy); | |
519 | - | |
520 | - this->OutputResults(this->fockMatrix, | |
521 | - this->energiesMO, | |
522 | - this->atomicElectronPopulation, | |
523 | - this->molecule); | |
511 | + this->CalcHFProperties(); | |
512 | + this->OutputHFResults(this->fockMatrix, | |
513 | + this->energiesMO, | |
514 | + this->atomicElectronPopulation, | |
515 | + this->molecule); | |
524 | 516 | break; |
525 | 517 | } |
526 | 518 | else{ |
@@ -577,6 +569,19 @@ void Cndo2::DoesSCF(){ | ||
577 | 569 | this->DoesSCF(requiresGuess); |
578 | 570 | } |
579 | 571 | |
572 | +void Cndo2::CalcHFProperties(){ | |
573 | + this->CalcAtomicElectronPopulation(this->atomicElectronPopulation, | |
574 | + this->orbitalElectronPopulation, | |
575 | + this->molecule); | |
576 | + this->CalcCoreRepulsionEnergy(); | |
577 | + this->CalcElecEnergy(&this->elecEnergy, | |
578 | + this->molecule, | |
579 | + this->energiesMO, | |
580 | + this->fockMatrix, | |
581 | + this->gammaAB, | |
582 | + this->coreRepulsionEnergy); | |
583 | +} | |
584 | + | |
580 | 585 | void Cndo2::DoesCIS(){ |
581 | 586 | stringstream ss; |
582 | 587 | ss << this->errorMessageCISNotImplemented; |
@@ -743,7 +748,7 @@ void Cndo2::DoesDamp(double rmsDensity, double** orbitalElectronPopulation, | ||
743 | 748 | |
744 | 749 | } |
745 | 750 | |
746 | -void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomicElectronPopulation, Molecule* molecule){ | |
751 | +void Cndo2::OutputHFResults(double** fockMatrix, double* energiesMO, double* atomicElectronPopulation, Molecule* molecule){ | |
747 | 752 | |
748 | 753 | // output MO energy |
749 | 754 | cout << this->messageEnergiesMOs; |
@@ -759,7 +764,7 @@ void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomi | ||
759 | 764 | mo, this->messageUnOcc.c_str(), energiesMO[mo], energiesMO[mo]/eV2AU); |
760 | 765 | } |
761 | 766 | } |
762 | - cout << endl << endl; | |
767 | + cout << endl; | |
763 | 768 | |
764 | 769 | // output total energy |
765 | 770 | cout << this->messageElecEnergy; |
@@ -781,7 +786,7 @@ void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomi | ||
781 | 786 | Atom* atom = (*molecule->GetAtomVect())[a]; |
782 | 787 | printf("\t\t%d\t%s\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),atom->GetCoreCharge(),atom->GetCoreCharge()-atomicElectronPopulation[a]); |
783 | 788 | } |
784 | - cout << endl << endl; | |
789 | + cout << endl; | |
785 | 790 | |
786 | 791 | |
787 | 792 | } |
@@ -20,15 +20,15 @@ SCF | ||
20 | 20 | diis_end_error 0.00000002 |
21 | 21 | SCF_END |
22 | 22 | |
23 | -//CIS | |
24 | -// davidson yes | |
25 | -// active_occ 100 | |
26 | -// active_vir 100 | |
27 | -// nstates 5 | |
28 | -// max_iter 200 | |
29 | -// max_dim 100 | |
30 | -// norm_tol 0.000001 | |
31 | -//CIS_END | |
23 | +CIS | |
24 | + davidson yes | |
25 | + active_occ 100 | |
26 | + active_vir 100 | |
27 | + nstates 5 | |
28 | + max_iter 200 | |
29 | + max_dim 100 | |
30 | + norm_tol 0.000001 | |
31 | +CIS_END | |
32 | 32 | |
33 | 33 | //MD |
34 | 34 | // total_steps 100 |
@@ -170,28 +170,28 @@ SCF_END | ||
170 | 170 | //GEOMETRY_END |
171 | 171 | |
172 | 172 | // h2s-2 |
173 | -//GEOMETRY | |
174 | -// S 0.0000 0.0000 0.0000 | |
175 | -// H 1.2993 0.0000 0.0000 | |
176 | -// H -0.1814 1.2865 0.0000 | |
177 | -//GEOMETRY_END | |
178 | - | |
179 | -// benzene | |
180 | 173 | GEOMETRY |
181 | - C -0.505391 0.552561 0.000000 | |
182 | - C 0.889769 0.552561 0.000000 | |
183 | - C 1.587307 1.760312 0.000000 | |
184 | - C 0.889653 2.968821 -0.001199 | |
185 | - C -0.505172 2.968743 -0.001678 | |
186 | - C -1.202773 1.760537 -0.000682 | |
187 | - H -1.055150 -0.399756 0.000450 | |
188 | - H 1.439277 -0.399952 0.001315 | |
189 | - H 2.686987 1.760392 0.000634 | |
190 | - H 1.439853 3.920964 -0.001258 | |
191 | - H -1.055294 3.921024 -0.002631 | |
192 | - H -2.302377 1.760720 -0.000862 | |
174 | + S 0.0000 0.0000 0.0000 | |
175 | + H 1.2993 0.0000 0.0000 | |
176 | + H -0.1814 1.2865 0.0000 | |
193 | 177 | GEOMETRY_END |
194 | 178 | |
179 | +// benzene | |
180 | +//GEOMETRY | |
181 | +// C -0.505391 0.552561 0.000000 | |
182 | +// C 0.889769 0.552561 0.000000 | |
183 | +// C 1.587307 1.760312 0.000000 | |
184 | +// C 0.889653 2.968821 -0.001199 | |
185 | +// C -0.505172 2.968743 -0.001678 | |
186 | +// C -1.202773 1.760537 -0.000682 | |
187 | +// H -1.055150 -0.399756 0.000450 | |
188 | +// H 1.439277 -0.399952 0.001315 | |
189 | +// H 2.686987 1.760392 0.000634 | |
190 | +// H 1.439853 3.920964 -0.001258 | |
191 | +// H -1.055294 3.921024 -0.002631 | |
192 | +// H -2.302377 1.760720 -0.000862 | |
193 | +//GEOMETRY_END | |
194 | + | |
195 | 195 | // acetylene |
196 | 196 | //GEOMETRY |
197 | 197 | // C 0.24933 0.0 0.0 |
@@ -19,6 +19,11 @@ protected: | ||
19 | 19 | virtual void SetMessages(); |
20 | 20 | virtual void SetEnableAtomTypes(); |
21 | 21 | virtual void CalcCoreRepulsionEnergy(); |
22 | + virtual void CalcHFProperties(); | |
23 | + virtual void OutputHFResults(double** fockMatrix, | |
24 | + double* energiesMO, | |
25 | + double* atomicElectronPopulation, | |
26 | + Molecule* molecule); | |
22 | 27 | virtual double GetFockDiagElement(Atom* atomA, |
23 | 28 | int atomAIndex, |
24 | 29 | int mu, |
@@ -69,6 +74,10 @@ private: | ||
69 | 74 | string errorMessageCalcTwoElecTwoCoreDiatomicNullMatrix; |
70 | 75 | string errorMessageCalcTwoElecTwoCoreNullMatrix; |
71 | 76 | string errorMessageCalcTwoElecTwoCoreDiatomicSameAtoms; |
77 | + string messageHeatsFormation; | |
78 | + string messageHeatsFormationTitle; | |
79 | + double heatsFormation; | |
80 | + void CalcHeatsFormation(double* heatsFormation, Molecule* molecule); | |
72 | 81 | double GetElectronCoreAttraction(int atomAIndex, int atomBIndex, |
73 | 82 | int mu, int nu, double****** twoElecTwoCore); |
74 | 83 | void CalcTwoElecTwoCoreDiatomic(double**** matrix, int atomAIndex, int atomBIndex); |
@@ -88,6 +97,7 @@ Mndo::Mndo() : MolDS_zindo::ZindoS(){ | ||
88 | 97 | this->theory = MNDO; |
89 | 98 | this->SetMessages(); |
90 | 99 | this->SetEnableAtomTypes(); |
100 | + this->heatsFormation = 0.0; | |
91 | 101 | //cout << "Mndo created\n"; |
92 | 102 | } |
93 | 103 |
@@ -140,6 +150,8 @@ void Mndo::SetMessages(){ | ||
140 | 150 | this->messageSCFMetConvergence = "\n\n\n\t\tMNDO/S-SCF met convergence criterion(^^b\n\n\n"; |
141 | 151 | this->messageStartSCF = "********** START: MNDO/S-SCF **********\n"; |
142 | 152 | this->messageDoneSCF = "********** DONE: MNDO/S-SCF **********\n\n\n"; |
153 | + this->messageHeatsFormation = "\tHeats of formation:\n"; | |
154 | + this->messageHeatsFormationTitle = "\t\t| [a.u.] | [Kcal/mol] | \n"; | |
143 | 155 | this->messageStartCIS = "********** START: MNDO/S-CIS **********\n"; |
144 | 156 | this->messageDoneCIS = "********** DONE: MNDO/S-CIS **********\n\n\n"; |
145 | 157 | this->messageDavidsonConverge = "\n\n\t\tDavidson for MNDO-CIS met convergence criterion(^^b\n\n\n"; |
@@ -189,6 +201,33 @@ void Mndo::CalcCoreRepulsionEnergy(){ | ||
189 | 201 | this->coreRepulsionEnergy = energy; |
190 | 202 | } |
191 | 203 | |
204 | +void Mndo::CalcHeatsFormation(double* heatsFormation, Molecule* molecule){ | |
205 | + *heatsFormation = this->GetElectronicEnergy(); | |
206 | + for(int A=0; A<molecule->GetAtomVect()->size(); A++){ | |
207 | + Atom* atom = (*molecule->GetAtomVect())[A]; | |
208 | + *heatsFormation -= atom->GetMndoElecEnergyAtom(); | |
209 | + *heatsFormation += atom->GetMndoHeatsFormAtom(); | |
210 | + } | |
211 | +} | |
212 | + | |
213 | +void Mndo::CalcHFProperties(){ | |
214 | + MolDS_cndo::Cndo2::CalcHFProperties(); | |
215 | + this->CalcHeatsFormation(&this->heatsFormation, this->molecule); | |
216 | +} | |
217 | + | |
218 | +void Mndo::OutputHFResults(double** fockMatrix, double* energiesMO, | |
219 | + double* atomicElectronPopulation, Molecule* molecule){ | |
220 | + MolDS_cndo::Cndo2::OutputHFResults(fockMatrix, | |
221 | + energiesMO, | |
222 | + atomicElectronPopulation, | |
223 | + molecule); | |
224 | + // output heats of formation | |
225 | + cout << this->messageHeatsFormation; | |
226 | + cout << this->messageHeatsFormationTitle; | |
227 | + printf("\t\t%e\t%e\n\n",this->heatsFormation, | |
228 | + this->heatsFormation/Parameters::GetInstance()->GetKcalMolin2AU()); | |
229 | +} | |
230 | + | |
192 | 231 | double Mndo::GetFockDiagElement(Atom* atomA, int atomAIndex, int mu, |
193 | 232 | Molecule* molecule, double** gammaAB, |
194 | 233 | double** orbitalElectronPopulation, |