Molecular dynamics package

Hello,

Happy New Year.

I am currently making a (mex) wrapper for GNU Octave to my molecular dynamics simulation library. The library is light-weight written in iso-C99 and independent of any external libraries and programs (beside the standard libs of course). It supports standard pair interactions, molecular bonds, angles, dihedrals, electrostatic interactions, and much more.

For example, the following script simulates a polymer system using Dissipative Particle Dynamics (DPD):

-------------------- START -------------
clear

Interaction parameters

sigma = 3.0; aAA = 25.0; lambda = 0.65;

Bond parameters

bondlength = 0.0; kspring = 2.0;

Load initial conditions and molecule information

molsim(‘load’, ‘xyz’, ‘polymer.xyz’);
molsim(‘load’, ‘top’, ‘polymer.top’);

Set temperature

molsim(‘set’, ‘temperature’, 1.0);

Main molecular dynamics loop

for n=1:1000

molsim(‘reset’);

molsim(‘calcforce’, ‘dpd’, ‘AA’, cutoff, aAA, sigma);
molsim(‘calcforce’, ‘bond’, 0, bondlength, kspring);

molsim(‘integrate’, ‘dpd’, lambda)

endfor

--------------------- END ---------------------

The wrapper offers access to particle positions, forces, types, system energy, pressure, etc. For example to get system energies and positions

energies = molsim(‘get’, ‘energies’), x = molsim(‘get’, ‘positions’);

I am not a software developer, but self-taught scientist, and I am sure the wrapper and library has some poor/bad/unsafe coding style. In any case, the base library has been tested for many years and my scientific papers are based on it, so I am not (too) concerned about the output.

Will such a molecular dynamics software package (library + wrapper) be interesting for the GNU Octave community? If so, how do I proceed? I will soon release the library under GPL.

Best wishes Jesper

1 Like

Happy new year @schmidt :slightly_smiling_face:

We always love new packages :+1: A good start for a new package is

As the wrapped library is considered to be “light-weight”, it might be beneficial to only include the source code with your Octave package, to avoid problems of compiled library deployment.

If you need any help with the Octave packaging, please let us know.

Great - I will proceed. Very happy that I also can contribute with code to this fantastic project!

Cheers Jesper

1 Like