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

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