Share 
Follow 
AboutDownloadsDocumentsForumsWikiIssuesNews
Date:
2011-12-27 02:44
Priority:
3
State:
Open
Submitted by:
John Chodera (jchodera)
Assigned to:
Peter Eastman (peastman)
Summary:
removeForce() method for System objects?

Detailed description
It would be useful to have a removeForce() method for System objects. Now that these objects support deep copies, this method would aid in the manipulation of System objects, such as the construction of alchemical intermediates.

Here's a suggested method interface:

/**
* Remove a Force from the System. The System relinquishes ownership of it, returning a pointer to the Force, at which point it can be reused or deleted. Remaining Force objects in the System are renumbered accordingly.
*
* @param index the index within the System of the Force to be removed
* @return a pointer to the Force object that was removed
*/
Force *removeForce(int index);

Failure might trigger an exception or return a null pointer---whichever is most consistent with current OpenMM API conventions.

It need not be this way---another option would be to take the Force pointer as an argument. If it is difficult for the System to simply relinquish ownership, the Force could simply be deleted instead, and success or failure signaled with an integer.

Thanks!

John

Add A Comment: Notepad

Message  ↓
Date: 2012-03-14 02:39
Sender: John Chodera

After our discussion today at the OpenMM Workshop, I wanted to again lobby for some methods that would make the System class behave more like a container to which Force objects can be added/removed.

Field Old Value Date By
assigned_tonone2012-03-14 02:39jchodera
Feedback