ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimInfo.cpp
(Generate patch)

Comparing branches/development/src/brains/SimInfo.cpp (file contents):
Revision 1548 by gezelter, Mon Apr 11 18:44:16 2011 UTC vs.
Revision 1549 by gezelter, Wed Apr 27 18:38:15 2011 UTC

# Line 783 | Line 783 | namespace OpenMD {
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;
# Line 883 | Line 923 | namespace OpenMD {
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;
927  
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      }
898
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();
# Line 914 | Line 936 | namespace OpenMD {
936      MPI_Comm_size(MPI_COMM_WORLD, &(parallelData.nProcessors));
937  
938      //pass mpiSimData struct and index arrays to fortran
939 <    setFsimParallel(&parallelData, &(parallelData.nAtomsLocal),
940 <                    &localToGlobalAtomIndex[0],  &(parallelData.nGroupsLocal),
941 <                    &localToGlobalCutoffGroupIndex[0], &isError);
939 >    //setFsimParallel(&parallelData, &(parallelData.nAtomsLocal),
940 >    //                &localToGlobalAtomIndex[0],  &(parallelData.nGroupsLocal),
941 >    //                &localToGlobalCutoffGroupIndex[0], &isError);
942  
943      if (isError) {
944        sprintf(painCave.errMsg,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines