Page 1 of 1

Standalone FORTRAN program for potential energy and forces

Posted: Tue May 05, 2020 2:36 pm
by ommairishaque
Hi,

I have written fortran 90 program for calculation of potential energies and forces. I have test it in my MD code written locally. Now I want to perform MD using openmm using my program for potential energies and forces.

Potential energy function I am using is develop for water simulation only and expensive.

So my question is what should be the key steps to make interface of my code with openmm.

1) Should I follow hello_sodium_chloride written in fortran?
2) Can we perform rigid body dynamics?

Best
Ommair

Re: Standalone FORTRAN program for potential energy and forces

Posted: Wed May 13, 2020 10:48 am
by peastman
Sorry for the delay in replying! This got lost in my inbox.

Could you elaborate on what you want to do? Do you want to use OpenMM only for integration, and have your own code do all the force and energy computations? Or do you also want to use force computations from OpenMM, adding in your own force along with the standard ones? What kind of force are you computing?

Re: Standalone FORTRAN program for potential energy and forces

Posted: Sun May 17, 2020 9:02 pm
by ommairishaque
Hi Peter,

1) Yes basically I want to do integration using openmm because mycode can do force and energy calculation. Mycode can also handle rigid body dynamics using quanternions. Is it possible in openmm?

2) Second thing I would like to cross check mycode forces, so it will be great to if openmm can calculate forces and do MD. My code can calculate interaction energies. it will be great to add my own force along with the standard ones

3) I am studying water potential developed in our group. It has Vdw, induction energy from induced dipole and three body interactions. Functional form of the potential is expensive.

Best
Ommair

Re: Standalone FORTRAN program for potential energy and forces

Posted: Mon May 18, 2020 3:40 pm
by peastman
That sounds like several very different projects. Taking them one at a time.

OpenMM doesn't do rigid body integration, though we do have a Python script you can use to build rigid bodies out of constraints and virtual sites: https://simtk.org/svn/pyopenmm/trunk/si ... s/rigid.py

The cleanest way to integrate your own force calculation routines into OpenMM is by writing a plugin. This is documented in the developer guide: http://docs.openmm.org/latest/developerguide/index.html. Plugins can only be written in C++, not Fortran.

You say you want to cross check the forces you compute by having OpenMM compute them as well. That implies it already supports the same calculation done by your code? If so, why not just use its existing implementation directly? Or if it doesn't already support that calculation, how can you use it to cross check your code?

Re: Standalone FORTRAN program for potential energy and forces

Posted: Wed Jun 03, 2020 12:47 pm
by mkrompiec
Hi, I suggest considering Atomic Simulation Environment (ASE) as the MD driver. It is interfaced to several compute codes via a Calculator object, which computes energy and forces - you would need to implement your own Calculator which would communicate with your Fortran code.
Best,
Michal