ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/bassDiag.cpp
Revision: 249
Committed: Mon Jan 27 21:28:19 2003 UTC (21 years, 5 months ago) by chuckv
File size: 6174 byte(s)
Log Message:
For some unknown reason the Single processor builds. Has not been tested!

File Contents

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