Page 1 of 1
Asymmetrical Passing
Posted: Thu Jun 22, 2017 8:24 am
by yaz62
How to design a forcefield/mechanism in openMM to allow, say, particle A to pass through particle B (which has its orientation) from one direction but not the opposite?
Thanks,
Yan
Re: Asymmetrical Passing
Posted: Thu Jun 22, 2017 10:40 am
by peastman
Could you explain what you mean in more detail? What sort of physical system are you modelling? What do you want the potential function to look like?
Peter
Re: Asymmetrical Passing
Posted: Fri Jun 23, 2017 12:23 pm
by yaz62
Say we have two particles A and B. A has an orientation. when B is colliding A from the front, it is allowed to pass (e.g. through a softened LJ potential), but when B is colliding A from the back, it is blocked (e.g. through a repulsive LJ potential). Is it possible to implement a forcefield like this? In my mind the force field of B is something like a waterfall where the potential on one side is higher than the other.
I think the first problem is that I'm not sure how to implement an "orientation" for particle B. Perhaps I can attach another "virtual" particle to it? But when implementing the force field, how could I access the coordinate of the virtual particle?
Re: Asymmetrical Passing
Posted: Fri Jun 23, 2017 3:53 pm
by peastman
GayBerneForce can apply a non-isotropic LJ-like force based on orientation, so that's the closest thing. But the behavior you described doesn't correspond to any kind of potential function. If you want the force to be different depending on which direction the particles are moving in, there's no way to write that as the gradient of a potential function that depends on the particles' positions and orientations.
You could implement it with a plugin, if you want. But be aware that it won't be a conservative force. Are you sure that's what you want?
Re: Asymmetrical Passing
Posted: Fri Jun 23, 2017 9:27 pm
by yaz62
Yes, a non-conservative force will do the trick. May I know the name of the plugin?
Also, is there anyway to define an orientation for a particle in openmm? Or, alternatively, is there a way to pass the coordinate of a third particle as a parameter in a non-bonded force?
Re: Asymmetrical Passing
Posted: Sun Jun 25, 2017 8:54 am
by peastman
There isn't an existing plugin that does what you want. You would need to write it. See the developer guide for information on how to write plugins:
http://docs.openmm.org/7.1.0/developerguide/index.html
Take a look at GayBerneForce for an example of a force that has orientations for particles. It defines them based on the positions of one or two other particles.
Re: Asymmetrical Passing
Posted: Sun Jun 25, 2017 2:47 pm
by yaz62
I see. So to implement something like Gay-Berne force in OpenMM, I should use <CustomManyParticleForce>, right?
Re: Asymmetrical Passing
Posted: Mon Jun 26, 2017 8:46 am
by peastman
I'm not sure what you mean by that. GayBerneForce and CustomManyParticleForce are both existing classes, but neither one can do exactly what you want. So you'll need to create a new plugin that implements a new Force class that does what you want.
Re: Asymmetrical Passing
Posted: Wed Jun 28, 2017 9:07 am
by yaz62
I want to have a forcefield with 3 parameters: the position of particle A, the position of particle B, and the orientation of particle A. Since the orientation of A can only be calculated based on the position of another particle C, so I don't think it can be implemented using a <CustomNonbondedForce>. But a <CustomManyParticleForce> might be good enough because I can have the position of all three particles.
Re: Asymmetrical Passing
Posted: Fri Aug 18, 2017 1:08 pm
by spadanco
The information in posts was awesome