Commit 6734f66d authored by peastman's avatar peastman
Browse files

Merge pull request #388 from peastman/master

Exposed getMolecules() in the public API
parents e76cbe31 0285f162
...@@ -247,6 +247,15 @@ public: ...@@ -247,6 +247,15 @@ public:
* @param stream an input stream the checkpoint data should be read from * @param stream an input stream the checkpoint data should be read from
*/ */
void loadCheckpoint(std::istream& stream); void loadCheckpoint(std::istream& stream);
/**
* Get a description of how the particles in the system are grouped into molecules. Two particles are in the
* same molecule if they are connected by constraints or bonds, where every Force object can define bonds
* in whatever way are appropriate to that force.
*
* Each element lists the indices of all particles in a single molecule. Every particle is guaranteed to
* belong to exactly one molecule.
*/
const std::vector<std::vector<int> >& getMolecules() const;
private: private:
friend class Force; friend class Force;
friend class Platform; friend class Platform;
......
...@@ -278,3 +278,7 @@ void Context::loadCheckpoint(istream& stream) { ...@@ -278,3 +278,7 @@ void Context::loadCheckpoint(istream& stream) {
ContextImpl& Context::getImpl() { ContextImpl& Context::getImpl() {
return *impl; return *impl;
} }
const vector<vector<int> >& Context::getMolecules() const {
return impl->getMolecules();
}
...@@ -297,6 +297,7 @@ UNITS = { ...@@ -297,6 +297,7 @@ UNITS = {
("AmoebaWcaDispersionForce", "getShctd") : ( None, ()), ("AmoebaWcaDispersionForce", "getShctd") : ( None, ()),
("Context", "getParameter") : (None, ()), ("Context", "getParameter") : (None, ()),
("Context", "getMolecules") : (None, ()),
("CMAPTorsionForce", "getMapParameters") : (None, ()), ("CMAPTorsionForce", "getMapParameters") : (None, ()),
("CMAPTorsionForce", "getTorsionParameters") : (None, ()), ("CMAPTorsionForce", "getTorsionParameters") : (None, ()),
("CMMotionRemover", "getFrequency") : (None, ()), ("CMMotionRemover", "getFrequency") : (None, ()),
......
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