Restart granular simulation with history

Hi LAMMPS users,

I am running quasi-static granular simulations with friction. After setting up my system and equilibrating it, I would like to save its initial state to later to run different simulations. The mechanical equilibrium of that initial configuration depends on the history of the tangent displacements (tangential friction forces) that I must know.

I tried a simple test case with 2 particles: write_data/read_data does not save the contact history, write_restart/read_restart saves the contact history information but is not portable. That would be a problem as I would have to rebuild the initial configuration on each machine I use.

  • Is there a way, using existing commands, to feed that contact history to LAMMPS in a portable way (not using restart) ? The information is accessible through compute property/local, can it somehow be saved with a dump/local and read again ?
  • if not, could this be done by creating a command that reads the information form a file and initializes it once the neighbor list is built ? A quick look at the code seems to show that the history is managed in the fix_neigh_history class. I suppose that is more or less what is done when using read_restart, would you see any way to perform that task reading from a portable non-binary file ?

Thank you very much for your help,


The granular history info is stored on a per-pair basis like a neighbor list.
Data files do not contain info in that format.

Not sure why you think that info is available via compute property/local
or dump local. It isn’t so far as I see or can remember.

Re: portability of restart files. Have you tried reading your restart
files on different machines? Almost all current CPUs are
the same ENDIAN format, and so the restart files will be portable.
Can’t recall the one or two that are exceptions.

LAMMPS should give you an error about ENDIAN in the read_restart
command if that is not the case for your choice of 2 machines.


Dear Steve,

Thank you for your answer. Reading the restart files on different computers indeed worked well. It required using the same version of LAMMPS, otherwise (e.g. restart file produced on 07Aug2019 read by 31May2019) I got a segmentation fault.

Regarding the state of the system, I meant saving it by pair/local, not property/local. The restart conditions with on-step velocity are actually satisfactory for my applications so that is not an issue anymore.


Jibril B. Coulibaly