| 2 |
|
#include <cstdio> |
| 3 |
|
#include <cstring> |
| 4 |
|
#include <cstdlib> |
| 5 |
+ |
|
| 6 |
|
#include "bassDiag.hpp" |
| 7 |
|
|
| 8 |
|
void bassDiag::dumpStamps(void){ |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
if (globals->haveTempSet()){ |
| 112 |
< |
sprintf(msg,"TempSet = %lf\n",globals->getTempSet()); |
| 112 |
> |
sprintf(msg,"TempSet = %d\n",globals->getTempSet()); |
| 113 |
|
dumpFormater(msg); |
| 114 |
|
|
| 115 |
|
} |
| 117 |
|
n_components = globals->getNComponents(); |
| 118 |
|
sprintf(msg,"\nWriting out %d components\n",n_components); |
| 119 |
|
dumpFormater(msg); |
| 120 |
< |
components = globals-getComponents(); |
| 120 |
> |
components = globals->getComponents(); |
| 121 |
|
|
| 122 |
|
for(int i=0; i < n_components ; i++){ |
| 123 |
|
|
| 127 |
|
sprintf(msg," Type = %s\n",components[i]->getType()); |
| 128 |
|
dumpFormater(msg); |
| 129 |
|
|
| 130 |
< |
if (components[i]->haveNmol){ |
| 130 |
> |
if (components[i]->haveNMol()){ |
| 131 |
|
|
| 132 |
|
sprintf(msg," Nmol = %d\n",components[i]->getNMol()); |
| 133 |
|
dumpFormater(msg); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
testMolecule = stamps->getMolecule("tester"); |
| 140 |
– |
sprintf(msg,"\nWriting out tester..... \n\n"); |
| 141 |
– |
dumpFormater(msg); |
| 141 |
|
|
| 142 |
< |
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++){ |
| 142 |
> |
if(testMolecule != NULL ){ |
| 143 |
|
|
| 144 |
< |
aStamp = testMolecule->getAtom(i); |
| 144 |
> |
sprintf(msg,"\nWriting out tester..... \n\n"); |
| 145 |
> |
dumpFormater(msg); |
| 146 |
|
|
| 147 |
< |
sprintf(msg," Atom[%d]{\n",i); |
| 147 |
> |
sprintf(msg,"Molecule{\n"); |
| 148 |
|
dumpFormater(msg); |
| 149 |
< |
|
| 150 |
< |
sprintf(msg," type = %s\n",aStamp->getType); |
| 149 |
> |
|
| 150 |
> |
sprintf(msg," ID = %s\n",testMolecule->getID()); |
| 151 |
|
dumpFormater(msg); |
| 152 |
|
|
| 153 |
< |
if(aStamp->havePosition()){ |
| 154 |
< |
sprintf(msg," position = < %lf, %lf, %lf>\n", |
| 155 |
< |
aStamp->getPosX(), |
| 156 |
< |
aStamp->getPosY(), |
| 157 |
< |
aStamp->getPosZ()); |
| 153 |
> |
sprintf(msg," NAtoms = %d\n",testMolecule->getNAtoms()); |
| 154 |
> |
dumpFormater(msg); |
| 155 |
> |
|
| 156 |
> |
int nAtoms = testMolecule->getNAtoms(); |
| 157 |
> |
AtomStamp* aStamp; |
| 158 |
> |
for(int i=0; i<nAtoms;i++){ |
| 159 |
> |
|
| 160 |
> |
aStamp = testMolecule->getAtom(i); |
| 161 |
> |
|
| 162 |
> |
sprintf(msg," Atom[%d]{\n",i); |
| 163 |
|
dumpFormater(msg); |
| 164 |
< |
} |
| 165 |
< |
|
| 172 |
< |
if(aStamp->haveOrientation()){ |
| 173 |
< |
sprintf(msg," orientation = < %lf, %lf, %lf>\n", |
| 174 |
< |
aStamp->getOrntX(), |
| 175 |
< |
aStamp->getOrntY(), |
| 176 |
< |
aStamp->getOrntZ()); |
| 164 |
> |
|
| 165 |
> |
sprintf(msg," type = %s\n",aStamp->getType()); |
| 166 |
|
dumpFormater(msg); |
| 167 |
+ |
|
| 168 |
+ |
if(aStamp->havePosition()){ |
| 169 |
+ |
sprintf(msg," position = < %lf, %lf, %lf>\n", |
| 170 |
+ |
aStamp->getPosX(), |
| 171 |
+ |
aStamp->getPosY(), |
| 172 |
+ |
aStamp->getPosZ()); |
| 173 |
+ |
dumpFormater(msg); |
| 174 |
+ |
} |
| 175 |
+ |
|
| 176 |
+ |
if(aStamp->haveOrientation()){ |
| 177 |
+ |
sprintf(msg," orientation = < %lf, %lf, %lf>\n", |
| 178 |
+ |
aStamp->getOrntX(), |
| 179 |
+ |
aStamp->getOrntY(), |
| 180 |
+ |
aStamp->getOrntZ()); |
| 181 |
+ |
dumpFormater(msg); |
| 182 |
+ |
} |
| 183 |
+ |
sprintf(msg," }\n\n"); |
| 184 |
+ |
dumpFormater(msg); |
| 185 |
|
} |
| 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++){ |
| 186 |
|
|
| 187 |
< |
boStamp = testMolecule->getBond(i); |
| 191 |
< |
|
| 192 |
< |
sprintf(msg," Bond[%d]{\n",i); |
| 187 |
> |
sprintf(msg," NBonds = %d\n",testMolecule->getNBonds()); |
| 188 |
|
dumpFormater(msg); |
| 194 |
– |
|
| 195 |
– |
sprintf(msg," members = %d, %d\n", |
| 196 |
– |
boStamp->getA(), |
| 197 |
– |
boStamp->getB()); |
| 198 |
– |
dumpFormater(msg); |
| 189 |
|
|
| 190 |
< |
sprintf(msg," }\n\n"); |
| 191 |
< |
dumpFormater(msg); |
| 192 |
< |
} |
| 193 |
< |
|
| 194 |
< |
sprintf(msg," NBends = %d\n",testMolecule->getNBends()); |
| 195 |
< |
dumpFormater(msg); |
| 196 |
< |
|
| 197 |
< |
int nBends = testMolecule->getNBends(); |
| 198 |
< |
BendStamp* beStamp; |
| 199 |
< |
for(int i=0; i<nBends;i++){ |
| 200 |
< |
|
| 201 |
< |
beStamp = testMolecule->getBend(i); |
| 190 |
> |
int nBonds = testMolecule->getNBonds(); |
| 191 |
> |
BondStamp* boStamp; |
| 192 |
> |
for(int i=0; i<nBonds;i++){ |
| 193 |
> |
|
| 194 |
> |
boStamp = testMolecule->getBond(i); |
| 195 |
> |
|
| 196 |
> |
sprintf(msg," Bond[%d]{\n",i); |
| 197 |
> |
dumpFormater(msg); |
| 198 |
> |
|
| 199 |
> |
sprintf(msg," members = %d, %d\n", |
| 200 |
> |
boStamp->getA(), |
| 201 |
> |
boStamp->getB()); |
| 202 |
> |
dumpFormater(msg); |
| 203 |
> |
|
| 204 |
> |
sprintf(msg," }\n\n"); |
| 205 |
> |
dumpFormater(msg); |
| 206 |
> |
} |
| 207 |
|
|
| 208 |
< |
sprintf(msg," Bend[%d]{\n",i); |
| 208 |
> |
sprintf(msg," NBends = %d\n",testMolecule->getNBends()); |
| 209 |
|
dumpFormater(msg); |
| 215 |
– |
|
| 216 |
– |
sprintf(msg," members = %d, %d, %d\n", |
| 217 |
– |
beStamp->getA(), |
| 218 |
– |
beStamp->getB(), |
| 219 |
– |
beStamp->getC()); |
| 220 |
– |
dumpFormater(msg); |
| 210 |
|
|
| 211 |
< |
sprintf(msg," }\n\n"); |
| 211 |
> |
int nBends = testMolecule->getNBends(); |
| 212 |
> |
BendStamp* beStamp; |
| 213 |
> |
for(int i=0; i<nBends;i++){ |
| 214 |
> |
|
| 215 |
> |
beStamp = testMolecule->getBend(i); |
| 216 |
> |
|
| 217 |
> |
sprintf(msg," Bend[%d]{\n",i); |
| 218 |
> |
dumpFormater(msg); |
| 219 |
> |
|
| 220 |
> |
sprintf(msg," members = %d, %d, %d\n", |
| 221 |
> |
beStamp->getA(), |
| 222 |
> |
beStamp->getB(), |
| 223 |
> |
beStamp->getC()); |
| 224 |
> |
dumpFormater(msg); |
| 225 |
> |
|
| 226 |
> |
sprintf(msg," }\n\n"); |
| 227 |
> |
dumpFormater(msg); |
| 228 |
> |
} |
| 229 |
> |
|
| 230 |
> |
sprintf(msg," NTorsions = %d\n",testMolecule->getNTorsions()); |
| 231 |
|
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); |
| 233 |
> |
int nTorsions = testMolecule->getNTorsions(); |
| 234 |
> |
TorsionStamp* tStamp; |
| 235 |
> |
for(int i=0; i<nTorsions;i++){ |
| 236 |
> |
|
| 237 |
> |
tStamp = testMolecule->getTorsion(i); |
| 238 |
> |
|
| 239 |
> |
sprintf(msg," Torsion[%d]{\n",i); |
| 240 |
> |
dumpFormater(msg); |
| 241 |
> |
|
| 242 |
> |
sprintf(msg," members = %d, %d, %d, %d\n", |
| 243 |
> |
tStamp->getA(), |
| 244 |
> |
tStamp->getB(), |
| 245 |
> |
tStamp->getC(), |
| 246 |
> |
tStamp->getD()); |
| 247 |
> |
dumpFormater(msg); |
| 248 |
> |
|
| 249 |
> |
sprintf(msg," }\n\n"); |
| 250 |
> |
dumpFormater(msg); |
| 251 |
> |
} |
| 252 |
|
|
| 253 |
< |
sprintf(msg," Torsion[%d]{\n",i); |
| 253 |
> |
sprintf(msg,"}\n\n"); |
| 254 |
|
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); |
| 255 |
|
|
| 245 |
– |
sprintf(msg," }\n\n"); |
| 246 |
– |
dumpFormater(msg); |
| 256 |
|
} |
| 257 |
< |
|
| 258 |
< |
sprintf(msg,"}\n\n"); |
| 259 |
< |
dumpFormater(msg); |
| 257 |
> |
else{ |
| 258 |
> |
sprintf(msg, "\n**************** Tester.mdl not included *************\n"); |
| 259 |
> |
dumpFormater( msg ); |
| 260 |
|
|
| 261 |
+ |
} |
| 262 |
|
} |
| 263 |
< |
|
| 263 |
> |
|
| 264 |
|
void bassDiag::dumpFormater(char * theString){ |
| 265 |
|
|
| 266 |
|
std::cout << theString; |