| 279 | 
  | 
    //create SimInfo | 
| 280 | 
  | 
    SimInfo * info = new SimInfo(ff, simParams); | 
| 281 | 
  | 
      | 
| 282 | 
< | 
    //gather parameters (SimCreator only retrieves part of the parameters) | 
| 282 | 
> | 
    //gather parameters (SimCreator only retrieves part of the | 
| 283 | 
> | 
    //parameters) | 
| 284 | 
  | 
    gatherParameters(info, mdFileName); | 
| 285 | 
  | 
     | 
| 286 | 
  | 
    //divide the molecules and determine the global index of molecules | 
| 292 | 
  | 
    createMolecules(info); | 
| 293 | 
  | 
     | 
| 294 | 
  | 
     | 
| 295 | 
< | 
    //allocate memory for DataStorage(circular reference, need to break it) | 
| 295 | 
> | 
    //allocate memory for DataStorage(circular reference, need to | 
| 296 | 
> | 
    //break it) | 
| 297 | 
  | 
    info->setSnapshotManager(new SimSnapshotManager(info)); | 
| 298 | 
  | 
     | 
| 299 | 
< | 
    //set the global index of atoms, rigidbodies and cutoffgroups (only need to be set once, the | 
| 300 | 
< | 
    //global index will never change again). Local indices of atoms and rigidbodies are already set by  | 
| 301 | 
< | 
    //MoleculeCreator class which actually delegates the responsibility to LocalIndexManager.  | 
| 299 | 
> | 
    //set the global index of atoms, rigidbodies and cutoffgroups | 
| 300 | 
> | 
    //(only need to be set once, the global index will never change | 
| 301 | 
> | 
    //again). Local indices of atoms and rigidbodies are already set | 
| 302 | 
> | 
    //by MoleculeCreator class which actually delegates the | 
| 303 | 
> | 
    //responsibility to LocalIndexManager. | 
| 304 | 
  | 
    setGlobalIndex(info); | 
| 305 | 
  | 
     | 
| 306 | 
< | 
    //Alought addExculdePairs is called inside SimInfo's addMolecule method, at that point | 
| 307 | 
< | 
    //atoms don't have the global index yet  (their global index are all initialized to -1). | 
| 308 | 
< | 
    //Therefore we have to call addExcludePairs explicitly here. A way to work around is that | 
| 309 | 
< | 
    //we can determine the beginning global indices of atoms before they get created. | 
| 306 | 
> | 
    //Although addExcludePairs is called inside SimInfo's addMolecule | 
| 307 | 
> | 
    //method, at that point atoms don't have the global index yet | 
| 308 | 
> | 
    //(their global index are all initialized to -1).  Therefore we | 
| 309 | 
> | 
    //have to call addExcludePairs explicitly here. A way to work | 
| 310 | 
> | 
    //around is that we can determine the beginning global indices of | 
| 311 | 
> | 
    //atoms before they get created. | 
| 312 | 
  | 
    SimInfo::MoleculeIterator mi; | 
| 313 | 
  | 
    Molecule* mol; | 
| 314 | 
  | 
    for (mol= info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) { |