How to fix atms....

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Kasra Momeni
Posts: 23
Joined: Sat Nov 14, 2009 12:06 pm

How to fix atms....

Post by Kasra Momeni » Sun Jan 30, 2011 12:58 am

Hello

How I can fix the position of atoms so that they do not move?
By now I have tried to set the boundary atoms position just by context->setPositions function.

regards,
Kasra.

User avatar
Peter Eastman
Posts: 2564
Joined: Thu Aug 09, 2007 1:25 pm

RE: How to fix atms....

Post by Peter Eastman » Mon Jan 31, 2011 1:10 pm

You can use a CustomExternalForce to apply a harmonic force to those atoms to keep them at the desired position. In fact, if you look at the API documentation for CustomExternalForce, you'll find sample code for exactly this case.

Peter

User avatar
John Chodera
Posts: 53
Joined: Wed Dec 13, 2006 6:22 pm

RE: How to fix atms....

Post by John Chodera » Mon Jan 31, 2011 1:16 pm

Hi Peter,

From the original message, it sounds like Kasra wants to *fix* the atoms in space, which would imply constraining the positions to a fixed point in space. The CustomExternalForce allows one to *restrain* the positions to be *near* a specified position, but this is, formally and practically, different.

Kasra: It might be useful to add a feature request for integrators that support fixing some atoms in space so that they do not move, rather than imposing harmonic restraints, is necessary.

User avatar
Kasra Momeni
Posts: 23
Joined: Sat Nov 14, 2009 12:06 pm

RE: How to fix atms....

Post by Kasra Momeni » Mon Jan 31, 2011 5:40 pm

What I am doing now is setting the velocity of atoms that I want to fix to zero after each integration step. However it reduces the efficiency of the simulations.

regards,
Kasra.

User avatar
Kasra Momeni
Posts: 23
Joined: Sat Nov 14, 2009 12:06 pm

RE: How to fix atms....

Post by Kasra Momeni » Mon Jan 31, 2011 9:01 pm

Dear Peter

In my case I am pooling atoms by changing their velocities. Therefore, I do not know exactly the force that should be applied to the atoms to prevent them from moving. So I am not sure if I can the CustomExternalForce.

regards,
Kasra.

User avatar
Peter Eastman
Posts: 2564
Joined: Thu Aug 09, 2007 1:25 pm

RE: How to fix atms....

Post by Peter Eastman » Wed Feb 02, 2011 1:57 pm

As John pointed out, CustomExternalForce implements a restraint rather than a constraint. It doesn't keep the atoms absolutely fixed, but prevents them from moving very far from the specified point.

To do this with a true constraint would require adding a new feature to OpenMM.

Peter

POST REPLY