• 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

修订版c0750382365aef547d3551c293dc2c635af0c9d3 (tree)
时间2011-01-05 14:26:05
作者Mikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

output moleculer basics are moved to Molecular.h from InputParser.h

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

更改概述

差异

--- a/src/base/InputParser.h
+++ b/src/base/InputParser.h
@@ -30,12 +30,6 @@ private:
3030 string messageTotalNumberAOs;
3131 string messageTotalNumberAtoms;
3232 string messageTotalNumberValenceElectrons;
33- string messageConfigration;
34- string messageConfigrationTitleAU;
35- string messageConfigrationTitleAng;
36- string messageCOM;
37- string messageCOMTitleAU;
38- string messageCOMTitleAng;
3933 string messageInputTerms;
4034 string messageScfConditions;
4135 string messageScfMaxIterations;
@@ -75,12 +69,6 @@ InputParser::InputParser(){
7569 this->messageTotalNumberAOs = "\tTotal number of valence AOs: ";
7670 this->messageTotalNumberAtoms = "\tTotal number of atoms: ";
7771 this->messageTotalNumberValenceElectrons = "\tTotal number of valence electrons: ";
78- this->messageConfigration = "\tMolecular configration:\n";
79- this->messageConfigrationTitleAU = "\t\t| i-th | atom type | x [a.u.] | y[a.u.] | z[a.u.] |\n";
80- this->messageConfigrationTitleAng = "\t\t| i-th | atom type | x [angst.] | y[angst.] | z[angst.] |\n";
81- this->messageCOM = "\tCenter of Mass:\n";
82- this->messageCOMTitleAU = "\t\t| x [a.u.] | y[a.u.] | z[a.u.] |\n";
83- this->messageCOMTitleAng = "\t\t| x [angst.] | y[angst.] | z[angst.] |\n";
8472 this->messageInputTerms = "Input terms:\n";
8573 this->messageScfConditions = "\tSCF conditions:\n";
8674 this->messageScfMaxIterations = "\t\tMax iterations: ";
@@ -259,44 +247,9 @@ void InputParser::CalcMolecularBasics(Molecule* molecule){
259247
260248 void InputParser::OutputMolecularBasics(Molecule* molecule){
261249
262- // Total number of Atoms
263- cout << this->messageTotalNumberAtoms << molecule->GetAtomVect()->size() << "\n";
264- cout << this->messageTotalNumberAOs << molecule->GetTotalNumberAOs() << "\n";
265- cout << this->messageTotalNumberValenceElectrons << molecule->GetTotalNumberValenceElectrons() << "\n\n";
266-
267- // configuration
268- cout << this->messageConfigration;
269- cout << this->messageConfigrationTitleAng;
270- double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
271- for(int a=0; a<molecule->GetAtomVect()->size(); a++){
272- Atom* atom = (*molecule->GetAtomVect())[a];
273- printf("\t\t%d\t%s\t%e\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),
274- atom->GetXyz()[0]/ang2AU, atom->GetXyz()[1]/ang2AU, atom->GetXyz()[2]/ang2AU);
275- }
276- cout << "\n";
277-
278- cout << this->messageConfigrationTitleAU;
279- for(int a=0; a<molecule->GetAtomVect()->size(); a++){
280- Atom* atom = (*molecule->GetAtomVect())[a];
281- printf("\t\t%d\t%s\t%e\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),
282- atom->GetXyz()[0], atom->GetXyz()[1], atom->GetXyz()[2]);
283- }
284- cout << "\n";
285-
286- // Center of Mass
287- cout << this->messageCOM;
288- cout << this->messageCOMTitleAng;
289- printf("\t\t%e\t%e\t%e\n",molecule->GetCOMXyz()[0]/ang2AU,
290- molecule->GetCOMXyz()[1]/ang2AU,
291- molecule->GetCOMXyz()[2]/ang2AU);
292- cout << "\n";
293-
294- cout << this->messageCOMTitleAU;
295- printf("\t\t%e\t%e\t%e\n",molecule->GetCOMXyz()[0],
296- molecule->GetCOMXyz()[1],
297- molecule->GetCOMXyz()[2]);
298- cout << "\n";
299-
250+ molecule->OutputTotalNumberAtomsAOsValenceelectrons();
251+ molecule->OutputConfiguration();
252+ molecule->OutputCOMXyz();
300253 }
301254
302255 void InputParser::OutputScfConditions(){
@@ -306,7 +259,6 @@ void InputParser::OutputScfConditions(){
306259 printf("%s%e\n",this->messageScfRmsDensity.c_str(),Parameters::GetInstance()->GetThresholdSCF());
307260 cout << "\n";
308261
309-
310262 }
311263 void InputParser::OutputInputTerms(vector<string> inputTerms){
312264
--- a/src/base/Molecule.h
+++ b/src/base/Molecule.h
@@ -17,8 +17,17 @@ private:
1717 vector<Atom*>* atomVect;
1818 double* COMXyz;
1919 bool wasCalculatedCOMXyz;
20- int totalNumberAO;
20+ int totalNumberAOs;
2121 int totalNumberValenceElectrons;
22+ string messageTotalNumberAOs;
23+ string messageTotalNumberAtoms;
24+ string messageTotalNumberValenceElectrons;
25+ string messageConfiguration;
26+ string messageConfigurationTitleAU;
27+ string messageConfigurationTitleAng;
28+ string messageCOM;
29+ string messageCOMTitleAU;
30+ string messageCOMTitleAng;
2231 public:
2332 Molecule();
2433 ~Molecule();
@@ -29,12 +38,24 @@ public:
2938 void CalcTotalNumberAOs();
3039 int GetTotalNumberValenceElectrons();
3140 void CalcTotalNumberValenceElectrons();
41+ void OutputCOMXyz();
42+ void OutputTotalNumberAtomsAOsValenceelectrons();
43+ void OutputConfiguration();
3244 };
3345
3446 Molecule::Molecule(){
3547 this->atomVect = new vector<Atom*>;
3648 this->COMXyz = MallocerFreer::GetInstance()->MallocDoubleMatrix1d(3);
3749 this->wasCalculatedCOMXyz = false;
50+ this->messageTotalNumberAOs = "\tTotal number of valence AOs: ";
51+ this->messageTotalNumberAtoms = "\tTotal number of atoms: ";
52+ this->messageTotalNumberValenceElectrons = "\tTotal number of valence electrons: ";
53+ this->messageConfiguration = "\tMolecular configration:\n";
54+ this->messageConfigurationTitleAU = "\t\t| i-th | atom type | x [a.u.] | y[a.u.] | z[a.u.] |\n";
55+ this->messageConfigurationTitleAng = "\t\t| i-th | atom type | x [angst.] | y[angst.] | z[angst.] |\n";
56+ this->messageCOM = "\tCenter of Mass:\n";
57+ this->messageCOMTitleAU = "\t\t| x [a.u.] | y[a.u.] | z[a.u.] |\n";
58+ this->messageCOMTitleAng = "\t\t| x [angst.] | y[angst.] | z[angst.] |\n";
3859 }
3960
4061 Molecule::~Molecule(){
@@ -88,14 +109,14 @@ void Molecule::CalcCOMXyz(){
88109 }
89110
90111 int Molecule::GetTotalNumberAOs(){
91- return this->totalNumberAO;
112+ return this->totalNumberAOs;
92113 }
93114
94115 void Molecule::CalcTotalNumberAOs(){
95- this->totalNumberAO = 0;
116+ this->totalNumberAOs = 0;
96117 for(int i=0; i<this->atomVect->size(); i++){
97- (*this->atomVect)[i]->SetFirstAOIndex(totalNumberAO);
98- this->totalNumberAO += (*this->atomVect)[i]->GetValence().size();
118+ (*this->atomVect)[i]->SetFirstAOIndex(totalNumberAOs);
119+ this->totalNumberAOs += (*this->atomVect)[i]->GetValence().size();
99120 }
100121 }
101122
@@ -110,8 +131,49 @@ void Molecule::CalcTotalNumberValenceElectrons(){
110131 }
111132 }
112133
134+void Molecule::OutputConfiguration(){
135+ double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
136+ cout << this->messageConfiguration;
137+ cout << this->messageConfigurationTitleAng;
138+ for(int a=0; a<this->atomVect->size(); a++){
139+ Atom* atom = (*this->atomVect)[a];
140+ printf("\t\t%d\t%s\t%e\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),
141+ atom->GetXyz()[0]/ang2AU, atom->GetXyz()[1]/ang2AU, atom->GetXyz()[2]/ang2AU);
142+ }
143+ cout << "\n";
144+
145+ cout << this->messageConfigurationTitleAU;
146+ for(int a=0; a<this->atomVect->size(); a++){
147+ Atom* atom = (*this->atomVect)[a];
148+ printf("\t\t%d\t%s\t%e\t%e\t%e\n",a,AtomTypeStr(atom->GetAtomType()),
149+ atom->GetXyz()[0], atom->GetXyz()[1], atom->GetXyz()[2]);
150+ }
151+ cout << "\n";
152+
153+}
154+
155+void Molecule::OutputCOMXyz(){
156+ double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
157+ cout << this->messageCOM;
158+ cout << this->messageCOMTitleAng;
159+ printf("\t\t%e\t%e\t%e\n",this->COMXyz[0]/ang2AU,
160+ this->COMXyz[1]/ang2AU,
161+ this->COMXyz[2]/ang2AU);
162+ cout << "\n";
163+
164+ cout << this->messageCOMTitleAU;
165+ printf("\t\t%e\t%e\t%e\n",this->COMXyz[0],
166+ this->COMXyz[1],
167+ this->COMXyz[2]);
168+ cout << "\n";
113169
170+}
114171
172+void Molecule::OutputTotalNumberAtomsAOsValenceelectrons(){
173+ cout << this->messageTotalNumberAtoms << this->atomVect->size() << "\n";
174+ cout << this->messageTotalNumberAOs << this->totalNumberAOs << "\n";
175+ cout << this->messageTotalNumberValenceElectrons << this->totalNumberValenceElectrons << "\n\n";
176+}
115177
116178 }
117179 #endif