Page 1 of 2

Implicit Membrane Model

Posted: Sun Apr 25, 2010 6:41 pm
by jadelman
I was wondering if it was possible to access the Z coordinate in the CustomGBForce class (or if there are future plans to allow users to access it), in order to implement a implicit membrane model. I have not played around with this class, but it does not appear possible given the current API.

RE: Implicit Membrane Model

Posted: Tue Apr 27, 2010 5:46 am
by jchodera
I'll second the request for this! The implicit membrane GB models from Michael Feig and Charlie Brooks might be good ones to look at for examples of what might be allowed by the CustomGBForce class.

See, for example, the references under "Implicit Models of Heterogeneous Dielectric Environments" at the bottom of this page:

http://feig.bch.msu.edu/main-research-methodology.html

RE: Implicit Membrane Model

Posted: Fri Apr 30, 2010 5:40 pm
by peastman
What would be required to support the models you're interested in? How about if computed values and energy terms of type SingleParticle (but *not* particle pair ones) could depend on the (x, y, z) coordinates of the particle?

Peter

RE: Implicit Membrane Model

Posted: Wed May 05, 2010 1:40 pm
by peastman
Ok, I've just checked in this feature. Give it a try, and please let me know how it works.

Peter

Re: Implicit Membrane Model

Posted: Tue Sep 25, 2018 3:19 pm
by npschafer
Hi Peter -

I'm interested in having a ParticlePair CustomGBForce that depends on the z-coordinates of the interacting particles. Is it possible to implement such a force by using SingleParticle computed values that depend on the z-values of the interacting pair of particles inside the energy expression of a ParticlePair force?

Best,
Nick

Re: Implicit Membrane Model

Posted: Tue Sep 25, 2018 4:19 pm
by peastman
Yes, that ought to work. You can have a SingleParticle computed value that depends on z. A ParticlePair energy term can then depend on the values of that computed value for the two particles.

Peter

Re: Implicit Membrane Model

Posted: Tue Sep 25, 2018 4:34 pm
by npschafer
Perfect. Thanks again for your efforts.

Cheers,
Nick

Re: Implicit Membrane Model

Posted: Fri Jan 11, 2019 11:34 am
by luwei0917
I got an error
(OpenCL Error : clEnqueueNDRangeKernel failed: kernel_arg 6 has not yet been initialized) using openCL
(CUDA_ERROR_INVALID_VALUE) using CUDA, no error using CPU.
when I tried to implement this implicit membrane model,

Code: Select all

contact = CustomGBForce()
gamma_ijm = np.zeros((2, 20, 20))
contact.addTabulatedFunction("gamma_ijm", Discrete3DFunction(2, 20, 20, gamma_ijm.T.flatten()))
contact.addComputedValue("rho", f"1", CustomGBForce.ParticlePair)
contact.addComputedValue("alpha", f"z", CustomGBForce.SingleParticle)
for i in range(pdb.topology.getNumAtoms()):
    contact.addParticle()
But if I comment out one line

Code: Select all

contact.addTabulatedFunction("gamma_ijm", Discrete3DFunction(2, 20, 20, gamma_ijm.T.flatten()))
then no error will occur.

simplified example is attached here, you can run it with

Code: Select all

 python3 mm_run.py 
customGBforce.zip
(47.18 KiB) Downloaded 41 times
Please help.
Thanks a lot.

Wei Lu

Re: Implicit Membrane Model

Posted: Wed Jan 23, 2019 2:11 pm
by peastman
I just posted a pull request with the fix. Could you try it out and see whether it now works for you?

https://github.com/pandegroup/openmm/pull/2248

Re: Implicit Membrane Model

Posted: Wed Jan 30, 2019 11:22 am
by luwei0917
It works! thanks a lot!