修订版 | c0750382365aef547d3551c293dc2c635af0c9d3 (tree) |
---|---|
时间 | 2011-01-05 14:26:05 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
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
@@ -30,12 +30,6 @@ private: | ||
30 | 30 | string messageTotalNumberAOs; |
31 | 31 | string messageTotalNumberAtoms; |
32 | 32 | string messageTotalNumberValenceElectrons; |
33 | - string messageConfigration; | |
34 | - string messageConfigrationTitleAU; | |
35 | - string messageConfigrationTitleAng; | |
36 | - string messageCOM; | |
37 | - string messageCOMTitleAU; | |
38 | - string messageCOMTitleAng; | |
39 | 33 | string messageInputTerms; |
40 | 34 | string messageScfConditions; |
41 | 35 | string messageScfMaxIterations; |
@@ -75,12 +69,6 @@ InputParser::InputParser(){ | ||
75 | 69 | this->messageTotalNumberAOs = "\tTotal number of valence AOs: "; |
76 | 70 | this->messageTotalNumberAtoms = "\tTotal number of atoms: "; |
77 | 71 | 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"; | |
84 | 72 | this->messageInputTerms = "Input terms:\n"; |
85 | 73 | this->messageScfConditions = "\tSCF conditions:\n"; |
86 | 74 | this->messageScfMaxIterations = "\t\tMax iterations: "; |
@@ -259,44 +247,9 @@ void InputParser::CalcMolecularBasics(Molecule* molecule){ | ||
259 | 247 | |
260 | 248 | void InputParser::OutputMolecularBasics(Molecule* molecule){ |
261 | 249 | |
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(); | |
300 | 253 | } |
301 | 254 | |
302 | 255 | void InputParser::OutputScfConditions(){ |
@@ -306,7 +259,6 @@ void InputParser::OutputScfConditions(){ | ||
306 | 259 | printf("%s%e\n",this->messageScfRmsDensity.c_str(),Parameters::GetInstance()->GetThresholdSCF()); |
307 | 260 | cout << "\n"; |
308 | 261 | |
309 | - | |
310 | 262 | } |
311 | 263 | void InputParser::OutputInputTerms(vector<string> inputTerms){ |
312 | 264 |
@@ -17,8 +17,17 @@ private: | ||
17 | 17 | vector<Atom*>* atomVect; |
18 | 18 | double* COMXyz; |
19 | 19 | bool wasCalculatedCOMXyz; |
20 | - int totalNumberAO; | |
20 | + int totalNumberAOs; | |
21 | 21 | 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; | |
22 | 31 | public: |
23 | 32 | Molecule(); |
24 | 33 | ~Molecule(); |
@@ -29,12 +38,24 @@ public: | ||
29 | 38 | void CalcTotalNumberAOs(); |
30 | 39 | int GetTotalNumberValenceElectrons(); |
31 | 40 | void CalcTotalNumberValenceElectrons(); |
41 | + void OutputCOMXyz(); | |
42 | + void OutputTotalNumberAtomsAOsValenceelectrons(); | |
43 | + void OutputConfiguration(); | |
32 | 44 | }; |
33 | 45 | |
34 | 46 | Molecule::Molecule(){ |
35 | 47 | this->atomVect = new vector<Atom*>; |
36 | 48 | this->COMXyz = MallocerFreer::GetInstance()->MallocDoubleMatrix1d(3); |
37 | 49 | 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"; | |
38 | 59 | } |
39 | 60 | |
40 | 61 | Molecule::~Molecule(){ |
@@ -88,14 +109,14 @@ void Molecule::CalcCOMXyz(){ | ||
88 | 109 | } |
89 | 110 | |
90 | 111 | int Molecule::GetTotalNumberAOs(){ |
91 | - return this->totalNumberAO; | |
112 | + return this->totalNumberAOs; | |
92 | 113 | } |
93 | 114 | |
94 | 115 | void Molecule::CalcTotalNumberAOs(){ |
95 | - this->totalNumberAO = 0; | |
116 | + this->totalNumberAOs = 0; | |
96 | 117 | 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(); | |
99 | 120 | } |
100 | 121 | } |
101 | 122 |
@@ -110,8 +131,49 @@ void Molecule::CalcTotalNumberValenceElectrons(){ | ||
110 | 131 | } |
111 | 132 | } |
112 | 133 | |
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"; | |
113 | 169 | |
170 | +} | |
114 | 171 | |
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 | +} | |
115 | 177 | |
116 | 178 | } |
117 | 179 | #endif |