| 231 | 
  | 
    vector<Atom*>::iterator k; | 
| 232 | 
  | 
 | 
| 233 | 
  | 
    Molecule* mol; | 
| 234 | 
< | 
    StuntDouble* integrableObject; | 
| 234 | 
> | 
    StuntDouble* sd; | 
| 235 | 
  | 
    Atom* atom; | 
| 236 | 
  | 
 | 
| 237 | 
  | 
    ndf_local = 0; | 
| 238 | 
  | 
    nfq_local = 0; | 
| 239 | 
  | 
     | 
| 240 | 
  | 
    for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) { | 
| 241 | 
– | 
      for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL;  | 
| 242 | 
– | 
           integrableObject = mol->nextIntegrableObject(j)) { | 
| 241 | 
  | 
 | 
| 242 | 
+ | 
      for (sd = mol->beginIntegrableObject(j); sd != NULL;  | 
| 243 | 
+ | 
           sd = mol->nextIntegrableObject(j)) { | 
| 244 | 
+ | 
 | 
| 245 | 
  | 
        ndf_local += 3; | 
| 246 | 
  | 
 | 
| 247 | 
< | 
        if (integrableObject->isDirectional()) { | 
| 248 | 
< | 
          if (integrableObject->isLinear()) { | 
| 247 | 
> | 
        if (sd->isDirectional()) { | 
| 248 | 
> | 
          if (sd->isLinear()) { | 
| 249 | 
  | 
            ndf_local += 2; | 
| 250 | 
  | 
          } else { | 
| 251 | 
  | 
            ndf_local += 3; | 
| 252 | 
  | 
          } | 
| 253 | 
  | 
        } | 
| 254 | 
  | 
      } | 
| 255 | 
+ | 
 | 
| 256 | 
  | 
      for (atom = mol->beginFluctuatingCharge(k); atom != NULL; | 
| 257 | 
  | 
           atom = mol->nextFluctuatingCharge(k)) { | 
| 258 | 
  | 
        if (atom->isFluctuatingCharge()) { | 
| 314 | 
  | 
    MoleculeIterator i; | 
| 315 | 
  | 
    vector<StuntDouble*>::iterator j; | 
| 316 | 
  | 
    Molecule* mol; | 
| 317 | 
< | 
    StuntDouble* integrableObject; | 
| 317 | 
> | 
    StuntDouble* sd; | 
| 318 | 
  | 
 | 
| 319 | 
  | 
    // Raw degrees of freedom that we have to set | 
| 320 | 
  | 
    ndfRaw_local = 0; | 
| 321 | 
  | 
     | 
| 322 | 
  | 
    for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) { | 
| 321 | 
– | 
      for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL; | 
| 322 | 
– | 
           integrableObject = mol->nextIntegrableObject(j)) { | 
| 323 | 
  | 
 | 
| 324 | 
+ | 
      for (sd = mol->beginIntegrableObject(j); sd != NULL; | 
| 325 | 
+ | 
           sd = mol->nextIntegrableObject(j)) { | 
| 326 | 
+ | 
 | 
| 327 | 
  | 
        ndfRaw_local += 3; | 
| 328 | 
  | 
 | 
| 329 | 
< | 
        if (integrableObject->isDirectional()) { | 
| 330 | 
< | 
          if (integrableObject->isLinear()) { | 
| 329 | 
> | 
        if (sd->isDirectional()) { | 
| 330 | 
> | 
          if (sd->isLinear()) { | 
| 331 | 
  | 
            ndfRaw_local += 2; | 
| 332 | 
  | 
          } else { | 
| 333 | 
  | 
            ndfRaw_local += 3; | 
| 387 | 
  | 
    Molecule::RigidBodyIterator rbIter; | 
| 388 | 
  | 
    RigidBody* rb; | 
| 389 | 
  | 
    Molecule::IntegrableObjectIterator ii; | 
| 390 | 
< | 
    StuntDouble* integrableObject; | 
| 390 | 
> | 
    StuntDouble* sd; | 
| 391 | 
  | 
     | 
| 392 | 
< | 
    for (integrableObject = mol->beginIntegrableObject(ii);  | 
| 393 | 
< | 
         integrableObject != NULL; | 
| 391 | 
< | 
         integrableObject = mol->nextIntegrableObject(ii)) { | 
| 392 | 
> | 
    for (sd = mol->beginIntegrableObject(ii); sd != NULL; | 
| 393 | 
> | 
         sd = mol->nextIntegrableObject(ii)) { | 
| 394 | 
  | 
       | 
| 395 | 
< | 
      if (integrableObject->isRigidBody()) { | 
| 396 | 
< | 
        rb = static_cast<RigidBody*>(integrableObject); | 
| 395 | 
> | 
      if (sd->isRigidBody()) { | 
| 396 | 
> | 
        rb = static_cast<RigidBody*>(sd); | 
| 397 | 
  | 
        vector<Atom*> atoms = rb->getAtoms(); | 
| 398 | 
  | 
        set<int> rigidAtoms; | 
| 399 | 
  | 
        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) { | 
| 404 | 
  | 
        }       | 
| 405 | 
  | 
      } else { | 
| 406 | 
  | 
        set<int> oneAtomSet; | 
| 407 | 
< | 
        oneAtomSet.insert(integrableObject->getGlobalIndex()); | 
| 408 | 
< | 
        atomGroups.insert(map<int, set<int> >::value_type(integrableObject->getGlobalIndex(), oneAtomSet));         | 
| 407 | 
> | 
        oneAtomSet.insert(sd->getGlobalIndex()); | 
| 408 | 
> | 
        atomGroups.insert(map<int, set<int> >::value_type(sd->getGlobalIndex(), oneAtomSet));         | 
| 409 | 
  | 
      } | 
| 410 | 
  | 
    }   | 
| 411 | 
  | 
            | 
| 539 | 
  | 
    Molecule::RigidBodyIterator rbIter; | 
| 540 | 
  | 
    RigidBody* rb; | 
| 541 | 
  | 
    Molecule::IntegrableObjectIterator ii; | 
| 542 | 
< | 
    StuntDouble* integrableObject; | 
| 543 | 
< | 
     | 
| 544 | 
< | 
    for (integrableObject = mol->beginIntegrableObject(ii);  | 
| 545 | 
< | 
         integrableObject != NULL; | 
| 544 | 
< | 
         integrableObject = mol->nextIntegrableObject(ii)) { | 
| 542 | 
> | 
    StuntDouble* sd; | 
| 543 | 
> | 
     | 
| 544 | 
> | 
    for (sd = mol->beginIntegrableObject(ii); sd != NULL; | 
| 545 | 
> | 
         sd = mol->nextIntegrableObject(ii)) { | 
| 546 | 
  | 
       | 
| 547 | 
< | 
      if (integrableObject->isRigidBody()) { | 
| 548 | 
< | 
        rb = static_cast<RigidBody*>(integrableObject); | 
| 547 | 
> | 
      if (sd->isRigidBody()) { | 
| 548 | 
> | 
        rb = static_cast<RigidBody*>(sd); | 
| 549 | 
  | 
        vector<Atom*> atoms = rb->getAtoms(); | 
| 550 | 
  | 
        set<int> rigidAtoms; | 
| 551 | 
  | 
        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) { | 
| 556 | 
  | 
        }       | 
| 557 | 
  | 
      } else { | 
| 558 | 
  | 
        set<int> oneAtomSet; | 
| 559 | 
< | 
        oneAtomSet.insert(integrableObject->getGlobalIndex()); | 
| 560 | 
< | 
        atomGroups.insert(map<int, set<int> >::value_type(integrableObject->getGlobalIndex(), oneAtomSet));         | 
| 559 | 
> | 
        oneAtomSet.insert(sd->getGlobalIndex()); | 
| 560 | 
> | 
        atomGroups.insert(map<int, set<int> >::value_type(sd->getGlobalIndex(), oneAtomSet));         | 
| 561 | 
  | 
      } | 
| 562 | 
  | 
    }   | 
| 563 | 
  | 
 | 
| 791 | 
  | 
    set<AtomType*>::iterator i; | 
| 792 | 
  | 
    set<AtomType*> atomTypes; | 
| 793 | 
  | 
    atomTypes = getSimulatedAtomTypes();     | 
| 794 | 
< | 
    int usesElectrostatic = 0; | 
| 795 | 
< | 
    int usesMetallic = 0; | 
| 796 | 
< | 
    int usesDirectional = 0; | 
| 797 | 
< | 
    int usesFluctuatingCharges =  0; | 
| 794 | 
> | 
    bool usesElectrostatic = false; | 
| 795 | 
> | 
    bool usesMetallic = false; | 
| 796 | 
> | 
    bool usesDirectional = false; | 
| 797 | 
> | 
    bool usesFluctuatingCharges =  false; | 
| 798 | 
  | 
    //loop over all of the atom types | 
| 799 | 
  | 
    for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { | 
| 800 | 
  | 
      usesElectrostatic |= (*i)->isElectrostatic(); | 
| 803 | 
  | 
      usesFluctuatingCharges |= (*i)->isFluctuatingCharge(); | 
| 804 | 
  | 
    } | 
| 805 | 
  | 
 | 
| 806 | 
< | 
#ifdef IS_MPI     | 
| 807 | 
< | 
    int temp; | 
| 806 | 
> | 
#ifdef IS_MPI | 
| 807 | 
> | 
    bool temp; | 
| 808 | 
  | 
    temp = usesDirectional; | 
| 809 | 
< | 
    MPI_Allreduce(&temp, &usesDirectionalAtoms_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 810 | 
< | 
     | 
| 809 | 
> | 
    MPI::COMM_WORLD.Allreduce(&temp, &usesDirectionalAtoms_, 1, MPI::BOOL,  | 
| 810 | 
> | 
                              MPI::LOR); | 
| 811 | 
> | 
         | 
| 812 | 
  | 
    temp = usesMetallic; | 
| 813 | 
< | 
    MPI_Allreduce(&temp, &usesMetallicAtoms_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);     | 
| 813 | 
> | 
    MPI::COMM_WORLD.Allreduce(&temp, &usesMetallicAtoms_, 1, MPI::BOOL,  | 
| 814 | 
> | 
                              MPI::LOR); | 
| 815 | 
  | 
     | 
| 816 | 
  | 
    temp = usesElectrostatic; | 
| 817 | 
< | 
    MPI_Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  | 
| 817 | 
> | 
    MPI::COMM_WORLD.Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI::BOOL,  | 
| 818 | 
> | 
                              MPI::LOR); | 
| 819 | 
  | 
 | 
| 820 | 
  | 
    temp = usesFluctuatingCharges; | 
| 821 | 
< | 
    MPI_Allreduce(&temp, &usesFluctuatingCharges_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  | 
| 821 | 
> | 
    MPI::COMM_WORLD.Allreduce(&temp, &usesFluctuatingCharges_, 1, MPI::BOOL,  | 
| 822 | 
> | 
                              MPI::LOR); | 
| 823 | 
  | 
#else | 
| 824 | 
  | 
 | 
| 825 | 
  | 
    usesDirectionalAtoms_ = usesDirectional; |