Commit 6fbbb515 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11395 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 1631ff7a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -119,6 +119,17 @@ void FixPeriNeigh::init()
  neighbor->requests[irequest]->half = 0;
  neighbor->requests[irequest]->full = 1;
  neighbor->requests[irequest]->occasional = 1;

  // compute PD scale factor, stored in Atom class, used by DumpCFG

  int nlocal = atom->nlocal;
  double vone = 0.0;
  for (int i = 0; i < nlocal; i++) vone += atom->vfrac[i];
  double vave;
  MPI_Allreduce(&vone,&vave,1,MPI_DOUBLE,MPI_SUM,world);
  if (atom->natoms) vave /= atom->natoms;
  if (vave > 0.0) atom->pdscale = 1.44 / pow(vave,1.0/3.0);
  else atom->pdscale = 1.0;
}

/* ---------------------------------------------------------------------- */
+4 −0
Original line number Diff line number Diff line
@@ -140,6 +140,10 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
  cs_flag = csforce_flag = vforce_flag = ervelforce_flag= etag_flag = 0;
  rho_flag = e_flag = cv_flag = vest_flag = 0;

  // Peridynamic scale factor

  pdscale = 1.0;

  // ntype-length arrays

  mass = NULL;
+4 −0
Original line number Diff line number Diff line
@@ -114,6 +114,10 @@ class Atom : protected Pointers {
  int cs_flag,csforce_flag,vforce_flag,ervelforce_flag,etag_flag;
  int rho_flag,e_flag,cv_flag,vest_flag;

  // Peridynamics scale factor, used by dump cfg

  double pdscale;

  // molecule templates
  // each template can be a set of consecutive molecules
  // each with same ID (stored in molecules)
+10 −16
Original line number Diff line number Diff line
@@ -130,22 +130,16 @@ void DumpCFG::init_style()

void DumpCFG::write_header(bigint n)
{
  // special handling for atom style peri
  //   use average volume of particles to scale particles to mimic C atoms
  //   scale box dimension to sc lattice for C with sigma = 1.44 Angstroms
  // special handling for unwrapped coordinates

  double scale;
  if (atom->peri_flag) {
    int nlocal = atom->nlocal;
    double vone = 0.0;
    for (int i = 0; i < nlocal; i++) vone += atom->vfrac[i];
    double vave;
    MPI_Allreduce(&vone,&vave,1,MPI_DOUBLE,MPI_SUM,world);
    if (atom->natoms) vave /= atom->natoms;
    if (vave > 0.0) scale = 1.44 / pow(vave,1.0/3.0);
  } else if (unwrapflag == 1) scale = UNWRAPEXPAND;
  else scale = 1.0;
  // set scale factor used by AtomEye for CFG viz
  // default = 1.0
  // for peridynamics, set to pre-computed PD scale factor
  //   so PD particles mimic C atoms
  // for unwrapped coords, set to UNWRAPEXPAND (10.0)
  //   so molecules are not split across periodic box boundaries

  double scale = 1.0;
  if (atom->peri_flag) scale = atom->pdscale;
  else if (unwrapflag == 1) scale = UNWRAPEXPAND;

  char str[64];
  sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT);