git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11395 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-01-30 19:47:17 +00:00
parent 1631ff7a4c
commit 6fbbb51569
4 changed files with 28 additions and 15 deletions

View File

@ -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;
}
/* ---------------------------------------------------------------------- */

View File

@ -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;

View File

@ -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)

View File

@ -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
// 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;
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;
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);