| 47 |  | * @version 1.0 | 
| 48 |  | */ | 
| 49 |  |  | 
| 50 | + | #ifdef IS_MPI | 
| 51 | + | #include <mpi.h> | 
| 52 | + | #endif | 
| 53 |  | #include <algorithm> | 
| 54 |  | #include <set> | 
| 55 |  | #include <map> | 
| 64 |  | #include "io/ForceFieldOptions.hpp" | 
| 65 |  | #include "brains/ForceField.hpp" | 
| 66 |  | #include "nonbonded/SwitchingFunction.hpp" | 
| 64 | – | #ifdef IS_MPI | 
| 65 | – | #include <mpi.h> | 
| 66 | – | #endif | 
| 67 |  |  | 
| 68 |  | using namespace std; | 
| 69 |  | namespace OpenMD { | 
| 372 |  |  | 
| 373 |  | void SimInfo::addInteractionPairs(Molecule* mol) { | 
| 374 |  | ForceFieldOptions& options_ = forceField_->getForceFieldOptions(); | 
| 375 | + | vector<Atom*>::iterator atomIter; | 
| 376 |  | vector<Bond*>::iterator bondIter; | 
| 377 |  | vector<Bend*>::iterator bendIter; | 
| 378 |  | vector<Torsion*>::iterator torsionIter; | 
| 379 |  | vector<Inversion*>::iterator inversionIter; | 
| 380 | + | Atom* atom; | 
| 381 |  | Bond* bond; | 
| 382 |  | Bend* bend; | 
| 383 |  | Torsion* torsion; | 
| 420 |  | atomGroups.insert(map<int, set<int> >::value_type(sd->getGlobalIndex(), oneAtomSet)); | 
| 421 |  | } | 
| 422 |  | } | 
| 423 | + |  | 
| 424 |  |  | 
| 425 |  | for (bond= mol->beginBond(bondIter); bond != NULL; | 
| 426 |  | bond = mol->nextBond(bondIter)) { | 
| 941 |  | } | 
| 942 |  | } | 
| 943 |  |  | 
| 944 | < | // Build the identArray_ | 
| 944 | > | // Build the identArray_ and regions_ | 
| 945 |  |  | 
| 946 |  | identArray_.clear(); | 
| 947 | < | identArray_.reserve(getNAtoms()); | 
| 948 | < | for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { | 
| 947 | > | identArray_.reserve(getNAtoms()); | 
| 948 | > | regions_.clear(); | 
| 949 | > | regions_.reserve(getNAtoms()); | 
| 950 | > |  | 
| 951 | > | for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { | 
| 952 | > | int reg = mol->getRegion(); | 
| 953 |  | for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { | 
| 954 |  | identArray_.push_back(atom->getIdent()); | 
| 955 | + | regions_.push_back(reg); | 
| 956 |  | } | 
| 957 |  | } | 
| 958 | < |  | 
| 958 | > |  | 
| 959 |  | topologyDone_ = true; | 
| 960 |  | } | 
| 961 |  |  |