| 783 | 
  | 
    fInfo_.SIM_requires_SkipCorrection = usesElectrostaticAtoms_; | 
| 784 | 
  | 
    fInfo_.SIM_requires_SelfCorrection = usesElectrostaticAtoms_; | 
| 785 | 
  | 
    fInfo_.SIM_uses_AtomicVirial = usesAtomicVirial_; | 
| 786 | 
+ | 
  } | 
| 787 | 
+ | 
 | 
| 788 | 
+ | 
 | 
| 789 | 
+ | 
  vector<int> SimInfo::getGlobalAtomIndices() { | 
| 790 | 
+ | 
    SimInfo::MoleculeIterator mi; | 
| 791 | 
+ | 
    Molecule* mol; | 
| 792 | 
+ | 
    Molecule::AtomIterator ai; | 
| 793 | 
+ | 
    Atom* atom; | 
| 794 | 
+ | 
 | 
| 795 | 
+ | 
    vector<int> GlobalAtomIndices(getNAtoms(), 0); | 
| 796 | 
+ | 
     | 
| 797 | 
+ | 
    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) { | 
| 798 | 
+ | 
       | 
| 799 | 
+ | 
      for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { | 
| 800 | 
+ | 
        GlobalAtomIndices[atom->getLocalIndex()] = atom->getGlobalIndex(); | 
| 801 | 
+ | 
      } | 
| 802 | 
+ | 
    } | 
| 803 | 
+ | 
    return GlobalAtomIndices; | 
| 804 | 
+ | 
  } | 
| 805 | 
+ | 
 | 
| 806 | 
+ | 
 | 
| 807 | 
+ | 
  vector<int> SimInfo::getGlobalGroupIndices() { | 
| 808 | 
+ | 
    SimInfo::MoleculeIterator mi; | 
| 809 | 
+ | 
    Molecule* mol; | 
| 810 | 
+ | 
    Molecule::CutoffGroupIterator ci; | 
| 811 | 
+ | 
    CutoffGroup* cg; | 
| 812 | 
+ | 
 | 
| 813 | 
+ | 
    vector<int> GlobalGroupIndices; | 
| 814 | 
+ | 
     | 
| 815 | 
+ | 
    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) { | 
| 816 | 
+ | 
       | 
| 817 | 
+ | 
      //local index of cutoff group is trivial, it only depends on the | 
| 818 | 
+ | 
      //order of travesing | 
| 819 | 
+ | 
      for (cg = mol->beginCutoffGroup(ci); cg != NULL;  | 
| 820 | 
+ | 
           cg = mol->nextCutoffGroup(ci)) { | 
| 821 | 
+ | 
        GlobalGroupIndices.push_back(cg->getGlobalIndex()); | 
| 822 | 
+ | 
      }         | 
| 823 | 
+ | 
    } | 
| 824 | 
+ | 
    return GlobalGroupIndices; | 
| 825 | 
  | 
  } | 
| 826 | 
  | 
 | 
| 827 | 
+ | 
 | 
| 828 | 
  | 
  void SimInfo::setupFortran() { | 
| 829 | 
  | 
    int isError; | 
| 830 | 
  | 
    int nExclude, nOneTwo, nOneThree, nOneFour; | 
| 893 | 
  | 
    int* oneThreeList = oneThreeInteractions_.getPairList(); | 
| 894 | 
  | 
    int* oneFourList = oneFourInteractions_.getPairList(); | 
| 895 | 
  | 
 | 
| 896 | 
< | 
    setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray[0],  | 
| 896 | 
> | 
    setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray_[0],  | 
| 897 | 
  | 
                   &nExclude, excludeList,  | 
| 898 | 
  | 
                   &nOneTwo, oneTwoList, | 
| 899 | 
  | 
                   &nOneThree, oneThreeList, | 
| 923 | 
  | 
    } | 
| 924 | 
  | 
    | 
| 925 | 
  | 
#ifdef IS_MPI     | 
| 886 | 
– | 
    //SimInfo is responsible for creating localToGlobalAtomIndex and | 
| 887 | 
– | 
    //localToGlobalGroupIndex | 
| 888 | 
– | 
    vector<int> localToGlobalAtomIndex(getNAtoms(), 0); | 
| 889 | 
– | 
    vector<int> localToGlobalCutoffGroupIndex; | 
| 926 | 
  | 
    mpiSimData parallelData; | 
| 891 | 
– | 
 | 
| 892 | 
– | 
    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) { | 
| 893 | 
– | 
 | 
| 894 | 
– | 
      //local index(index in DataStorge) of atom is important | 
| 895 | 
– | 
      for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { | 
| 896 | 
– | 
        localToGlobalAtomIndex[atom->getLocalIndex()] = atom->getGlobalIndex() + 1; | 
| 897 | 
– | 
      } | 
| 927 | 
  | 
 | 
| 899 | 
– | 
      //local index of cutoff group is trivial, it only depends on the order of travesing | 
| 900 | 
– | 
      for (cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) { | 
| 901 | 
– | 
        localToGlobalCutoffGroupIndex.push_back(cg->getGlobalIndex() + 1); | 
| 902 | 
– | 
      }         | 
| 903 | 
– | 
         | 
| 904 | 
– | 
    } | 
| 905 | 
– | 
 | 
| 928 | 
  | 
    //fill up mpiSimData struct | 
| 929 | 
  | 
    parallelData.nMolGlobal = getNGlobalMolecules(); | 
| 930 | 
  | 
    parallelData.nMolLocal = getNMolecules(); | 
| 936 | 
  | 
    MPI_Comm_size(MPI_COMM_WORLD, &(parallelData.nProcessors)); | 
| 937 | 
  | 
 | 
| 938 | 
  | 
    //pass mpiSimData struct and index arrays to fortran | 
| 939 | 
< | 
    setFsimParallel(¶llelData, &(parallelData.nAtomsLocal), | 
| 940 | 
< | 
                    &localToGlobalAtomIndex[0],  &(parallelData.nGroupsLocal), | 
| 941 | 
< | 
                    &localToGlobalCutoffGroupIndex[0], &isError); | 
| 939 | 
> | 
    //setFsimParallel(¶llelData, &(parallelData.nAtomsLocal), | 
| 940 | 
> | 
    //                &localToGlobalAtomIndex[0],  &(parallelData.nGroupsLocal), | 
| 941 | 
> | 
    //                &localToGlobalCutoffGroupIndex[0], &isError); | 
| 942 | 
  | 
 | 
| 943 | 
  | 
    if (isError) { | 
| 944 | 
  | 
      sprintf(painCave.errMsg, |