Development question

Dear all,

I would like to implement a new potential in LAMMPS but I find really hard to pinpoint exactly where to introduce changes. The LAMMPS Developer Guide is not of great help either. For example it took me some time to even figure out which part of the code that does the “run” command, as it is “buried” inside a macro at the end of the function “Input::exectue_command()”. I wonder if any one can point me towards a better resource regarding the details of how the many classes and functions are related to one another.

Looking forward to hearing from you.

Best regards,

Hand

It might be helpful to take a look at something like pair_lj_cut.cpp/.h to get an idea of how a simple potential is implemented.

Dear all,
I would like to implement a new potential in LAMMPS but I find really hard
to pinpoint exactly where to introduce changes. The LAMMPS Developer Guide
is not of great help either. For example it took me some time to even figure

perhaps, you haven't been reading it right. many people i know find it
extremely useful.

out which part of the code that does the "run" command, as it is "buried"
inside a macro at the end of the function "Input::exectue_command()". I
wonder if any one can point me towards a better resource regarding the
details of how the many classes and functions are related to one another.

looks like you did things backwards.
most people don't ever need to read the Developers Guide to add a
potential, but simply look at the regular manual

http://lammps.sandia.gov/doc/Section_modify.html

outlines all the important steps to add a potential and it is highly
recommended to start from an existing file and modify it.

axel.

Get a word editor, and start modifying… You will know it in a couple of days. I have been there, did it.

If you keep thinking you don’t understand it, you will never understand it. Start coding, you will understand.

Dear All,

Thank you very much indeed for your comments and suggestions. It seems that there isn’t any “deeper” secret to it then :slight_smile: I have been doing just what you have suggested, but may be not enough.

Regards,

Hand

Dear All,
Thank you very much indeed for your comments and suggestions. It seems that
there isn't any "deeper" secret to it then :slight_smile: I have been doing just what
you have suggested, but may be not enough.

"use the source, luke!" :wink:

you would certainly be welcome to improve the existing documentation
for people that are new to developing for LAMMPS, but as i already
mentioned, it is likely that you'll find the existing documentation
quite helpful, if you've found out how to read it right.

axel.

Online you can find sites like the one below with a bit more “dressing” related to explaining things for beginners.

https://sites.google.com/site/scienceuprising/code-packages/lammps/a-dissection-of-lammps-classes