ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/bassDiag.cpp
Revision: 128
Committed: Thu Oct 3 21:52:46 2002 UTC (21 years, 9 months ago) by chuckv
File size: 5735 byte(s)
Log Message:
*** empty log message ***

File Contents

# Content
1 #include <iostream>
2 #include <cstdio>
3 #include <cstring>
4 #include <cstdlib>
5 #include "bassDiag.hpp"
6
7 void bassDiag::dumpStamps(void){
8 char msg[1000];
9 Component** components;
10 int n_components;
11 MoleculeStamp* testMolecule;
12
13 dumpFormater("First comes the globals..... \n");
14 sprintf(msg,"ForceField = %s\n",globals->getForceField());
15 dumpFormater(msg);
16
17 sprintf(msg,"NComponents = %d\n",globals->getNComponents());
18 dumpFormater(msg);
19
20 sprintf(msg,"TargatTemp = %lf\n",globals->getTargetTemp());
21 dumpFormater(msg);
22
23 sprintf(msg,"Ensemble = %s\n",globals->getEnsemble());
24 dumpFormater(msg);
25
26 sprintf(msg,"Dt = %lf\n",globals->getDt());
27 dumpFormater(msg);
28
29 sprintf(msg,"RunTime = %lf\n\n",globals->getRunTime());
30 dumpFormater(msg);
31
32 sprintf(msg,"Dumping Optional Globals....\n");
33 dumpFormater(msg);
34
35 if (globals->haveInitialConfig()){
36
37 sprintf(msg,"InitialConfig = %s\n",globals->getInitialConfig());
38 dumpFormater(msg);
39 }
40 if (globals->haveFinalConfig()){
41
42 sprintf(msg,"FinalConfig = %s\n",globals->getFinalConfig());
43 dumpFormater(msg);
44 }
45
46 if (globals->haveNMol()){
47
48 sprintf(msg,"NMol = %d\n",globals->getNMol());
49 dumpFormater(msg);
50 }
51
52 if (globals->haveDensity()){
53
54 sprintf(msg,"Density = %lf\n",globals->getDensity());
55 dumpFormater(msg);
56 }
57
58 if (globals->haveBox()){
59
60 sprintf(msg,"Box = %lf\n",globals->getBox());
61 dumpFormater(msg);
62 }
63
64 if (globals->haveBoxX()){
65
66 sprintf(msg,"BoxX = %lf\n",globals->getBoxX());
67 dumpFormater(msg);
68 }
69 if (globals->haveBoxY()){
70
71 sprintf(msg,"BoxY = %lf\n",globals->getBoxY());
72 dumpFormater(msg);
73 }
74 if (globals->haveBoxZ()){
75
76 sprintf(msg,"BoxZ = %lf\n",globals->getBoxZ());
77 dumpFormater(msg);
78 }
79
80 if (globals->haveSampleTime()){
81
82 sprintf(msg,"SampleTime = %lf\n",globals->getSampleTime());
83 dumpFormater(msg);
84 }
85
86 if (globals->haveStatusTime()){
87
88 sprintf(msg,"StatusTime = %lf\n",globals->getStatusTime());
89 dumpFormater(msg);
90 }
91
92 if (globals->haveThermalTime()){
93
94 sprintf(msg,"ThermalTime = %lf\n",globals->getThermalTime());
95 dumpFormater(msg);
96 }
97
98 if (globals->haveDielectric()){
99
100 sprintf(msg,"Dielectric = %lf\n",globals->getDielectric());
101 dumpFormater(msg);
102 }
103
104 if (globals->haveRRF()){
105
106 sprintf(msg,"RRF = %lf\n",globals->getRRF());
107 dumpFormater(msg);
108 }
109
110 if (globals->haveTempSet()){
111 sprintf(msg,"TempSet = %lf\n",globals->getTempSet());
112 dumpFormater(msg);
113
114 }
115
116 n_components = globals->getNComponents();
117 sprintf(msg,"\nWriting out %d components\n",n_components);
118 dumpFormater(msg);
119 components = globals-getComponents();
120
121 for(int i=0; i < n_components ; i++){
122
123 sprintf(msg,"Component[%d]{\n",i);
124 dumpFormater(msg);
125
126 sprintf(msg," Type = %s\n",components[i]->getType());
127 dumpFormater(msg);
128
129 if (components[i]->haveNmol){
130
131 sprintf(msg," Nmol = %d\n",components[i]->getNMol());
132 dumpFormater(msg);
133 }
134
135 sprintf(msg,"{\n\n");
136 dumpFormater(msg);
137 }
138
139 testMolecule = stamps->getMolecule("tester");
140 sprintf(msg,"\nWriting out tester..... \n\n");
141 dumpFormater(msg);
142
143 sprintf(msg,"Molecule{\n");
144 dumpFormater(msg);
145
146 sprintf(msg," ID = %s\n",testMolecule->getID());
147 dumpFormater(msg);
148
149 sprintf(msg," NAtoms = %d\n",testMolecule->getNAtoms());
150 dumpFormater(msg);
151
152 int nAtoms = testMolecule->getNAtoms();
153 AtomStamp* aStamp;
154 for(int i=0; i<nAtoms;i++){
155
156 aStamp = testMolecule->getAtom(i);
157
158 sprintf(msg," Atom[%d]{\n",i);
159 dumpFormater(msg);
160
161 sprintf(msg," type = %s\n",aStamp->getType);
162 dumpFormater(msg);
163
164 if(aStamp->havePosition()){
165 sprintf(msg," position = < %lf, %lf, %lf>\n",
166 aStamp->getPosX(),
167 aStamp->getPosY(),
168 aStamp->getPosZ());
169 dumpFormater(msg);
170 }
171
172 if(aStamp->haveOrientation()){
173 sprintf(msg," orientation = < %lf, %lf, %lf>\n",
174 aStamp->getOrntX(),
175 aStamp->getOrntY(),
176 aStamp->getOrntZ());
177 dumpFormater(msg);
178 }
179 sprintf(msg," }\n\n");
180 dumpFormater(msg);
181 }
182
183 sprintf(msg," NBonds = %d\n",testMolecule->getNBonds());
184 dumpFormater(msg);
185
186 int nBonds = testMolecule->getNBonds();
187 BondStamp* boStamp;
188 for(int i=0; i<nBonds;i++){
189
190 boStamp = testMolecule->getBond(i);
191
192 sprintf(msg," Bond[%d]{\n",i);
193 dumpFormater(msg);
194
195 sprintf(msg," members = %d, %d\n",
196 boStamp->getA(),
197 boStamp->getB());
198 dumpFormater(msg);
199
200 sprintf(msg," }\n\n");
201 dumpFormater(msg);
202 }
203
204 sprintf(msg," NBends = %d\n",testMolecule->getNBends());
205 dumpFormater(msg);
206
207 int nBends = testMolecule->getNBends();
208 BendStamp* beStamp;
209 for(int i=0; i<nBends;i++){
210
211 beStamp = testMolecule->getBend(i);
212
213 sprintf(msg," Bend[%d]{\n",i);
214 dumpFormater(msg);
215
216 sprintf(msg," members = %d, %d, %d\n",
217 beStamp->getA(),
218 beStamp->getB(),
219 beStamp->getC());
220 dumpFormater(msg);
221
222 sprintf(msg," }\n\n");
223 dumpFormater(msg);
224 }
225
226 sprintf(msg," NTorsions = %d\n",testMolecule->getNTorsions());
227 dumpFormater(msg);
228
229 int nTorsions = testMolecule->getNTorsions();
230 TorsionStamp* tStamp;
231 for(int i=0; i<nTorsions;i++){
232
233 tStamp = testMolecule->getTorsion(i);
234
235 sprintf(msg," Torsion[%d]{\n",i);
236 dumpFormater(msg);
237
238 sprintf(msg," members = %d, %d, %d, %d\n",
239 tStamp->getA(),
240 tStamp->getB(),
241 tStamp->getC(),
242 tStamp->getD());
243 dumpFormater(msg);
244
245 sprintf(msg," }\n\n");
246 dumpFormater(msg);
247 }
248
249 sprintf(msg,"}\n\n");
250 dumpFormater(msg);
251
252 }
253
254 void bassDiag::dumpFormater(char * theString){
255
256 std::cout << theString;
257 std::cout.flush();
258 }
259
260
261
262