Peridynamic bondinfo

Hello everyone,

I was wondering if it is possible to extract the Peridynamic bondinfo/broken bond info. Seems like pair/local and dump/local gives the pairwise info but it there any way to extract the bondinfo which are broken during simulation. A hint will be highly appreciated.

Thanks

Best,
Rezwan

That's a good question for Mike. PD bonds are not
"bonds" in the normal LAMMPS sense, so I doubt
that dump local is useful.

Steve

Rezwan,

   As Steve says, the bonds used in the peridynamics module within LAMMPS are not bonds in the normal LAMMPS sense. Right now they are created and stored in the fix_peri_neigh fix, and there is no mechanism to dump them to disk. I've only had a need to dump the peridynamics bonds once in the past, and wrote a quick-n-dirty fix that simply dumps the peridynamics bonds to disk at the end of step. Each processor writes their own bonds, so you'll need to write a postprocessing script to merge these separate bond files together. I've attached some of the contents of the .cpp file below; you can use that to quickly create your own fix to dump the bonds.

   Let me know if you feel adding some functionality like this to the public distribution would be useful. Aside from me, you're the only other person to ask about this, so I've never put this functionality into the public release.

- Mike

FixPeriNeighPrint::FixPeriNeighPrint(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg) {
  // fix ID group-ID fix_peri_neigh_print N file string

  if (narg != 6) error->all(FLERR,"Illegal fix_peri_neigh_print command");
  nevery = atoi(arg[3]);
  if (nevery <= 0) error->all(FLERR,"Illegal fix_peri_neigh_print command");

  MPI_Comm_rank(world,&me);

  fp = NULL;
  char filename[100];
  sprintf(filename,"%s.%i.dat",arg[5],me);
  fp = fopen(filename,"w");
  if (fp == NULL) {
    char str[128];
    sprintf(str,"Cannot open fix print file %s",arg[5]);
    error->one(FLERR,str); // prudenci
  }

  // print file comment line
  if (fp) {
    fprintf(fp,"# fix_peri_neigh_print output for fix %s from proc %i\n",id,me);
    fflush(fp);
  }

}

/* ---------------------------------------------------------------------- */
FixPeriNeighPrint::~FixPeriNeighPrint() {
  if (fp) fclose(fp);
}

/* ---------------------------------------------------------------------- */
int FixPeriNeighPrint::setmask() {
  int mask = 0;
  mask |= END_OF_STEP;
  return mask;
}

/* ---------------------------------------------------------------------- */
void FixPeriNeighPrint::end_of_step() {
  int i,j,jj,jnum;
  int ifix_peri = -1;
  int nlocal = atom->nlocal;
  int *tag = atom->tag;
  if ( fp ) {
    for (i = 0; i < modify->nfix; i++)
      if (strcmp(modify->fix[i]->style,"PERI_NEIGH") == 0) ifix_peri = i;
    int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
    int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
    for (i = 0; i < nlocal; i++) {
      fprintf(fp,"%i: ",tag[i]);
      jnum = npartner[i];
      for (jj = 0; jj < jnum; jj++) {
        if (partner[i][jj] == 0) continue;
        j = atom->map(partner[i][jj]);
        // check if lost a partner without first breaking bond
        if (j < 0) {
          partner[i][jj] = 0;
          continue;
        }
        fprintf(fp,"%i ",tag[j]);
      }
      fprintf(fp,"\n");
      fflush(fp);
    }
  }
  fprintf(fp,"\n\n");
  fflush(fp);
}

Thanks to both of you.

I believe including this type of functionality in LAMMPS to extract local PD bond breakage will be really helpful. From my experience, keeping tracking of bond breakage is important in some PD based multiscale modeling. I hope this will be included in future.

Best,
Rezwan

Mike,

I need to make sure another thing regarding LAMMPS-PD.

If I want to apply some external force “F_external” to a group of PD particles using “fix_addforce” command, I need to use F_external/Volume_of_PD_Particle, right? Because, from the code it looks like the PD force is basically force density.

A clarification will be highly appreciated.

Rezwan

Rezwan,

You are correct. If you use fix_addforce in lammps, this will add to the force density. The equation lammps is solving is (4.2) in http://www.sandia.gov/~mlparks/papers/PDLAMMPS.pdf. Fix_addforce would introduce a body force density b in equation (4.2).

Great.
Thanks

  • Rezwan