• 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

修订版1ec4a1fe9717c2b2a7dcc04f409287c5e5198c12 (tree)
时间2011-10-19 22:14:12
作者Mikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

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

更改概述

差异

--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -46,6 +46,7 @@ protected:
4646 string messageUnitSec;
4747 vector<AtomType> enableAtomTypes;
4848 double coreRepulsionEnergy;
49+ virtual void CalcHFProperties();
4950 virtual void CalcCoreRepulsionEnergy();
5051 virtual double GetDiatomCoreRepulsionFirstDerivative(int indexAtomA,
5152 int indexAtomB,
@@ -87,6 +88,10 @@ protected:
8788 Molecule* molecule, double** fockMatrix, double** gammaAB);
8889 virtual void CalcTwoElecTowCore(double****** twoElecTwoCore, Molecule* molecule);
8990 virtual void CalcForce(int electronicStateIndex);
91+ virtual void OutputHFResults(double** fockMatrix,
92+ double* energiesMO,
93+ double* atomicElectronPopulation,
94+ Molecule* molecule);
9095 TheoryType theory;
9196 Molecule* molecule;
9297 double** fockMatrix;
@@ -189,8 +194,6 @@ private:
189194 int diisNumErrorVect,
190195 Molecule* molecule,
191196 int step);
192- void OutputResults(double** fockMatrix, double* energiesMO,
193- double* atomicElectronPopulation, Molecule* molecule);
194197 void CheckEnableAtomType(Molecule* molecule);
195198 void CheckNumberValenceElectrons(Molecule* molecule);
196199 void FreeDiatomicOverlapAndRotatingMatrix(double*** diatomicOverlap,
@@ -505,22 +508,11 @@ void Cndo2::DoesSCF(bool requiresGuess){
505508
506509 // calc. some properties.
507510 // 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);
524516 break;
525517 }
526518 else{
@@ -577,6 +569,19 @@ void Cndo2::DoesSCF(){
577569 this->DoesSCF(requiresGuess);
578570 }
579571
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+
580585 void Cndo2::DoesCIS(){
581586 stringstream ss;
582587 ss << this->errorMessageCISNotImplemented;
@@ -743,7 +748,7 @@ void Cndo2::DoesDamp(double rmsDensity, double** orbitalElectronPopulation,
743748
744749 }
745750
746-void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomicElectronPopulation, Molecule* molecule){
751+void Cndo2::OutputHFResults(double** fockMatrix, double* energiesMO, double* atomicElectronPopulation, Molecule* molecule){
747752
748753 // output MO energy
749754 cout << this->messageEnergiesMOs;
@@ -759,7 +764,7 @@ void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomi
759764 mo, this->messageUnOcc.c_str(), energiesMO[mo], energiesMO[mo]/eV2AU);
760765 }
761766 }
762- cout << endl << endl;
767+ cout << endl;
763768
764769 // output total energy
765770 cout << this->messageElecEnergy;
@@ -781,7 +786,7 @@ void Cndo2::OutputResults(double** fockMatrix, double* energiesMO, double* atomi
781786 Atom* atom = (*molecule->GetAtomVect())[a];
782787 printf("\t\t%d\t%s\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),atom->GetCoreCharge(),atom->GetCoreCharge()-atomicElectronPopulation[a]);
783788 }
784- cout << endl << endl;
789+ cout << endl;
785790
786791
787792 }
--- a/src/input.in
+++ b/src/input.in
@@ -20,15 +20,15 @@ SCF
2020 diis_end_error 0.00000002
2121 SCF_END
2222
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
3232
3333 //MD
3434 // total_steps 100
@@ -170,28 +170,28 @@ SCF_END
170170 //GEOMETRY_END
171171
172172 // 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
180173 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
193177 GEOMETRY_END
194178
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+
195195 // acetylene
196196 //GEOMETRY
197197 // C 0.24933 0.0 0.0
--- a/src/mndo/Mndo.h
+++ b/src/mndo/Mndo.h
@@ -19,6 +19,11 @@ protected:
1919 virtual void SetMessages();
2020 virtual void SetEnableAtomTypes();
2121 virtual void CalcCoreRepulsionEnergy();
22+ virtual void CalcHFProperties();
23+ virtual void OutputHFResults(double** fockMatrix,
24+ double* energiesMO,
25+ double* atomicElectronPopulation,
26+ Molecule* molecule);
2227 virtual double GetFockDiagElement(Atom* atomA,
2328 int atomAIndex,
2429 int mu,
@@ -69,6 +74,10 @@ private:
6974 string errorMessageCalcTwoElecTwoCoreDiatomicNullMatrix;
7075 string errorMessageCalcTwoElecTwoCoreNullMatrix;
7176 string errorMessageCalcTwoElecTwoCoreDiatomicSameAtoms;
77+ string messageHeatsFormation;
78+ string messageHeatsFormationTitle;
79+ double heatsFormation;
80+ void CalcHeatsFormation(double* heatsFormation, Molecule* molecule);
7281 double GetElectronCoreAttraction(int atomAIndex, int atomBIndex,
7382 int mu, int nu, double****** twoElecTwoCore);
7483 void CalcTwoElecTwoCoreDiatomic(double**** matrix, int atomAIndex, int atomBIndex);
@@ -88,6 +97,7 @@ Mndo::Mndo() : MolDS_zindo::ZindoS(){
8897 this->theory = MNDO;
8998 this->SetMessages();
9099 this->SetEnableAtomTypes();
100+ this->heatsFormation = 0.0;
91101 //cout << "Mndo created\n";
92102 }
93103
@@ -140,6 +150,8 @@ void Mndo::SetMessages(){
140150 this->messageSCFMetConvergence = "\n\n\n\t\tMNDO/S-SCF met convergence criterion(^^b\n\n\n";
141151 this->messageStartSCF = "********** START: MNDO/S-SCF **********\n";
142152 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";
143155 this->messageStartCIS = "********** START: MNDO/S-CIS **********\n";
144156 this->messageDoneCIS = "********** DONE: MNDO/S-CIS **********\n\n\n";
145157 this->messageDavidsonConverge = "\n\n\t\tDavidson for MNDO-CIS met convergence criterion(^^b\n\n\n";
@@ -189,6 +201,33 @@ void Mndo::CalcCoreRepulsionEnergy(){
189201 this->coreRepulsionEnergy = energy;
190202 }
191203
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+
192231 double Mndo::GetFockDiagElement(Atom* atomA, int atomAIndex, int mu,
193232 Molecule* molecule, double** gammaAB,
194233 double** orbitalElectronPopulation,