Commit c0207411 authored by peastman's avatar peastman
Browse files

Merge pull request #48 from peastman/master

Fixed an atom ordering bug in AmoebaMultipoleForce
parents 3279efe5 e4beb290
......@@ -747,6 +747,7 @@ void CudaContext::findMoleculeGroups() {
for (int j = 0; j < forces[i]->getNumParticleGroups(); j++) {
vector<int> particles;
forces[i]->getParticlesInGroup(j, particles);
if (particles.size() > 0)
molecules[atomMolecule[particles[0]]].groups[i].push_back(j);
}
}
......
......@@ -778,6 +778,17 @@ public:
}
return true;
}
int getNumParticleGroups() {
return 7*force.getNumMultipoles();
}
void getParticlesInGroup(int index, vector<int>& particles) {
int particle = index/7;
int type = index-7*particle;
force.getCovalentMap(particle, AmoebaMultipoleForce::CovalentType(type), particles);
}
bool areGroupsIdentical(int group1, int group2) {
return ((group1%7) == (group2%7));
}
private:
const AmoebaMultipoleForce& force;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment