[lammps-users] (no subject)

I did read the doc, but what I don’t understand is how does lammps know which interactions are described by the coefficients if the user does not write it: if I have 2 atoms H and O, there are 3 bonds no? H-H, O-O, H-O so how can I describe 3 bonds using only the ID of 2 atoms? And I’ve seen in a lot of examples this kind of syntax:
1 args

2 args

3 args
Do the numbers serve any descriptive purpose? How does lammps know which line describes O-O or H-H or O-H? And if the numbers refers to another part of the code where 1 is explicitely O-O, 2 H-H and 3 O-H, where should it be written, because I don’t see this part of the codes in the data files…

(I’m sorry if my questions seem dumb, but I’m just getting started and what might seem obvious for some is not for me…)

You are mixing up atom IDs and and bond IDs with atom types and bond types.

when the header section of the data file is processed it must provide the number of atoms, but also the number of atom types. same for bonds and so on. the number of types is then set in stone and cannot be changed.

now in the Atoms section each entry has starts with the atom ID but then assigns that atom an atom type followed by some other properties including coordinates. same for the Bonds section where you have a bond ID, a bond type and then the two atom IDs forming the bond.

to assign force field parameters then the “* Coeff” sections or *_coeff commands have to provide the parameters for each type. since the number of types is fixed LAMMPS knows exactly how many lines there have to be in the Coeff sections.

with this explanation at hand, please read the read_data documentation again and also the introduction to running LAMMPS in the manual and perhaps some of the tutorials.
then you can look at the examples in the examples folder and look up the commands used in the manual. if you start with simple small examples and gradually look into more complex ones you should be able to build your understanding. it is not rocket science and lots of people have understood it. but you must not jump ahead and make assumptions.

axel.