787 |
|
int beginRigidBodyIndex; |
788 |
|
int beginCutoffGroupIndex; |
789 |
|
int nGlobalAtoms = info->getNGlobalAtoms(); |
790 |
+ |
int nGlobalRigidBodies = info->getNGlobalRigidBodies(); |
791 |
|
|
792 |
|
beginAtomIndex = 0; |
793 |
|
//rigidbody's index begins right after atom's |
863 |
|
#endif |
864 |
|
|
865 |
|
//fill molMembership |
866 |
< |
std::vector<int> globalMolMembership(info->getNGlobalAtoms(), 0); |
866 |
> |
std::vector<int> globalMolMembership(info->getNGlobalAtoms() + |
867 |
> |
info->getNGlobalRigidBodies(), 0); |
868 |
|
|
869 |
< |
for(mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) { |
869 |
> |
for(mol = info->beginMolecule(mi); mol != NULL; |
870 |
> |
mol = info->nextMolecule(mi)) { |
871 |
|
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { |
872 |
|
globalMolMembership[atom->getGlobalIndex()] = mol->getGlobalIndex(); |
873 |
|
} |
874 |
+ |
for (rb = mol->beginRigidBody(ri); rb != NULL; |
875 |
+ |
rb = mol->nextRigidBody(ri)) { |
876 |
+ |
globalMolMembership[rb->getGlobalIndex()] = mol->getGlobalIndex(); |
877 |
+ |
} |
878 |
|
} |
879 |
|
|
880 |
|
#ifdef IS_MPI |
881 |
< |
std::vector<int> tmpMolMembership(info->getNGlobalAtoms(), 0); |
881 |
> |
std::vector<int> tmpMolMembership(info->getNGlobalAtoms() + |
882 |
> |
info->getNGlobalRigidBodies(), 0); |
883 |
|
MPI::COMM_WORLD.Allreduce(&globalMolMembership[0], &tmpMolMembership[0], |
884 |
< |
nGlobalAtoms, |
884 |
> |
nGlobalAtoms + nGlobalRigidBodies, |
885 |
|
MPI::INT, MPI::SUM); |
886 |
|
|
887 |
|
info->setGlobalMolMembership(tmpMolMembership); |
893 |
|
// here the molecules are listed by their global indices. |
894 |
|
|
895 |
|
std::vector<int> nIOPerMol(info->getNGlobalMolecules(), 0); |
896 |
< |
for (mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) { |
896 |
> |
for (mol = info->beginMolecule(mi); mol != NULL; |
897 |
> |
mol = info->nextMolecule(mi)) { |
898 |
|
nIOPerMol[mol->getGlobalIndex()] = mol->getNIntegrableObjects(); |
899 |
|
} |
900 |
|
|
915 |
|
} |
916 |
|
|
917 |
|
std::vector<StuntDouble*> IOIndexToIntegrableObject(info->getNGlobalIntegrableObjects(), (StuntDouble*)NULL); |
918 |
< |
for (mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) { |
918 |
> |
for (mol = info->beginMolecule(mi); mol != NULL; |
919 |
> |
mol = info->nextMolecule(mi)) { |
920 |
|
int myGlobalIndex = mol->getGlobalIndex(); |
921 |
|
int globalIO = startingIOIndexForMol[myGlobalIndex]; |
922 |
|
for (StuntDouble* sd = mol->beginIntegrableObject(ioi); sd != NULL; |