| 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); | 
| 137 | 
  | 
    dumpFormater(msg); | 
| 138 | 
  | 
  } | 
| 139 | 
  | 
 | 
| 140 | 
< | 
  testMolecule = stamps->getMolecule("tester"); | 
| 141 | 
< | 
  sprintf(msg,"\nWriting out tester..... \n\n"); | 
| 141 | 
< | 
  dumpFormater(msg); | 
| 140 | 
> | 
  //testMolecule = stamps->getMolecule("tester"); | 
| 141 | 
> | 
  testMolecule = NULL; // fix me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
| 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++){ | 
| 143 | 
> | 
  if(testMolecule != NULL ){ | 
| 144 | 
  | 
     | 
| 145 | 
< | 
    aStamp = testMolecule->getAtom(i); | 
| 145 | 
> | 
    sprintf(msg,"\nWriting out tester..... \n\n"); | 
| 146 | 
> | 
    dumpFormater(msg); | 
| 147 | 
  | 
     | 
| 148 | 
< | 
    sprintf(msg,"  Atom[%d]{\n",i); | 
| 148 | 
> | 
    sprintf(msg,"Molecule{\n"); | 
| 149 | 
  | 
    dumpFormater(msg); | 
| 150 | 
< | 
 | 
| 151 | 
< | 
    sprintf(msg,"    type = %s\n",aStamp->getType); | 
| 150 | 
> | 
     | 
| 151 | 
> | 
    sprintf(msg,"  ID = %s\n",testMolecule->getID()); | 
| 152 | 
  | 
    dumpFormater(msg); | 
| 153 | 
  | 
     | 
| 154 | 
< | 
    if(aStamp->havePosition()){ | 
| 155 | 
< | 
      sprintf(msg,"    position = < %lf, %lf, %lf>\n", | 
| 156 | 
< | 
              aStamp->getPosX(), | 
| 157 | 
< | 
              aStamp->getPosY(), | 
| 158 | 
< | 
              aStamp->getPosZ()); | 
| 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 | 
< | 
 | 
| 172 | 
< | 
    if(aStamp->haveOrientation()){ | 
| 173 | 
< | 
      sprintf(msg,"   orientation = < %lf, %lf, %lf>\n", | 
| 174 | 
< | 
              aStamp->getOrntX(), | 
| 175 | 
< | 
              aStamp->getOrntY(), | 
| 176 | 
< | 
              aStamp->getOrntZ()); | 
| 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 | 
< | 
    sprintf(msg,"  }\n\n"); | 
| 187 | 
> | 
     | 
| 188 | 
> | 
    sprintf(msg,"  NBonds = %d\n",testMolecule->getNBonds()); | 
| 189 | 
  | 
    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++){ | 
| 190 | 
  | 
     | 
| 191 | 
< | 
    boStamp = testMolecule->getBond(i); | 
| 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,"  Bond[%d]{\n",i); | 
| 209 | 
> | 
    sprintf(msg,"  NBends = %d\n",testMolecule->getNBends()); | 
| 210 | 
  | 
    dumpFormater(msg); | 
| 194 | 
– | 
 | 
| 195 | 
– | 
    sprintf(msg,"    members = %d, %d\n", | 
| 196 | 
– | 
            boStamp->getA(), | 
| 197 | 
– | 
            boStamp->getB()); | 
| 198 | 
– | 
    dumpFormater(msg); | 
| 211 | 
  | 
     | 
| 212 | 
< | 
    sprintf(msg,"  }\n\n"); | 
| 213 | 
< | 
    dumpFormater(msg); | 
| 214 | 
< | 
  } | 
| 215 | 
< | 
 | 
| 216 | 
< | 
  sprintf(msg,"  NBends = %d\n",testMolecule->getNBends()); | 
| 217 | 
< | 
  dumpFormater(msg); | 
| 218 | 
< | 
   | 
| 219 | 
< | 
  int nBends = testMolecule->getNBends(); | 
| 220 | 
< | 
  BendStamp* beStamp; | 
| 221 | 
< | 
  for(int i=0; i<nBends;i++){ | 
| 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 | 
< | 
    beStamp = testMolecule->getBend(i); | 
| 212 | 
< | 
     | 
| 213 | 
< | 
    sprintf(msg,"  Bend[%d]{\n",i); | 
| 231 | 
> | 
    sprintf(msg,"  NTorsions = %d\n",testMolecule->getNTorsions()); | 
| 232 | 
  | 
    dumpFormater(msg); | 
| 215 | 
– | 
 | 
| 216 | 
– | 
    sprintf(msg,"    members = %d, %d, %d\n", | 
| 217 | 
– | 
            beStamp->getA(), | 
| 218 | 
– | 
            beStamp->getB(), | 
| 219 | 
– | 
            beStamp->getC()); | 
| 220 | 
– | 
    dumpFormater(msg); | 
| 233 | 
  | 
     | 
| 234 | 
< | 
    sprintf(msg,"  }\n\n"); | 
| 235 | 
< | 
    dumpFormater(msg); | 
| 236 | 
< | 
  } | 
| 237 | 
< | 
 | 
| 238 | 
< | 
  sprintf(msg,"  NTorsions = %d\n",testMolecule->getNTorsions()); | 
| 239 | 
< | 
  dumpFormater(msg); | 
| 240 | 
< | 
   | 
| 241 | 
< | 
  int nTorsions = testMolecule->getNTorsions(); | 
| 242 | 
< | 
  TorsionStamp* tStamp; | 
| 243 | 
< | 
  for(int i=0; i<nTorsions;i++){ | 
| 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 | 
< | 
    tStamp = testMolecule->getTorsion(i); | 
| 234 | 
< | 
     | 
| 235 | 
< | 
    sprintf(msg,"  Torsion[%d]{\n",i); | 
| 254 | 
> | 
    sprintf(msg,"}\n\n"); | 
| 255 | 
  | 
    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); | 
| 256 | 
  | 
     | 
| 245 | 
– | 
    sprintf(msg,"  }\n\n"); | 
| 246 | 
– | 
    dumpFormater(msg); | 
| 257 | 
  | 
  } | 
| 258 | 
< | 
 | 
| 259 | 
< | 
  sprintf(msg,"}\n\n"); | 
| 260 | 
< | 
  dumpFormater(msg); | 
| 258 | 
> | 
  else{ | 
| 259 | 
> | 
    sprintf(msg, "\n**************** Tester.mdl not included *************\n"); | 
| 260 | 
> | 
    dumpFormater( msg ); | 
| 261 | 
  | 
   | 
| 262 | 
+ | 
  } | 
| 263 | 
  | 
} | 
| 264 | 
< | 
 | 
| 264 | 
> | 
   | 
| 265 | 
  | 
void bassDiag::dumpFormater(char * theString){ | 
| 266 | 
  | 
 | 
| 267 | 
  | 
  std::cout << theString; |