diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index 8911e7d0189cc55b85236e1179b213af19ca442d..756907bdb018809ad3587bccb76f0a4ee3f0674d 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -15,6 +15,7 @@ Contributing author: Aidan Thompson (SNL) ------------------------------------------------------------------------- */ +#include "lmptype.h" #include "mpi.h" #include "math.h" #include "stdlib.h" diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index 924c09eaf838e9e8e6947c0d89192e783036b7b7..9a0134d3c803c4a5eccb8e8c88cfc9899db4b795 100755 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -15,6 +15,7 @@ Contributing author: Liang Wan (Chinese Academy of Sciences) ------------------------------------------------------------------------- */ +#include "math.h" #include "stdlib.h" #include "string.h" #include "dump_cfg.h" @@ -186,11 +187,27 @@ 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 + + double scale; + if (atom->style_match("peri")) { + 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 scale = 1.0; + } else scale = 1.0; + if (me == 0 || multiproc) { char str[64]; sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT); fprintf(fp,str,n); - fprintf(fp,"A = 1.0 Angstrom (basic length-scale)\n"); + fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); fprintf(fp,"H0(1,1) = %g A\n",domain->xprd); fprintf(fp,"H0(1,2) = 0 A \n"); fprintf(fp,"H0(1,3) = 0 A \n"); @@ -228,7 +245,11 @@ void DumpCFG::write_data(int n, double *mybuf) { int i,j,m,itype; int tag_i,index; + + double *rmass = atom->rmass; double *mass = atom->mass; + int *type = atom->type; + int nlocal = atom->nlocal; // transfer data from buf to rbuf // if write by proc 0, transfer chunk by chunk @@ -246,7 +267,8 @@ void DumpCFG::write_data(int n, double *mybuf) for (i = 0; i < nchosen; i++) if (rbuf[i][1] == itype) break; if (i < nchosen) { - fprintf(fp,"%g\n",mass[itype]); + if (rmass) fprintf(fp,"%g\n",rmass[i]); + else fprintf(fp,"%g\n",mass[itype]); fprintf(fp,"%s\n",typenames[itype]); for (; i < nchosen; i++) { if (rbuf[i][1] == itype) { diff --git a/src/minimize.cpp b/src/minimize.cpp index 3d308b9de891089b557a32fdfff8b4af843665fe..dcee996dc00d802ba7aa6258e7c42752bb87d742 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -11,6 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include "lmptype.h" #include "stdlib.h" #include "minimize.h" #include "domain.h" diff --git a/src/thermo.cpp b/src/thermo.cpp index 919ca35d2b67f1afd7d45e52cc1deb5e330d7d27..3e642a925e795694e3f73f266bfd7c9df7e21b10 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -11,6 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include "lmptype.h" #include "mpi.h" #include "math.h" #include "stdlib.h"