[lammps-users] restart and atom_vec_full

Dear Lammps-users,

I introduced a new member to atom_vec_full called double **efield. efield holds the value of the electric field at points in space where atoms are located, thus efield looks like
efield[nlocal][3 coordinates]. The values for efield are taken from the force calculation in pair_lj_cut_coul_long.cpp and are assigned in the compute() function. (I modeled efield on the existing double **f, using the same function calls, such as memory->grow_2d_double_array(), etc.)

If I do a simulation where I print out the efield values for a particular atom at each time step, then I get two different results depending on the input script.

Input 1:
run 15

Input 2:
restart 10
run 15

Inputs 1 and 2 generate different values for efield for timesteps larger than 10 timesteps. But the thermodynamic quantities from thermo are the same.

I've gone over the code in write_restart.cpp and output.cpp but I don't see how this makes sense. Is there some part of atom_vec_full.cpp that is affected by writing restarts? Although the differences after 10 timesteps are minor, the differences grow with time until one of the systems blow up due to poor energy conservation.

Any help on this would be great! Thanks in advance.


Atom_vec classes do have restart functions in them. If you
want the efield values written to and read from restart files
you'd have to include the array in those routines.


Another thought. Writing a restart file does force the code
to re-neighbor. So if you are not doing neighbor lists
frequently enough, and you write a restart file on step 10,
then you may have differenet answers on step 15, b/c
you reneighbored at a different time.