I use lammps for the peridynamics with the pmb style and for
visualization I like to get a adjacency matrix or a list for each
particle with the id of the neighbors including a broken flag. I need
some information about the broken bonds.
Using > compute C2 all property/local natom1 natom2 ntype1 ntype2
delivers the actual neighbors, but not the ID of the neighbors which are
broken.
What is the best approach to implement this in lammps? A compute command
or a dump command?
There is a compute damage/atom command for PD that
may have the info you want (on a per-atom basis).
See also compute plasticity/atom and dilatation/atom.
The
neighbor list you are asking about is stored inside
a hidden fix, called FixPeriNeigh, that all of the PD pair
styles create, it is a one-time neighbor list, created at
the start of a run. I can’t recall the details, but I think
it probably stores flags of which neighbors are still
active as bonds break.
Thanks for this hint and I was able to use the
compute_property_local.class to write the neighbors in a dump file.
int nlocal = atom->nlocal;
int *mask = atom->mask;
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
int i, jj, jnum, j;
int m = 0;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
//nneigh[i] = 0.0;
jnum = npartner[i];
I just solved the problem and now I can write the neighborlist. The
problem was that the Id of the particle in the list for broken bond was
set to 0.
Now I wrote my own peri_style where the id of the particle of a broken
bond is set to the negative id. Thus no information about broken bonds a
lost and we can use it for visualization in computer graphics.