extend lammps to create a new per atom variable

Dear Lammps users,

If I need to introduce a new per-atom variable to the source. What are the files in the source code that I need to modify. I want to be able to dump the variable to a trajectory file. I want to define a new per-atom variable because I will use it later in the source code to something else. I just need to know what file do I need to modify to make a new per-atom variable that is similar to the force

Thanks,
Elena

Dear Lammps users,

If I need to introduce a new per-atom variable to the source. What are the
files in the source code that I need to modify. I want to be able to dump
the variable to a trajectory file. I want to define a new per-atom variable
because I will use it later in the source code to something else. I just
need to know what file do I need to modify to make a new per-atom variable
that is similar to the force

there is no quick and simple answer to this. you seem to make some
assumptions about LAMMPS that are more like what applies to some
simple and old-fashioned MD codes. however LAMMPS is a large and
rather complex code with many interlocking parts. particularly its
parallel design with domain decomposition, makes it so that there is
more work to be done, that just adding some arrays/variables
somewhere; the contained data also needs to migrate with the atoms
from subdomain to subdomain.

can you explain a bit more what you are trying to implement and how
exactly use this per-atom data and where?
there are ways to add per atom data without changing source code
using, e.g. fix property/atom, but you may also need to add a new atom
style, or collect/update the data inside a pair style or a compute or
a custom fix.

you probably should first read section 10 of the LAMMPS manual and
have a look at the developer's guide.

axel.