Modify Lammps

Sir,

What are the necessary files in Lammps that needs to be changed to add an extra information to every atom, then read it, and use them in force calculation in one of the fix (Like coordinates).

Thanks in advance

Sir,
What are the necessary files in Lammps that needs to be changed to add an extra information to every atom, then read it, and use them in force calculation in one of the fix (Like coordinates).

no modifications at all. you could use fix property/atom to add custom
properties.

you may also maintain per atom data inside your fix and then use the
available pack/unpack routines to communicate that information when
atoms move between subdomains. several fixes do that.

if neither is attractive to you (i cannot see why, but just for the
sake of argument), you would have to create a new atom style. for more
information see the manual.

axel.

Greetings,

As Axel mentioned there is an interface that can handle most simple uses, if your application ends up being more complicated for whatever reason you would have to follow a process such as:

To actually find more detail on the how and what you can see this section of the manual, https://lammps.sandia.gov/doc/Modify.html, and also see similar style implementations in the src directory for inspiration.

Hi,

Thanks for the quick response. Actually i need to specify a different value for every particle, and after going through the first suggestion by Axel, I am having a doubt that whether this can be achieved through fix property/atom (because i want to assign different property to every atom)? Its like a different random angle that i want to assign to every atom at the beginning of my simulation (which will be there in my data file along with coordinate and velocities), then I’ll use those values during my force calculation in some fix.

Hi,

Thanks for the quick response. Actually i need to specify a different value for every particle, and after going through the first suggestion by Axel, I am having a doubt that whether this can be achieved through fix property/atom (because i want to assign different property to every atom)?

yes, it can. very obviously so. you don’t say what your concern is motivated by.

Its like a different random angle that i want to assign to every atom at the beginning of my simulation (which will be there in my data file along with coordinate and velocities), then I’ll use those values during my force calculation in some fix.

with this description, all different paths are open to you. but if the initial value is random and nothing else but your fix needs to maintain this information, then i would prefer to maintain it internally in your fix. no need to try and maintain it through a data file (which adds complexity to your input) and all the other complications. even if you need to read information from a file, you could optionally initialize it using an atomfile style variable.

axel