[lammps-users] Access to a pointer value

Hello all!

I am implementing some code for autocorrelation compute in LAMMPS but i found some C++ dificulties I would like to ask. The question is I need to save the initial velocities of atoms to begin the autocorrelation compute but I find it dificult because all objects defined in LAMMPS are pointers to objects, I suposse, and provide access to the direcction nor the value ( for instance atom->v ) so i dont find the way to save initial data (in fact every step are actualiced so my autorrelation is ever 1 !!). I am a little bit ‘self-taught’ guy in C++ so advanced topics in some way are still dificult for me (Class inside class, pointers to class … etc).

Any help is welcome!!! thanks!!

Diego Delgado

Hello all!

   I am implementing some code for autocorrelation compute in LAMMPS but i
found some C++ dificulties I would like to ask. The question is I need to
save the initial velocities of atoms to begin the autocorrelation compute
but I find it dificult because all objects defined in LAMMPS are pointers to
objects, I suposse, and provide access to the direcction nor the value ( for
instance atom->v ) so i dont find the way to save initial data (in fact

of course you have to make a copy of the data being pointed to.

every step are actualiced so my autorrelation is ever 1 !!). I am a little
bit 'self-taught' guy in C++ so advanced topics in some way are still
dificult for me (Class inside class, pointers to class ... etc).

so perhaps you should first teach yourself a little more,
before undertaking larger endeavors. please have a look at:

which i found an excellent book for self-study.

cheers,
   axel.