forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11250 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
961be6ee48
commit
bad19033d0
|
@ -205,7 +205,9 @@ void DihedralClass2::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -156,8 +156,9 @@ void ImproperClass2::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -512,7 +512,7 @@ void AtomVecDipole::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -541,7 +541,7 @@ void AtomVecDipole::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -625,7 +625,7 @@ int AtomVecDipole::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -716,7 +716,7 @@ int AtomVecDipole::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -781,10 +781,7 @@ void AtomVecDipole::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -872,9 +869,10 @@ int AtomVecDipole::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecDipole::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
|
||||
fprintf(fp,TAGINT_FORMAT \
|
||||
" %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
|
||||
"%-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],buf[i][3],buf[i][4],
|
||||
buf[i][5],buf[i][6],buf[i][7],buf[i][8],
|
||||
(int) ubuf(buf[i][9]).i,(int) ubuf(buf[i][10]).i,
|
||||
|
|
|
@ -59,7 +59,8 @@ class AtomVecDipole : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
double *q,**mu,**omega,**torque;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
|
|
|
@ -630,12 +630,16 @@ void FixPour::pre_exchange()
|
|||
|
||||
if (ninserted_atoms) {
|
||||
atom->natoms += ninserted_atoms;
|
||||
if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
|
||||
error->all(FLERR,"Too many total atoms");
|
||||
if (mode == MOLECULE) {
|
||||
atom->nbonds += onemol->nbonds * ninserted_mols;
|
||||
atom->nangles += onemol->nangles * ninserted_mols;
|
||||
atom->ndihedrals += onemol->ndihedrals * ninserted_mols;
|
||||
atom->nimpropers += onemol->nimpropers * ninserted_mols;
|
||||
}
|
||||
if (maxtag_all >= MAXTAGINT)
|
||||
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
|
||||
if (atom->map_style) {
|
||||
atom->nghost = 0;
|
||||
atom->map_init();
|
||||
|
@ -661,13 +665,13 @@ void FixPour::pre_exchange()
|
|||
|
||||
void FixPour::find_maxid()
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *molecule = atom->molecule;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int max = 0;
|
||||
tagint max = 0;
|
||||
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
||||
MPI_Allreduce(&max,&maxtag_all,1,MPI_INT,MPI_MAX,world);
|
||||
MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
if (mode == MOLECULE && molecule) {
|
||||
max = 0;
|
||||
|
|
|
@ -62,7 +62,8 @@ class FixPour : public Fix {
|
|||
int *recvcounts,*displs;
|
||||
int nfreq,nfirst,ninserted,nper;
|
||||
double lo_current,hi_current;
|
||||
int maxtag_all,maxmol_all;
|
||||
tagint maxtag_all;
|
||||
int maxmol_all;
|
||||
class RanPark *random,*random2;
|
||||
|
||||
void find_maxid();
|
||||
|
|
|
@ -117,6 +117,7 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -144,8 +145,8 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
|
|||
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -214,8 +215,8 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
|
|||
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -116,6 +116,7 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -144,8 +145,8 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
|
|||
itype = type[i];
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -253,8 +254,8 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
|
|||
if (itype == typeO || jtype == typeO) {
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -499,6 +500,7 @@ void PairLJLongTIP4PLong::compute_inner()
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -526,8 +528,8 @@ void PairLJLongTIP4PLong::compute_inner()
|
|||
itype = type[i];
|
||||
if (itype == typeO && order1) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -594,8 +596,8 @@ void PairLJLongTIP4PLong::compute_inner()
|
|||
if (itype == typeO || jtype == typeO) {
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -749,6 +751,7 @@ void PairLJLongTIP4PLong::compute_middle()
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -777,8 +780,8 @@ void PairLJLongTIP4PLong::compute_middle()
|
|||
itype = type[i];
|
||||
if (itype == typeO && order1) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -849,8 +852,8 @@ void PairLJLongTIP4PLong::compute_middle()
|
|||
if (itype == typeO || jtype == typeO) {
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -1017,6 +1020,7 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -1053,8 +1057,8 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
|
|||
itype = type[i];
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -1174,8 +1178,8 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
|
|||
if (itype == typeO || jtype == typeO) {
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -115,6 +115,7 @@ void PairTIP4PLong::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
@ -141,8 +142,8 @@ void PairTIP4PLong::compute(int eflag, int vflag)
|
|||
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -185,8 +186,8 @@ void PairTIP4PLong::compute(int eflag, int vflag)
|
|||
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -212,7 +212,6 @@ void FixQEQComb::post_force(int vflag)
|
|||
|
||||
double *q = atom->q;
|
||||
int *mask = atom->mask;
|
||||
int *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (comb) {
|
||||
|
|
|
@ -391,7 +391,8 @@ void PairAIREBO::REBO_neigh()
|
|||
|
||||
void PairAIREBO::FREBO(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,m,ii,inum,itype,jtype,itag,jtag;
|
||||
int i,j,k,m,ii,inum,itype,jtype;
|
||||
tagint itag,jtag;
|
||||
double delx,dely,delz,evdwl,fpair,xtmp,ytmp,ztmp;
|
||||
double rsq,rij,wij;
|
||||
double Qij,Aij,alphaij,VR,pre,dVRdi,VA,term,bij,dVAdi,dVA;
|
||||
|
@ -403,7 +404,7 @@ void PairAIREBO::FREBO(int eflag, int vflag)
|
|||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
||||
|
@ -489,9 +490,10 @@ void PairAIREBO::FREBO(int eflag, int vflag)
|
|||
|
||||
void PairAIREBO::FLJ(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,m,ii,jj,kk,mm,inum,jnum,itype,jtype,ktype,mtype,itag,jtag;
|
||||
int i,j,k,m,ii,jj,kk,mm,inum,jnum,itype,jtype,ktype,mtype;
|
||||
int atomi,atomj,atomk,atomm;
|
||||
int testpath,npath,done;
|
||||
tagint itag,jtag;
|
||||
double evdwl,fpair,xtmp,ytmp,ztmp;
|
||||
double rsq,best,wik,wkm,cij,rij,dwij,dwik,dwkj,dwkm,dwmj;
|
||||
double delij[3],rijsq,delik[3],rik,deljk[3];
|
||||
|
@ -520,7 +522,7 @@ void PairAIREBO::FLJ(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
@ -855,7 +857,8 @@ void PairAIREBO::FLJ(int eflag, int vflag)
|
|||
|
||||
void PairAIREBO::TORSION(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,l,ii,inum,itag,jtag;
|
||||
int i,j,k,l,ii,inum;
|
||||
tagint itag,jtag;
|
||||
double evdwl,fpair,xtmp,ytmp,ztmp;
|
||||
double cos321;
|
||||
double w21,dw21,cos234,w34,dw34;
|
||||
|
@ -880,7 +883,7 @@ void PairAIREBO::TORSION(int eflag, int vflag)
|
|||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
|
|
|
@ -274,7 +274,8 @@ void PairBOP::compute(int eflag, int vflag)
|
|||
int ago,delay,every;
|
||||
int i,j,ii,jj,iij;
|
||||
int n,inum,temp_ij,ks;
|
||||
int itype,jtype,i_tag,j_tag;
|
||||
int itype,jtype;
|
||||
tagint i_tag,j_tag;
|
||||
int *ilist,*iilist,*numneigh;
|
||||
int **firstneigh;
|
||||
double dpr1,ps;
|
||||
|
@ -288,7 +289,7 @@ void PairBOP::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
int nlocal = atom->nlocal;
|
||||
int nall = nlocal + atom->nghost;
|
||||
|
@ -846,7 +847,7 @@ void PairBOP::sigmaBo()
|
|||
int n,i,j,k,kp,m,pp,kkp;
|
||||
int iij,ji,ki;
|
||||
int itmp,jtmp,ktmp,ltmp,mtmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int ngi,ngj,ngk,nglkp,ngli,nglj,ngl;
|
||||
int ngji,ngjk,nikj,ngki,ngkj,ngjkp;
|
||||
int ngkpk,ngkpj,ngkkp,nglk;
|
||||
|
@ -890,7 +891,7 @@ void PairBOP::sigmaBo()
|
|||
double ftmp[3];
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
int *type = atom->type;
|
||||
|
||||
|
@ -2401,7 +2402,7 @@ void PairBOP::sigmaBo_noa()
|
|||
int n,i,j,k,kp,m,pp;
|
||||
int iij,ji,ki;
|
||||
int itmp,jtmp,ktmp,ltmp,mtmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int ngi,ngj,ngk,ngli,nglj,ngl;
|
||||
int ngji,ngjk,nikj,ngki,ngkj;
|
||||
int njik,nijk,nikkp,nkp,nijkp;
|
||||
|
@ -2437,7 +2438,7 @@ void PairBOP::sigmaBo_noa()
|
|||
double ftmp[3];
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
int *type = atom->type;
|
||||
|
||||
|
@ -3379,7 +3380,7 @@ void PairBOP::sigmaBo_otf()
|
|||
int nb_t,new_n_tot;
|
||||
int n,i,j,k,kp,m,pp,kpj,kpk,kkp;
|
||||
int itmp,jtmp,ktmp,ltmp,mtmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int kp1,kp2,kp1type;
|
||||
int iij,iik,ijk,ikkp,ji,iikp,ijkp;
|
||||
int nkp;
|
||||
|
@ -3448,7 +3449,7 @@ void PairBOP::sigmaBo_otf()
|
|||
double ftmp[3],xtmp[3];
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
int *type = atom->type;
|
||||
|
||||
|
@ -5303,7 +5304,7 @@ void PairBOP::sigmaBo_noa_otf()
|
|||
int nb_t,new_n_tot;
|
||||
int n,i,j,k,kp,m,pp;
|
||||
int itmp,jtmp,ktmp,ltmp,mtmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int kp1,kp2,kp1type;
|
||||
int iij,iik,ijk,ikkp,ji,iikp,ijkp;
|
||||
int nkp;
|
||||
|
@ -5368,7 +5369,7 @@ void PairBOP::sigmaBo_noa_otf()
|
|||
double ftmp[3],xtmp[3];
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
int *type = atom->type;
|
||||
|
||||
|
@ -6541,7 +6542,7 @@ void PairBOP::PiBo()
|
|||
int i,j,k,kp,m,n,pp,nb_t;
|
||||
int iij,ji,ki;
|
||||
int nsearch,ncmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int njik,ngj,ngk,nglj,ngl,ngi;
|
||||
int nkjkp,nijkp,ngli,nkikp,njikp;
|
||||
int itmp,ltmp,jtmp,ktmp;
|
||||
|
@ -6570,7 +6571,7 @@ void PairBOP::PiBo()
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
||||
nlocal = atom->nlocal;
|
||||
|
@ -7265,7 +7266,7 @@ void PairBOP::PiBo_otf()
|
|||
int i,j,k,kp,m,n,pp,nb_t;
|
||||
int iij,iik,iikp,ji,ki,ijkp,ijk;
|
||||
int nsearch,ncmp;
|
||||
int i_tag,j_tag;
|
||||
tagint i_tag,j_tag;
|
||||
int itmp,ltmp,jtmp,ktmp;
|
||||
int pi_flag,ks;
|
||||
int nlocal;
|
||||
|
@ -7317,7 +7318,7 @@ void PairBOP::PiBo_otf()
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
nlocal = atom->nlocal;
|
||||
numneigh = list->numneigh;
|
||||
|
|
|
@ -125,7 +125,8 @@ PairComb::~PairComb()
|
|||
void PairComb::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,ii,jj,kk,inum,jnum,iparam_i;
|
||||
int itag,jtag,itype,jtype,ktype,iparam_ij,iparam_ijk;
|
||||
int itype,jtype,ktype,iparam_ij,iparam_ijk;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
|
||||
double rsq,rsq1,rsq2;
|
||||
double delr1[3],delr2[3],fi[3],fj[3],fk[3];
|
||||
|
@ -151,7 +152,7 @@ void PairComb::compute(int eflag, int vflag)
|
|||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
double *q = atom->q;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
@ -1630,8 +1631,9 @@ void PairComb::field(Param *param, double rsq, double iq,double jq,
|
|||
|
||||
double PairComb::yasu_char(double *qf_fix, int &igroup)
|
||||
{
|
||||
int i,j,ii,jj,jnum,itag,jtag;
|
||||
int i,j,ii,jj,jnum;
|
||||
int itype,jtype,iparam_i,iparam_ij;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp;
|
||||
double rsq1,delr1[3];
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
|
@ -1643,7 +1645,7 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
|
|||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
int inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
|
|
|
@ -860,12 +860,11 @@ void PairComb3::Short_neigh()
|
|||
int n,nj,*neighptrj,icontrol;
|
||||
int iparam_ij,iparam_ji,iparam_jk,*ilist,*jlist,*numneigh,**firstneigh;
|
||||
int inum,jnum,i,j,k,l,ii,jj,kk,ll,itype,jtype,ktype,ltype;
|
||||
int itag, jtag;
|
||||
tagint itag,jtag;
|
||||
double rr1,rr2,rsq1,rsq2,delrj[3],delrk[3];
|
||||
int sht_knum,*sht_klist;
|
||||
|
||||
double **x = atom->x;
|
||||
int *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int ntype = atom->ntypes;
|
||||
int nlocal = atom->nlocal;
|
||||
|
@ -896,7 +895,6 @@ void PairComb3::Short_neigh()
|
|||
|
||||
for (ii = 0; ii < inum; ii++) {
|
||||
i = ilist[ii];
|
||||
itag = tag[i];
|
||||
dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
|
||||
|
||||
nj = 0;
|
||||
|
@ -913,7 +911,6 @@ void PairComb3::Short_neigh()
|
|||
|
||||
for (jj = 0; jj < jnum; jj++) {
|
||||
j = jlist[jj];
|
||||
jtag = tag[j];
|
||||
|
||||
delrj[0] = x[i][0] - x[j][0];
|
||||
delrj[1] = x[i][1] - x[j][1];
|
||||
|
@ -957,12 +954,13 @@ void PairComb3::Short_neigh()
|
|||
|
||||
void PairComb3::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,ii,k,kk,j,jj,im,inum,jnum,itag,jtag,itype,jtype,ktype;
|
||||
int i,ii,k,kk,j,jj,im,inum,jnum,itype,jtype,ktype;
|
||||
int iparam_i,iparam_ij,iparam_ji;
|
||||
int iparam_ijk,iparam_jik,iparam_ikj,iparam_jli,iparam_jki,iparam_ikl;
|
||||
int sht_jnum,*sht_jlist,sht_lnum,*sht_llist;
|
||||
int sht_mnum,*sht_mlist,sht_pnum,*sht_plist;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh,mr1,mr2,mr3,inty,nj;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
|
||||
double rr,rsq,rsq1,rsq2,rsq3,iq,jq,yaself;
|
||||
double fqi,fqij,eng_tmp,vionij,fvionij,sr1,sr2,sr3;
|
||||
|
@ -975,7 +973,7 @@ void PairComb3::compute(int eflag, int vflag)
|
|||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
int ntype = atom->ntypes;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
|
@ -1833,11 +1831,12 @@ void PairComb3::force_zeta(Param *parami, Param *paramj, double rsq,
|
|||
double boij, dbij1, dbij2, dbij3, dbij4, dbij5;
|
||||
double boji, dbji1, dbji2, dbji3, dbji4, dbji5;
|
||||
double pradx, prady;
|
||||
|
||||
int inti=parami->ielement;
|
||||
int intj=paramj->ielement;
|
||||
int *tag=atom->tag;
|
||||
int itag=tag[i];
|
||||
int jtag=tag[j];
|
||||
tagint *tag=atom->tag;
|
||||
tagint itag=tag[i];
|
||||
tagint jtag=tag[j];
|
||||
r = sqrt(rsq);
|
||||
|
||||
if (r > parami->bigr + parami->bigd) return;
|
||||
|
@ -3348,10 +3347,11 @@ void PairComb3::tor_force(int torindx, Param *paramk, Param *paraml,
|
|||
|
||||
double PairComb3::combqeq(double *qf_fix, int &igroup)
|
||||
{
|
||||
int i,j,ii, jj,itag,jtag,itype,jtype,jnum;
|
||||
int i,j,ii,jj,itype,jtype,jnum;
|
||||
int iparam_i,iparam_ji,iparam_ij;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
int mr1,mr2,mr3,inty,nj;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,rr,rsq,rsq1,rsq2,delrj[3],zeta_ij;
|
||||
double iq,jq,fqi,fqj,fqij,fqji,yaself,yaself_d,sr1,sr2,sr3;
|
||||
double rr_sw,ij_sw,ji_sw,fq_swi,fq_swj;
|
||||
|
@ -3360,7 +3360,7 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
|
|||
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int inum = list->inum;
|
||||
int *mask = atom->mask;
|
||||
|
@ -3507,7 +3507,7 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
|
|||
i = ilist[ii];
|
||||
if (mask[i] & groupbit){
|
||||
eneg += qf[i];
|
||||
itag=tag[i];
|
||||
itag=tag[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,8 @@ void PairLCBOP::SR_neigh()
|
|||
|
||||
void PairLCBOP::FSR(int eflag, int vflag)
|
||||
{
|
||||
int i,j,jj,ii,inum,itag,jtag;
|
||||
int i,j,jj,ii,inum;
|
||||
tagint itag,jtag;
|
||||
double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
|
||||
double r_sq,rijmag,f_c_ij,df_c_ij;
|
||||
double VR,dVRdi,VA,Bij,dVAdi,dVA;
|
||||
|
@ -364,7 +365,7 @@ void PairLCBOP::FSR(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
||||
|
@ -450,19 +451,18 @@ void PairLCBOP::FSR(int eflag, int vflag)
|
|||
|
||||
void PairLCBOP::FLR(int eflag, int vflag)
|
||||
{
|
||||
|
||||
int i,j,jj,m,ii,itag,jtag;
|
||||
int i,j,jj,m,ii;
|
||||
tagint itag,jtag;
|
||||
double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
|
||||
double r_sq,rijmag,f_c_ij,df_c_ij;
|
||||
double V,dVdi;
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
||||
|
||||
int inum = list->inum;
|
||||
int *ilist = list->ilist;
|
||||
int *numneigh = list->numneigh;
|
||||
|
|
|
@ -77,8 +77,9 @@ PairNb3bHarmonic::~PairNb3bHarmonic()
|
|||
|
||||
void PairNb3bHarmonic::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,ii,jj,kk,inum,jnum,jnumm1,itag,jtag;
|
||||
int i,j,k,ii,jj,kk,inum,jnum,jnumm1;
|
||||
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
|
||||
double rsq,rsq1,rsq2;
|
||||
double delr1[3],delr2[3],fj[3],fk[3];
|
||||
|
@ -90,7 +91,7 @@ void PairNb3bHarmonic::compute(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
|
|
@ -75,8 +75,9 @@ PairSW::~PairSW()
|
|||
|
||||
void PairSW::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,ii,jj,kk,inum,jnum,jnumm1,itag,jtag;
|
||||
int i,j,k,ii,jj,kk,inum,jnum,jnumm1;
|
||||
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
|
||||
double rsq,rsq1,rsq2;
|
||||
double delr1[3],delr2[3],fj[3],fk[3];
|
||||
|
@ -88,7 +89,7 @@ void PairSW::compute(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
|
|
@ -77,7 +77,8 @@ PairTersoff::~PairTersoff()
|
|||
void PairTersoff::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,ii,jj,kk,inum,jnum;
|
||||
int itag,jtag,itype,jtype,ktype,iparam_ij,iparam_ijk;
|
||||
int itype,jtype,ktype,iparam_ij,iparam_ijk;
|
||||
tagint itag,jtag;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
|
||||
double rsq,rsq1,rsq2;
|
||||
double delr1[3],delr2[3],fi[3],fj[3],fk[3];
|
||||
|
@ -90,7 +91,7 @@ void PairTersoff::compute(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
|
|
@ -155,7 +155,7 @@ void FixBondBreak::post_integrate()
|
|||
{
|
||||
int i,j,k,m,n,i1,i2,n1,n3,type;
|
||||
double delx,dely,delz,rsq;
|
||||
int *slist;
|
||||
tagint *slist;
|
||||
|
||||
if (update->ntimestep % nevery) return;
|
||||
|
||||
|
@ -188,7 +188,7 @@ void FixBondBreak::post_integrate()
|
|||
// setup possible partner list of bonds to break
|
||||
|
||||
double **x = atom->x;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *mask = atom->mask;
|
||||
int **bondlist = neighbor->bondlist;
|
||||
int nbondlist = neighbor->nbondlist;
|
||||
|
@ -237,10 +237,10 @@ void FixBondBreak::post_integrate()
|
|||
// and probability constraint is satisfied
|
||||
|
||||
int **bond_type = atom->bond_type;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int *num_bond = atom->num_bond;
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
|
||||
int nbreak = 0;
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
|
@ -333,7 +333,7 @@ void FixBondBreak::unpack_comm(int n, int first, double *buf)
|
|||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
partner[i] = static_cast<int> (buf[m++]);
|
||||
partner[i] = static_cast<tagint> (buf[m++]);
|
||||
probability[i] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ void FixBondBreak::unpack_reverse_comm(int n, int *list, double *buf)
|
|||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
if (buf[m+1] > distsq[j]) {
|
||||
partner[j] = static_cast<int> (buf[m++]);
|
||||
partner[j] = static_cast<tagint> (buf[m++]);
|
||||
distsq[j] = buf[m++];
|
||||
} else m += 2;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class FixBondBreak : public Fix {
|
|||
|
||||
int breakcount,breakcounttotal;
|
||||
int nmax;
|
||||
int *partner;
|
||||
tagint *partner;
|
||||
double *distsq,*probability;
|
||||
|
||||
class RanMars *random;
|
||||
|
|
|
@ -235,7 +235,7 @@ void FixBondCreate::setup(int vflag)
|
|||
|
||||
int *num_bond = atom->num_bond;
|
||||
int **bond_type = atom->bond_type;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int nlocal = atom->nlocal;
|
||||
int nghost = atom->nghost;
|
||||
int nall = nlocal + nghost;
|
||||
|
@ -269,7 +269,8 @@ void FixBondCreate::post_integrate()
|
|||
{
|
||||
int i,j,m,ii,jj,inum,jnum,itype,jtype,n1,n3,possible;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh,*slist;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
tagint *slist;
|
||||
|
||||
if (update->ntimestep % nevery) return;
|
||||
|
||||
|
@ -307,7 +308,7 @@ void FixBondCreate::post_integrate()
|
|||
// each atom sets one closest eligible partner atom ID to bond with
|
||||
|
||||
double **x = atom->x;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *mask = atom->mask;
|
||||
int *type = atom->type;
|
||||
|
||||
|
@ -385,10 +386,10 @@ void FixBondCreate::post_integrate()
|
|||
// and probability constraint is satisfied
|
||||
|
||||
int **bond_type = atom->bond_type;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int *num_bond = atom->num_bond;
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
int ncreate = 0;
|
||||
|
@ -506,7 +507,7 @@ void FixBondCreate::unpack_comm(int n, int first, double *buf)
|
|||
|
||||
} else {
|
||||
for (i = first; i < last; i++) {
|
||||
partner[i] = static_cast<int> (buf[m++]);
|
||||
partner[i] = static_cast<tagint> (buf[m++]);
|
||||
probability[i] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
@ -554,7 +555,7 @@ void FixBondCreate::unpack_reverse_comm(int n, int *list, double *buf)
|
|||
j = list[i];
|
||||
if (buf[m] < distsq[j]) {
|
||||
distsq[j] = buf[m++];
|
||||
partner[j] = static_cast<int> (buf[m++]);
|
||||
partner[j] = static_cast<tagint> (buf[m++]);
|
||||
} else m += 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class FixBondCreate : public Fix {
|
|||
|
||||
int nmax;
|
||||
int *bondcount; // count of created bonds this atom is part of
|
||||
int *partner; // ID of preferred atom for this atom to bond to
|
||||
tagint *partner; // ID of preferred atom for this atom to bond to
|
||||
double *distsq; // distance to preferred bond partner
|
||||
double *probability; // random # to use in decision to form bond
|
||||
|
||||
|
|
|
@ -179,9 +179,9 @@ void FixBondSwap::pre_neighbor()
|
|||
{
|
||||
int i,j,ii,jj,m,inum,jnum;
|
||||
int inext,iprev,ilast,jnext,jprev,jlast,ibond,iangle,jbond,jangle;
|
||||
int itag,inexttag,iprevtag,ilasttag,jtag,jnexttag,jprevtag,jlasttag;
|
||||
int ibondtype,jbondtype,iangletype,inextangletype,jangletype,jnextangletype;
|
||||
int i1,i2,i3,j1,j2,j3,tmp;
|
||||
tagint itag,inexttag,iprevtag,ilasttag,jtag,jnexttag,jprevtag,jlasttag;
|
||||
tagint i1,i2,i3,j1,j2,j3;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
double delta,factor;
|
||||
|
||||
|
@ -191,19 +191,19 @@ void FixBondSwap::pre_neighbor()
|
|||
|
||||
// local ptrs to atom arrays
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *mask = atom->mask;
|
||||
int *molecule = atom->molecule;
|
||||
int *num_bond = atom->num_bond;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int **bond_type = atom->bond_type;
|
||||
int *num_angle = atom->num_angle;
|
||||
int **angle_atom1 = atom->angle_atom1;
|
||||
int **angle_atom2 = atom->angle_atom2;
|
||||
int **angle_atom3 = atom->angle_atom3;
|
||||
tagint **angle_atom1 = atom->angle_atom1;
|
||||
tagint **angle_atom2 = atom->angle_atom2;
|
||||
tagint **angle_atom3 = atom->angle_atom3;
|
||||
int **angle_type = atom->angle_type;
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int newton_bond = force->newton_bond;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
|
@ -231,6 +231,7 @@ void FixBondSwap::pre_neighbor()
|
|||
alist[neligible++] = i;
|
||||
}
|
||||
|
||||
int tmp;
|
||||
for (i = 0; i < neligible; i++) {
|
||||
j = static_cast<int> (random->uniform() * neligible);
|
||||
tmp = alist[i];
|
||||
|
|
|
@ -282,9 +282,10 @@ void FixGCMC::init()
|
|||
}
|
||||
|
||||
if ((molflag && (atom->molecule_flag == 0)) ||
|
||||
(molflag && ((!atom->tag_enable) || (!atom->map_style))))
|
||||
(molflag && (!atom->tag_enable || !atom->map_style)))
|
||||
error->all(FLERR,
|
||||
"Fix gcmc molecule command requires that atoms have molecule attributes");
|
||||
"Fix gcmc molecule command requires that "
|
||||
"atoms have molecule attributes");
|
||||
|
||||
if (force->pair->single_enable == 0)
|
||||
error->all(FLERR,"Fix gcmc incompatible with given pair_style");
|
||||
|
@ -805,18 +806,18 @@ void FixGCMC::attempt_molecule_insertion()
|
|||
if (maxmol >= MAXSMALLINT)
|
||||
error->all(FLERR,"Fix gcmc ran out of available molecule IDs");
|
||||
|
||||
int maxtag = 0;
|
||||
tagint maxtag = 0;
|
||||
for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag,atom->tag[i]);
|
||||
int maxtag_all;
|
||||
MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_INT,MPI_MAX,world);
|
||||
int atom_offset = maxtag_all;
|
||||
tagint maxtag_all;
|
||||
MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
tagint atom_offset = maxtag_all;
|
||||
|
||||
int k = 0;
|
||||
double **x = atom->x;
|
||||
double **v = atom->v;
|
||||
imageint *image = atom->image;
|
||||
int *molecule = atom->molecule;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
for (int i = 0; i < natoms_per_molecule; i++) {
|
||||
k += atom->avec->unpack_exchange(&model_atom_buf[k]);
|
||||
if (procflag[i]) {
|
||||
|
@ -1165,9 +1166,9 @@ void FixGCMC::get_model_molecule()
|
|||
x[i][2] -= com[2];
|
||||
}
|
||||
|
||||
int mintag = atom->tag[0];
|
||||
tagint mintag = atom->tag[0];
|
||||
for (int i = 0; i < atom->nlocal; i++) mintag = MIN(mintag,atom->tag[i]);
|
||||
int atom_offset = mintag - 1;
|
||||
tagint atom_offset = mintag - 1;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
atom->mask[i] = 1 | groupbit;
|
||||
|
|
|
@ -488,16 +488,18 @@ void FixDeposit::pre_exchange()
|
|||
|
||||
if (success) {
|
||||
atom->natoms += natom;
|
||||
if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
|
||||
error->all(FLERR,"Too many total atoms");
|
||||
if (mode == MOLECULE) {
|
||||
atom->nbonds += onemol->nbonds;
|
||||
atom->nangles += onemol->nangles;
|
||||
atom->ndihedrals += onemol->ndihedrals;
|
||||
atom->nimpropers += onemol->nimpropers;
|
||||
}
|
||||
if (idnext) {
|
||||
maxtag_all += natom;
|
||||
if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
|
||||
}
|
||||
maxtag_all += natom;
|
||||
if (maxtag_all >= MAXTAGINT)
|
||||
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
|
||||
if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
|
||||
if (atom->map_style) {
|
||||
atom->nghost = 0;
|
||||
atom->map_init();
|
||||
|
@ -520,13 +522,13 @@ void FixDeposit::pre_exchange()
|
|||
|
||||
void FixDeposit::find_maxid()
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *molecule = atom->molecule;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int max = 0;
|
||||
tagint max = 0;
|
||||
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
||||
MPI_Allreduce(&max,&maxtag_all,1,MPI_INT,MPI_MAX,world);
|
||||
MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
if (mode == MOLECULE && molecule) {
|
||||
max = 0;
|
||||
|
|
|
@ -55,7 +55,8 @@ class FixDeposit : public Fix {
|
|||
class Fix *fixrigid,*fixshake;
|
||||
|
||||
int nfirst,ninserted;
|
||||
int maxtag_all,maxmol_all;
|
||||
tagint maxtag_all;
|
||||
int maxmol_all;
|
||||
class RanPark *random;
|
||||
|
||||
void find_maxid();
|
||||
|
|
|
@ -186,7 +186,7 @@ void FixEvaporate::pre_exchange()
|
|||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int ncount = 0;
|
||||
|
|
|
@ -243,7 +243,8 @@ void FixOrientFCC::setup(int vflag)
|
|||
|
||||
void FixOrientFCC::post_force(int vflag)
|
||||
{
|
||||
int i,j,k,ii,jj,inum,jnum,m,n,nn,nsort,id_self;
|
||||
int i,j,k,ii,jj,inum,jnum,m,n,nn,nsort;
|
||||
tagint id_self;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
double edelta,omega;
|
||||
double dx,dy,dz,rsq,xismooth,xi_sq,duxi,duxi_other;
|
||||
|
@ -256,7 +257,7 @@ void FixOrientFCC::post_force(int vflag)
|
|||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *mask = atom->mask;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
int nall = atom->nlocal + atom->nghost;
|
||||
|
||||
|
@ -480,8 +481,10 @@ double FixOrientFCC::compute_scalar()
|
|||
int FixOrientFCC::pack_comm(int n, int *list, double *buf,
|
||||
int pbc_flag, int *pbc)
|
||||
{
|
||||
int i,j,k,id,num;
|
||||
int *tag = atom->tag;
|
||||
int i,j,k,num;
|
||||
tagint id;
|
||||
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
int m = 0;
|
||||
|
||||
|
@ -531,7 +534,7 @@ void FixOrientFCC::unpack_comm(int n, int first, double *buf)
|
|||
nbr[i].dxi[j][0] = buf[m++];
|
||||
nbr[i].dxi[j][1] = buf[m++];
|
||||
nbr[i].dxi[j][2] = buf[m++];
|
||||
nbr[i].id[j] = static_cast<int> (buf[m++]);
|
||||
nbr[i].id[j] = static_cast<tagint> (buf[m++]);
|
||||
}
|
||||
|
||||
m += (12-num) * 3;
|
||||
|
|
|
@ -28,7 +28,7 @@ class FixOrientFCC : public Fix {
|
|||
public:
|
||||
struct Nbr { // neighbor info for each owned and ghost atom
|
||||
int n; // # of closest neighbors (up to 12)
|
||||
int id[12]; // IDs of each neighbor
|
||||
tagint id[12]; // IDs of each neighbor
|
||||
// if center atom is owned, these are local IDs
|
||||
// if center atom is ghost, these are global IDs
|
||||
double xismooth[12]; // distance weighting factor for each neighbors
|
||||
|
@ -37,7 +37,7 @@ class FixOrientFCC : public Fix {
|
|||
};
|
||||
|
||||
struct Sort { // data structure for sorting to find 12 closest
|
||||
int id; // ID of neighbor atom
|
||||
int id; // local ID of neighbor atom
|
||||
double rsq; // distance between center and neighbor atom
|
||||
double delta[3]; // displacement between center and neighbor atom
|
||||
double xismooth; // distance weighting factor
|
||||
|
|
|
@ -475,7 +475,7 @@ void AtomVecAngle::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -500,7 +500,7 @@ void AtomVecAngle::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -594,7 +594,7 @@ int AtomVecAngle::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -604,22 +604,22 @@ int AtomVecAngle::unpack_exchange(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_angle[nlocal]; k++) {
|
||||
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < nspecial[nlocal][2]; k++)
|
||||
special[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
|
||||
if (atom->nextra_grow)
|
||||
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
||||
|
@ -666,28 +666,28 @@ int AtomVecAngle::pack_restart(int i, double *buf)
|
|||
buf[m++] = x[i][0];
|
||||
buf[m++] = x[i][1];
|
||||
buf[m++] = x[i][2];
|
||||
buf[m++] = tag[i];
|
||||
buf[m++] = type[i];
|
||||
buf[m++] = mask[i];
|
||||
*((imageint *) &buf[m++]) = image[i];
|
||||
buf[m++] = ubuf(tag[i]).d;
|
||||
buf[m++] = ubuf(type[i]).d;
|
||||
buf[m++] = ubuf(mask[i]).d;
|
||||
buf[m++] = ubuf(image[i]).d;
|
||||
buf[m++] = v[i][0];
|
||||
buf[m++] = v[i][1];
|
||||
buf[m++] = v[i][2];
|
||||
|
||||
buf[m++] = molecule[i];
|
||||
buf[m++] = ubuf(molecule[i]).d;
|
||||
|
||||
buf[m++] = num_bond[i];
|
||||
buf[m++] = ubuf(num_bond[i]).d;
|
||||
for (k = 0; k < num_bond[i]; k++) {
|
||||
buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
|
||||
buf[m++] = bond_atom[i][k];
|
||||
buf[m++] = ubuf(MAX(bond_type[i][k],-bond_type[i][k])).d;
|
||||
buf[m++] = ubuf(bond_atom[i][k]).d;
|
||||
}
|
||||
|
||||
buf[m++] = num_angle[i];
|
||||
buf[m++] = ubuf(num_angle[i]).d;
|
||||
for (k = 0; k < num_angle[i]; k++) {
|
||||
buf[m++] = MAX(angle_type[i][k],-angle_type[i][k]);
|
||||
buf[m++] = angle_atom1[i][k];
|
||||
buf[m++] = angle_atom2[i][k];
|
||||
buf[m++] = angle_atom3[i][k];
|
||||
buf[m++] = ubuf(MAX(angle_type[i][k],-angle_type[i][k])).d;
|
||||
buf[m++] = ubuf(angle_atom1[i][k]).d;
|
||||
buf[m++] = ubuf(angle_atom2[i][k]).d;
|
||||
buf[m++] = ubuf(angle_atom3[i][k]).d;
|
||||
}
|
||||
|
||||
if (atom->nextra_restart)
|
||||
|
@ -717,7 +717,7 @@ int AtomVecAngle::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -730,15 +730,15 @@ int AtomVecAngle::unpack_restart(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_angle[nlocal]; k++) {
|
||||
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
|
||||
|
@ -793,12 +793,8 @@ void AtomVecAngle::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
molecule[nlocal] = atoi(values[1]);
|
||||
|
||||
type[nlocal] = atoi(values[2]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -871,8 +867,8 @@ int AtomVecAngle::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecAngle::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(int) ubuf(buf[i][2]).i,
|
||||
buf[i][3],buf[i][4],buf[i][5],
|
||||
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
|
||||
|
|
|
@ -58,16 +58,19 @@ class AtomVecAngle : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
protected:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
int *molecule;
|
||||
int **nspecial,**special;
|
||||
int **nspecial;
|
||||
tagint **special;
|
||||
int *num_bond;
|
||||
int **bond_type,**bond_atom;
|
||||
int **bond_type;
|
||||
tagint **bond_atom;
|
||||
int *num_angle;
|
||||
int **angle_type;
|
||||
int **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
tagint **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ void AtomVecBond::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -479,7 +479,7 @@ void AtomVecBond::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -565,7 +565,7 @@ int AtomVecBond::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -575,14 +575,14 @@ int AtomVecBond::unpack_exchange(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < nspecial[nlocal][2]; k++)
|
||||
special[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
|
||||
if (atom->nextra_grow)
|
||||
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
||||
|
@ -672,7 +672,7 @@ int AtomVecBond::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -685,7 +685,7 @@ int AtomVecBond::unpack_restart(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
|
||||
|
@ -739,12 +739,8 @@ void AtomVecBond::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
molecule[nlocal] = atoi(values[1]);
|
||||
|
||||
type[nlocal] = atoi(values[2]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -815,8 +811,8 @@ int AtomVecBond::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecBond::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(int) ubuf(buf[i][2]).i,
|
||||
buf[i][3],buf[i][4],buf[i][5],
|
||||
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
|
||||
|
|
|
@ -57,13 +57,16 @@ class AtomVecBond : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
int *molecule;
|
||||
int **nspecial,**special;
|
||||
int **nspecial;
|
||||
tagint **special;
|
||||
int *num_bond;
|
||||
int **bond_type,**bond_atom;
|
||||
int **bond_type;
|
||||
tagint **bond_atom;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -469,9 +469,9 @@ int AtomVecFull::pack_border_vel(int n, int *list, double *buf,
|
|||
buf[m++] = x[j][0] + dx;
|
||||
buf[m++] = x[j][1] + dy;
|
||||
buf[m++] = x[j][2] + dz;
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = ubuf(tag[j]).d;
|
||||
buf[m++] = ubuf(type[j]).d;
|
||||
buf[m++] = ubuf(mask[j]).d;
|
||||
buf[m++] = q[j];
|
||||
buf[m++] = molecule[j];
|
||||
buf[m++] = v[j][0];
|
||||
|
@ -540,7 +540,7 @@ void AtomVecFull::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -566,7 +566,7 @@ void AtomVecFull::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -682,7 +682,7 @@ int AtomVecFull::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -693,40 +693,40 @@ int AtomVecFull::unpack_exchange(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_angle[nlocal]; k++) {
|
||||
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_dihedral[nlocal]; k++) {
|
||||
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_improper[nlocal]; k++) {
|
||||
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
|
||||
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < nspecial[nlocal][2]; k++)
|
||||
special[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
|
||||
if (atom->nextra_grow)
|
||||
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
||||
|
@ -844,7 +844,7 @@ int AtomVecFull::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -858,33 +858,33 @@ int AtomVecFull::unpack_restart(double *buf)
|
|||
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_bond[nlocal]; k++) {
|
||||
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_angle[nlocal]; k++) {
|
||||
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_dihedral[nlocal]; k++) {
|
||||
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
for (k = 0; k < num_improper[nlocal]; k++) {
|
||||
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
||||
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
|
||||
|
@ -942,12 +942,8 @@ void AtomVecFull::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
molecule[nlocal] = atoi(values[1]);
|
||||
|
||||
type[nlocal] = atoi(values[2]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -1029,8 +1025,9 @@ int AtomVecFull::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecFull::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT
|
||||
" %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(int) ubuf(buf[i][2]).i,
|
||||
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
|
||||
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
|
||||
|
|
|
@ -58,23 +58,26 @@ class AtomVecFull : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
protected:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
double *q;
|
||||
int *molecule;
|
||||
int **nspecial,**special;
|
||||
int **nspecial;
|
||||
tagint **special;
|
||||
int *num_bond;
|
||||
int **bond_type,**bond_atom;
|
||||
int **bond_type;
|
||||
tagint **bond_atom;
|
||||
int *num_angle;
|
||||
int **angle_type;
|
||||
int **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
tagint **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
int *num_dihedral;
|
||||
int **dihedral_type;
|
||||
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
int *num_improper;
|
||||
int **improper_type;
|
||||
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -532,7 +532,7 @@ void AtomVecMolecular::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -557,7 +557,7 @@ void AtomVecMolecular::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
molecule[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -669,7 +669,7 @@ int AtomVecMolecular::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -829,7 +829,7 @@ int AtomVecMolecular::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -920,17 +920,14 @@ void AtomVecMolecular::create_atom(int itype, double *coord)
|
|||
initialize other atom quantities
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecMolecular::data_atom(double *coord, imageint imagetmp, char **values)
|
||||
void AtomVecMolecular::data_atom(double *coord, imageint imagetmp,
|
||||
char **values)
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
molecule[nlocal] = atoi(values[1]);
|
||||
|
||||
type[nlocal] = atoi(values[2]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -1007,8 +1004,8 @@ int AtomVecMolecular::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecMolecular::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(int) ubuf(buf[i][2]).i,
|
||||
buf[i][3],buf[i][4],buf[i][5],
|
||||
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
|
||||
|
|
|
@ -57,22 +57,25 @@ class AtomVecMolecular : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
int *molecule;
|
||||
int **nspecial,**special;
|
||||
int **nspecial;
|
||||
tagint **special;
|
||||
int *num_bond;
|
||||
int **bond_type,**bond_atom;
|
||||
int **bond_type;
|
||||
tagint **bond_atom;
|
||||
int *num_angle;
|
||||
int **angle_type;
|
||||
int **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
tagint **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
int *num_dihedral;
|
||||
int **dihedral_type;
|
||||
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
int *num_improper;
|
||||
int **improper_type;
|
||||
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -85,7 +85,8 @@ void BondFENE::compute(int eflag, int vflag)
|
|||
|
||||
if (rlogarg < 0.1) {
|
||||
char str[128];
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " %g",
|
||||
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
|
||||
error->warning(FLERR,str,0);
|
||||
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
|
||||
|
|
|
@ -90,7 +90,8 @@ void BondFENEExpand::compute(int eflag, int vflag)
|
|||
|
||||
if (rlogarg < 0.1) {
|
||||
char str[128];
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " %g",
|
||||
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
|
||||
error->warning(FLERR,str,0);
|
||||
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
|
||||
|
|
|
@ -150,7 +150,9 @@ void DihedralCharmm::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -137,7 +137,9 @@ void DihedralHarmonic::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -165,7 +165,9 @@ void DihedralHelix::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -155,7 +155,9 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -164,7 +164,9 @@ void DihedralOPLS::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -151,8 +151,9 @@ void ImproperCvff::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -125,8 +125,9 @@ void ImproperHarmonic::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -128,8 +128,9 @@ void ImproperUmbrella::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -84,7 +84,8 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
|
|||
double fi[3],fj[3],delr1[3],delr2[3];
|
||||
double r2inv,r10inv;
|
||||
double switch1,switch2;
|
||||
int *ilist,*jlist,*klist,*numneigh,**firstneigh;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
tagint *klist;
|
||||
|
||||
evdwl = ehbond = 0.0;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
|
@ -92,7 +93,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int *type = atom->type;
|
||||
int **nspecial = atom->nspecial;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -457,10 +458,10 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
|
|||
double rsq1,rsq2,r1,r2,c,s,ac,r2inv,r10inv,factor_hb;
|
||||
double switch1,switch2;
|
||||
double delr1[3],delr2[3];
|
||||
int *klist;
|
||||
tagint *klist;
|
||||
|
||||
double **x = atom->x;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int *type = atom->type;
|
||||
int **nspecial = atom->nspecial;
|
||||
double *special_lj = force->special_lj;
|
||||
|
|
|
@ -54,7 +54,8 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
|
|||
double c,s,a,b,d,ac,a11,a12,a22,vx1,vx2,vy1,vy2,vz1,vz2;
|
||||
double fi[3],fj[3],delr1[3],delr2[3];
|
||||
double r,dr,dexp,eng_morse,switch1,switch2;
|
||||
int *ilist,*jlist,*klist,*numneigh,**firstneigh;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
tagint *klist;
|
||||
|
||||
evdwl = ehbond = 0.0;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
|
@ -62,7 +63,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
|
|||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int *type = atom->type;
|
||||
int **nspecial = atom->nspecial;
|
||||
double *special_lj = force->special_lj;
|
||||
|
@ -360,10 +361,10 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype,
|
|||
double rsq1,rsq2,r1,r2,c,s,ac,r,dr,dexp,factor_hb;
|
||||
double switch1,switch2;
|
||||
double delr1[3],delr2[3];
|
||||
int *klist;
|
||||
tagint *klist;
|
||||
|
||||
double **x = atom->x;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int *type = atom->type;
|
||||
int **nspecial = atom->nspecial;
|
||||
double *special_lj = force->special_lj;
|
||||
|
|
|
@ -114,6 +114,7 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_lj = force->special_lj;
|
||||
double *special_coul = force->special_coul;
|
||||
|
@ -137,8 +138,8 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
|
|||
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -207,8 +208,8 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
|
|||
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -103,6 +103,7 @@ void PairTIP4PCut::compute(int eflag, int vflag)
|
|||
double **f = atom->f;
|
||||
double **x = atom->x;
|
||||
double *q = atom->q;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
double *special_coul = force->special_coul;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
@ -125,8 +126,8 @@ void PairTIP4PCut::compute(int eflag, int vflag)
|
|||
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -169,8 +170,8 @@ void PairTIP4PCut::compute(int eflag, int vflag)
|
|||
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -125,6 +125,7 @@ void PairLJCutTIP4PLongOpt::eval()
|
|||
const double * const * const x = atom->x;
|
||||
double * const * const f = atom->f;
|
||||
const double * const q = atom->q;
|
||||
const tagint * const tag = atom->tag;
|
||||
const int * const type = atom->type;
|
||||
const int nlocal = atom->nlocal;
|
||||
const double * const special_coul = force->special_coul;
|
||||
|
@ -154,8 +155,8 @@ void PairLJCutTIP4PLongOpt::eval()
|
|||
|
||||
if (itype == typeO) {
|
||||
if (hneigh[i][0] < 0) {
|
||||
hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
|
||||
hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
|
||||
hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
|
||||
hneigh[i][2] = 1;
|
||||
if (iH1 == -1 || iH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
@ -225,8 +226,8 @@ void PairLJCutTIP4PLongOpt::eval()
|
|||
|
||||
if (jtype == typeO) {
|
||||
if (hneigh[j][0] < 0) {
|
||||
hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
|
||||
hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
|
||||
hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
|
||||
hneigh[j][2] = 1;
|
||||
if (jH1 == -1 || jH2 == -1)
|
||||
error->one(FLERR,"TIP4P hydrogen is missing");
|
||||
|
|
|
@ -517,7 +517,7 @@ void AtomVecPeri::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
vfrac[i] = buf[m++];
|
||||
|
@ -546,7 +546,7 @@ void AtomVecPeri::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
vfrac[i] = buf[m++];
|
||||
|
@ -631,7 +631,7 @@ int AtomVecPeri::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -725,7 +725,7 @@ int AtomVecPeri::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -792,10 +792,7 @@ void AtomVecPeri::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -881,8 +878,9 @@ int AtomVecPeri::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecPeri::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT
|
||||
" %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],buf[i][3],buf[i][4],buf[i][5],buf[i][6],
|
||||
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
|
||||
(int) ubuf(buf[i][9]).i);
|
||||
|
|
|
@ -59,7 +59,8 @@ class AtomVecPeri : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
double *vfrac,*density,*rmass,*s0,**x0;
|
||||
|
|
|
@ -90,7 +90,7 @@ void ComputeDamageAtom::compute_peratom()
|
|||
int *mask = atom->mask;
|
||||
double *vfrac = atom->vfrac;
|
||||
double *vinter = ((FixPeriNeigh *) modify->fix[ifix_peri])->vinter;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
int i,j,jj,jnum;
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ void FixPeriNeigh::setup(int vflag)
|
|||
double **x = atom->x;
|
||||
double *vfrac = atom->vfrac;
|
||||
int *type = atom->type;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
// only build list of bonds on very first run
|
||||
|
@ -450,7 +450,7 @@ int FixPeriNeigh::unpack_exchange(int nlocal, double *buf)
|
|||
int m = 0;
|
||||
npartner[nlocal] = static_cast<int> (buf[m++]);
|
||||
for (int n = 0; n < npartner[nlocal]; n++) {
|
||||
partner[nlocal][n] = static_cast<int> (buf[m++]);
|
||||
partner[nlocal][n] = static_cast<tagint> (buf[m++]);
|
||||
if (isVES) {
|
||||
deviatorextention[nlocal][n] = buf[m++];
|
||||
deviatorBackextention[nlocal][n] = buf[m++];
|
||||
|
@ -565,7 +565,7 @@ void FixPeriNeigh::unpack_restart(int nlocal, int nth)
|
|||
|
||||
npartner[nlocal] = static_cast<int> (extra[nlocal][m++]);
|
||||
for (int n = 0; n < npartner[nlocal]; n++) {
|
||||
partner[nlocal][n] = static_cast<int> (extra[nlocal][m++]);
|
||||
partner[nlocal][n] = static_cast<tagint> (extra[nlocal][m++]);
|
||||
if (isVES) {
|
||||
deviatorextention[nlocal][n] = extra[nlocal][m++];
|
||||
deviatorBackextention[nlocal][n] = extra[nlocal][m++];
|
||||
|
|
|
@ -60,7 +60,7 @@ class FixPeriNeigh : public Fix {
|
|||
int first; // flag for first time initialization
|
||||
int maxpartner; // max # of peridynamic neighs for any atom
|
||||
int *npartner; // # of neighbors for each atom
|
||||
int **partner; // neighs for each atom, stored as global IDs
|
||||
tagint **partner; // neighs for each atom, stored as global IDs
|
||||
double **deviatorextention; // Deviatoric extention
|
||||
double **deviatorBackextention; // Deviatoric back extention
|
||||
double **r0; // initial distance to partners
|
||||
|
|
|
@ -104,7 +104,7 @@ void PairPeriLPS::compute(int eflag, int vflag)
|
|||
double *s0 = atom->s0;
|
||||
double **x0 = atom->x0;
|
||||
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
|
||||
|
||||
|
@ -550,7 +550,7 @@ void PairPeriLPS::compute_dilatation()
|
|||
double half_lc = 0.5*lc;
|
||||
|
||||
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
|
|||
double *s0 = atom->s0;
|
||||
double **x0 = atom->x0;
|
||||
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
|
||||
// lc = lattice constant
|
||||
|
@ -450,7 +450,7 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
|
|||
double *vfrac = atom->vfrac;
|
||||
double **x0 = atom->x0;
|
||||
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
|
||||
double lc = domain->lattice->xlattice;
|
||||
|
|
|
@ -115,7 +115,7 @@ void PairPeriVES::compute(int eflag, int vflag)
|
|||
((FixPeriNeigh *) modify->fix[ifix_peri])->deviatorextention;
|
||||
double **deviatorBackextention =
|
||||
((FixPeriNeigh *) modify->fix[ifix_peri])->deviatorBackextention;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
|
||||
|
||||
|
@ -621,7 +621,7 @@ void PairPeriVES::compute_dilatation()
|
|||
double half_lc = 0.5*lc;
|
||||
|
||||
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
|
||||
int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
|
||||
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
|
||||
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
|
||||
|
||||
|
|
|
@ -335,8 +335,8 @@ void NEB::run()
|
|||
|
||||
void NEB::readfile(char *file, int flag)
|
||||
{
|
||||
int i,j,m,nchunk,tag,eofflag;
|
||||
int nlines;
|
||||
int i,j,m,nchunk,eofflag,nlines;
|
||||
tagint tag;
|
||||
char *eof,*start,*next,*buf;
|
||||
char line[MAXLINE];
|
||||
double xx,yy,zz,delx,dely,delz;
|
||||
|
@ -430,7 +430,7 @@ void NEB::readfile(char *file, int flag)
|
|||
// will be remapped back into box when simulation starts
|
||||
// its image flags will then be adjusted
|
||||
|
||||
tag = atoi(values[0]);
|
||||
tag = ATOTAGINT(values[0]);
|
||||
m = atom->map(tag);
|
||||
if (m >= 0 && m < nlocal) {
|
||||
ncount++;
|
||||
|
|
|
@ -737,8 +737,8 @@ void PRD::replicate(int ireplica)
|
|||
displacements[0] = 0;
|
||||
for (i = 0; i < nprocs-1; i++)
|
||||
displacements[i+1] = displacements[i] + counts[i];
|
||||
MPI_Gatherv(atom->tag,atom->nlocal,MPI_INT,
|
||||
tagall,counts,displacements,MPI_INT,0,world);
|
||||
MPI_Gatherv(atom->tag,atom->nlocal,MPI_LMP_TAGINT,
|
||||
tagall,counts,displacements,MPI_LMP_TAGINT,0,world);
|
||||
MPI_Gatherv(atom->image,atom->nlocal,MPI_INT,
|
||||
imageall,counts,displacements,MPI_INT,0,world);
|
||||
for (i = 0; i < nprocs; i++) counts[i] *= 3;
|
||||
|
|
|
@ -46,7 +46,8 @@ class PRD : protected Pointers {
|
|||
double time_start;
|
||||
|
||||
MPI_Comm comm_replica;
|
||||
int *tagall,*displacements,*imageall;
|
||||
tagint *tagall;
|
||||
int *displacements,*imageall;
|
||||
double **xall;
|
||||
|
||||
int ncoincident;
|
||||
|
|
|
@ -471,7 +471,8 @@ void VerletSplit::rk_setup()
|
|||
if (tip4p_flag) {
|
||||
//r2k_comm();
|
||||
MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block);
|
||||
MPI_Gatherv(atom->tag,n,MPI_INT,atom->tag,qsize,qdisp,MPI_INT,0,block);
|
||||
MPI_Gatherv(atom->tag,n,MPI_LMP_TAGINT,
|
||||
atom->tag,qsize,qdisp,MPI_LMP_TAGINT,0,block);
|
||||
if (!master) {
|
||||
if (triclinic) domain->x2lamda(atom->nlocal);
|
||||
if (domain->box_change) comm->setup();
|
||||
|
|
|
@ -182,7 +182,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// set nlocal_body and allocate bodies I own
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
nlocal_body = nghost_body = 0;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
|
@ -1350,14 +1350,14 @@ void FixRigidSmall::create_bodies()
|
|||
|
||||
// pack my atoms into buffer as molecule ID, atom ID, unwrapped coords
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
if (!(mask[i] & groupbit)) continue;
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
buf[m++] = molecule[i];
|
||||
buf[m++] = tag[i];
|
||||
buf[m++] = ubuf(tag[i]).d;
|
||||
buf[m++] = unwrap[0];
|
||||
buf[m++] = unwrap[1];
|
||||
buf[m++] = unwrap[2];
|
||||
|
@ -1388,7 +1388,7 @@ void FixRigidSmall::create_bodies()
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (!(mask[i] & groupbit)) continue;
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
buf[m++] = bodytag[i];
|
||||
buf[m++] = ubuf(bodytag[i]).i;
|
||||
buf[m++] = unwrap[0];
|
||||
buf[m++] = unwrap[1];
|
||||
buf[m++] = unwrap[2];
|
||||
|
@ -1460,13 +1460,14 @@ void FixRigidSmall::ring_nearest(int n, char *cbuf)
|
|||
{
|
||||
std::map<int,int> *hash = frsptr->hash;
|
||||
double **ctr = frsptr->ctr;
|
||||
int *idclose = frsptr->idclose;
|
||||
tagint *idclose = frsptr->idclose;
|
||||
double *rsqclose = frsptr->rsqclose;
|
||||
|
||||
double *buf = (double *) cbuf;
|
||||
int ndatums = n/5;
|
||||
|
||||
int j,imol,tag;
|
||||
int j,imol;
|
||||
tagint tag;
|
||||
double delx,dely,delz,rsq;
|
||||
double *x;
|
||||
|
||||
|
@ -1475,7 +1476,7 @@ void FixRigidSmall::ring_nearest(int n, char *cbuf)
|
|||
imol = static_cast<int> (buf[m]);
|
||||
if (hash->find(imol) != hash->end()) {
|
||||
j = hash->find(imol)->second;
|
||||
tag = static_cast<int> (buf[m+1]);
|
||||
tag = (tagint) ubuf(buf[m+1]).i;
|
||||
x = &buf[m+2];
|
||||
delx = x[0] - ctr[j][0];
|
||||
dely = x[1] - ctr[j][1];
|
||||
|
@ -1504,15 +1505,16 @@ void FixRigidSmall::ring_farthest(int n, char *cbuf)
|
|||
double *buf = (double *) cbuf;
|
||||
int ndatums = n/4;
|
||||
|
||||
int itag,iowner;
|
||||
int iowner;
|
||||
tagint tag;
|
||||
double delx,dely,delz,rsq;
|
||||
double *xx;
|
||||
double unwrap[3];
|
||||
|
||||
int m = 0;
|
||||
for (int i = 0; i < ndatums; i++, m += 4) {
|
||||
itag = static_cast<int> (buf[m]);
|
||||
iowner = frsptr->atom->map(itag);
|
||||
tag = (tagint) ubuf(buf[m]).i;
|
||||
iowner = frsptr->atom->map(tag);
|
||||
if (iowner < 0 || iowner >= nlocal) continue;
|
||||
frsptr->domain->unmap(x[iowner],image[iowner],unwrap);
|
||||
xx = &buf[m+1];
|
||||
|
@ -2439,7 +2441,7 @@ void FixRigidSmall::set_arrays(int i)
|
|||
relative to template in Molecule class
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
|
||||
void FixRigidSmall::set_molecule(int nlocalprev, tagint tagprev,
|
||||
double *xgeom, double *vcm, double *quat)
|
||||
{
|
||||
int m;
|
||||
|
@ -2450,7 +2452,7 @@ void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
|
|||
if (nlocalprev == nlocal) return;
|
||||
|
||||
double **x = atom->x;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
for (int i = nlocalprev; i < nlocal; i++) {
|
||||
bodytag[i] = tagprev + onemol->comatom;
|
||||
|
@ -2510,7 +2512,7 @@ void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
|
|||
|
||||
int FixRigidSmall::pack_exchange(int i, double *buf)
|
||||
{
|
||||
buf[0] = bodytag[i];
|
||||
buf[0] = ubuf(bodytag[i]).d;
|
||||
buf[1] = displace[i][0];
|
||||
buf[2] = displace[i][1];
|
||||
buf[3] = displace[i][2];
|
||||
|
@ -2554,7 +2556,7 @@ int FixRigidSmall::pack_exchange(int i, double *buf)
|
|||
|
||||
int FixRigidSmall::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
bodytag[nlocal] = static_cast<int> (buf[0]);
|
||||
bodytag[nlocal] = (tagint) ubuf(buf[0]).i;
|
||||
displace[nlocal][0] = buf[1];
|
||||
displace[nlocal][1] = buf[2];
|
||||
displace[nlocal][2] = buf[3];
|
||||
|
@ -2839,7 +2841,6 @@ void FixRigidSmall::unpack_reverse_comm(int n, int *list, double *buf)
|
|||
int i,j,k;
|
||||
double *fcm,*torque,*vcm,*angmom,*xcm;
|
||||
|
||||
int *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int m = 0;
|
||||
|
@ -2940,8 +2941,8 @@ void FixRigidSmall::reset_atom2body()
|
|||
if (iowner == -1) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Rigid body atoms %d %d missing on proc %d at step "
|
||||
BIGINT_FORMAT,
|
||||
"Rigid body atoms " TAGINT_FORMAT " " TAGINT_FORMAT
|
||||
" missing on proc %d at step " BIGINT_FORMAT,
|
||||
atom->tag[i],bodytag[i],comm->me,update->ntimestep);
|
||||
error->one(FLERR,str);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ class FixRigidSmall : public Fix {
|
|||
void grow_arrays(int);
|
||||
void copy_arrays(int, int, int);
|
||||
void set_arrays(int);
|
||||
void set_molecule(int, int, double *, double *, double *);
|
||||
void set_molecule(int, tagint, double *, double *, double *);
|
||||
|
||||
int pack_exchange(int, double *);
|
||||
int unpack_exchange(int, double *);
|
||||
|
@ -112,7 +112,7 @@ class FixRigidSmall : public Fix {
|
|||
// only defined for owned atoms, except bodyown for own+ghost
|
||||
|
||||
int *bodyown; // index of body if atom owns a body, -1 if not
|
||||
int *bodytag; // ID of body this atom is in, 0 if none
|
||||
tagint *bodytag; // ID of body this atom is in, 0 if none
|
||||
// ID = tag of atom that owns body
|
||||
int *atom2body; // index of owned/ghost body this atom is in, -1 if not
|
||||
// can point to original or any image of the body
|
||||
|
@ -160,7 +160,7 @@ class FixRigidSmall : public Fix {
|
|||
std::map<int,int> *hash;
|
||||
double **bbox;
|
||||
double **ctr;
|
||||
int *idclose;
|
||||
tagint *idclose;
|
||||
double *rsqclose;
|
||||
double rsqfar;
|
||||
|
||||
|
|
|
@ -66,7 +66,8 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
|
|||
// register with Atom class
|
||||
|
||||
shake_flag = NULL;
|
||||
shake_atom = shake_type = NULL;
|
||||
shake_atom = NULL;
|
||||
shake_type = NULL;
|
||||
xshake = NULL;
|
||||
|
||||
grow_arrays(atom->nmax);
|
||||
|
@ -493,8 +494,8 @@ void FixShake::pre_neighbor()
|
|||
atom2 = atom->map(shake_atom[i][1]);
|
||||
if (atom1 == -1 || atom2 == -1) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
|
||||
sprintf(str,"Shake atoms " TAGINT_FORMAT " " TAGINT_FORMAT
|
||||
" missing on proc %d at step " BIGINT_FORMAT,
|
||||
shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
|
@ -505,9 +506,9 @@ void FixShake::pre_neighbor()
|
|||
atom3 = atom->map(shake_atom[i][2]);
|
||||
if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Shake atoms %d %d %d missing on proc %d at step "
|
||||
BIGINT_FORMAT,
|
||||
sprintf(str,"Shake atoms "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
|
||||
" missing on proc %d at step " BIGINT_FORMAT,
|
||||
shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
|
||||
me,update->ntimestep);
|
||||
error->one(FLERR,str);
|
||||
|
@ -520,9 +521,10 @@ void FixShake::pre_neighbor()
|
|||
atom4 = atom->map(shake_atom[i][3]);
|
||||
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Shake atoms %d %d %d %d missing on proc %d at step "
|
||||
BIGINT_FORMAT,
|
||||
sprintf(str,"Shake atoms "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT
|
||||
" missing on proc %d at step " BIGINT_FORMAT,
|
||||
shake_atom[i][0],shake_atom[i][1],
|
||||
shake_atom[i][2],shake_atom[i][3],
|
||||
me,update->ntimestep);
|
||||
|
@ -618,7 +620,7 @@ int FixShake::dof(int igroup)
|
|||
int groupbit = group->bitmask[igroup];
|
||||
|
||||
int *mask = atom->mask;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
// count dof in a cluster if and only if
|
||||
|
@ -653,7 +655,7 @@ void FixShake::find_clusters()
|
|||
int i,j,m,n;
|
||||
int flag,flag_all,messtag,loop,nbuf,nbufmax,size;
|
||||
double massone;
|
||||
int *buf,*bufcopy;
|
||||
tagint *buf;
|
||||
MPI_Request request;
|
||||
MPI_Status status;
|
||||
|
||||
|
@ -661,7 +663,7 @@ void FixShake::find_clusters()
|
|||
|
||||
// local copies of atom ptrs
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
int *mask = atom->mask;
|
||||
double *mass = atom->mass;
|
||||
|
@ -669,7 +671,7 @@ void FixShake::find_clusters()
|
|||
int **bond_type = atom->bond_type;
|
||||
int **angle_type = atom->angle_type;
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int angles_allow = atom->avec->angles_allow;
|
||||
|
@ -702,8 +704,9 @@ void FixShake::find_clusters()
|
|||
memory->create(npartner,nlocal,"shake:npartner");
|
||||
memory->create(nshake,nlocal,"shake:nshake");
|
||||
|
||||
int **partner_tag,**partner_mask,**partner_type,**partner_massflag;
|
||||
int ** partner_bondtype,**partner_shake,**partner_nshake;
|
||||
tagint **partner_tag;
|
||||
int **partner_mask,**partner_type,**partner_massflag;
|
||||
int **partner_bondtype,**partner_shake,**partner_nshake;
|
||||
memory->create(partner_tag,nlocal,max,"shake:partner_tag");
|
||||
memory->create(partner_mask,nlocal,max,"shake:partner_mask");
|
||||
memory->create(partner_type,nlocal,max,"shake:partner_type");
|
||||
|
@ -718,7 +721,8 @@ void FixShake::find_clusters()
|
|||
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
npartner[i] = nspecial[i][0];
|
||||
for (j = 0; j < npartner[i]; j++) partner_tag[i][j] = special[i][j];
|
||||
for (j = 0; j < npartner[i]; j++)
|
||||
partner_tag[i][j] = special[i][j];
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
|
@ -786,7 +790,7 @@ void FixShake::find_clusters()
|
|||
// cycle buffer around ring of procs back to self
|
||||
|
||||
fsptr = this;
|
||||
comm->ring(size,sizeof(int),buf,1,ring_bonds,buf);
|
||||
comm->ring(size,sizeof(tagint),buf,1,ring_bonds,buf);
|
||||
|
||||
// store partner info returned to me
|
||||
|
||||
|
@ -912,7 +916,7 @@ void FixShake::find_clusters()
|
|||
// cycle buffer around ring of procs back to self
|
||||
|
||||
fsptr = this;
|
||||
comm->ring(size,sizeof(int),buf,2,ring_nshake,buf);
|
||||
comm->ring(size,sizeof(tagint),buf,2,ring_nshake,buf);
|
||||
|
||||
// store partner info returned to me
|
||||
|
||||
|
@ -1066,7 +1070,7 @@ void FixShake::find_clusters()
|
|||
// cycle buffer around ring of procs back to self
|
||||
|
||||
fsptr = this;
|
||||
comm->ring(size,sizeof(int),buf,3,ring_shake,NULL);
|
||||
comm->ring(size,sizeof(tagint),buf,3,ring_shake,NULL);
|
||||
|
||||
memory->destroy(buf);
|
||||
|
||||
|
@ -1173,7 +1177,7 @@ void FixShake::ring_bonds(int ndatum, char *cbuf)
|
|||
int nlocal = atom->nlocal;
|
||||
int nmass = fsptr->nmass;
|
||||
|
||||
int *buf = (int *) cbuf;
|
||||
tagint *buf = (tagint *) cbuf;
|
||||
int m,n;
|
||||
double massone;
|
||||
|
||||
|
@ -1207,7 +1211,7 @@ void FixShake::ring_nshake(int ndatum, char *cbuf)
|
|||
|
||||
int *nshake = fsptr->nshake;
|
||||
|
||||
int *buf = (int *) cbuf;
|
||||
tagint *buf = (tagint *) cbuf;
|
||||
int m;
|
||||
|
||||
for (int i = 0; i < ndatum; i += 3) {
|
||||
|
@ -1227,10 +1231,10 @@ void FixShake::ring_shake(int ndatum, char *cbuf)
|
|||
int nlocal = atom->nlocal;
|
||||
|
||||
int *shake_flag = fsptr->shake_flag;
|
||||
int **shake_atom = fsptr->shake_atom;
|
||||
tagint **shake_atom = fsptr->shake_atom;
|
||||
int **shake_type = fsptr->shake_type;
|
||||
|
||||
int *buf = (int *) cbuf;
|
||||
tagint *buf = (tagint *) cbuf;
|
||||
int m;
|
||||
|
||||
for (int i = 0; i < ndatum; i += 9) {
|
||||
|
@ -2234,10 +2238,10 @@ void FixShake::stats()
|
|||
return bond index if do find it
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShake::bondfind(int i, int n1, int n2)
|
||||
int FixShake::bondfind(int i, tagint n1, tagint n2)
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint *tag = atom->tag;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int nbonds = atom->num_bond[i];
|
||||
|
||||
int m;
|
||||
|
@ -2255,10 +2259,10 @@ int FixShake::bondfind(int i, int n1, int n2)
|
|||
return angle index if do find it
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShake::anglefind(int i, int n1, int n2)
|
||||
int FixShake::anglefind(int i, tagint n1, tagint n2)
|
||||
{
|
||||
int **angle_atom1 = atom->angle_atom1;
|
||||
int **angle_atom3 = atom->angle_atom3;
|
||||
tagint **angle_atom1 = atom->angle_atom1;
|
||||
tagint **angle_atom3 = atom->angle_atom3;
|
||||
int nangles = atom->num_angle[i];
|
||||
|
||||
int m;
|
||||
|
@ -2379,7 +2383,7 @@ void FixShake::update_arrays(int i, int atom_offset)
|
|||
xgeom,vcm,quat ignored
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixShake::set_molecule(int nlocalprev, int tagprev,
|
||||
void FixShake::set_molecule(int nlocalprev, tagint tagprev,
|
||||
double *xgeom, double *vcm, double *quat)
|
||||
{
|
||||
int m,flag;
|
||||
|
@ -2387,7 +2391,7 @@ void FixShake::set_molecule(int nlocalprev, int tagprev,
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocalprev == nlocal) return;
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int **mol_shake_atom = onemol->shake_atom;
|
||||
int **mol_shake_type = onemol->shake_type;
|
||||
|
||||
|
@ -2472,27 +2476,27 @@ int FixShake::unpack_exchange(int nlocal, double *buf)
|
|||
int m = 0;
|
||||
int flag = shake_flag[nlocal] = static_cast<int> (buf[m++]);
|
||||
if (flag == 1) {
|
||||
shake_atom[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][0] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<tagint> (buf[m++]);
|
||||
shake_type[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_type[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_type[nlocal][2] = static_cast<int> (buf[m++]);
|
||||
} else if (flag == 2) {
|
||||
shake_atom[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][0] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<tagint> (buf[m++]);
|
||||
shake_type[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
} else if (flag == 3) {
|
||||
shake_atom[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][0] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<tagint> (buf[m++]);
|
||||
shake_type[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_type[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
} else if (flag == 4) {
|
||||
shake_atom[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][3] = static_cast<int> (buf[m++]);
|
||||
shake_atom[nlocal][0] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][1] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][2] = static_cast<tagint> (buf[m++]);
|
||||
shake_atom[nlocal][3] = static_cast<tagint> (buf[m++]);
|
||||
shake_type[nlocal][0] = static_cast<int> (buf[m++]);
|
||||
shake_type[nlocal][1] = static_cast<int> (buf[m++]);
|
||||
shake_type[nlocal][2] = static_cast<int> (buf[m++]);
|
||||
|
|
|
@ -40,7 +40,7 @@ class FixShake : public Fix {
|
|||
void copy_arrays(int, int, int);
|
||||
void set_arrays(int);
|
||||
void update_arrays(int, int);
|
||||
void set_molecule(int, int, double *, double *, double *);
|
||||
void set_molecule(int, tagint, double *, double *, double *);
|
||||
|
||||
int pack_exchange(int, double *);
|
||||
int unpack_exchange(int, double *);
|
||||
|
@ -79,7 +79,7 @@ class FixShake : public Fix {
|
|||
int *shake_flag; // 0 if atom not in SHAKE cluster
|
||||
// 1 = size 3 angle cluster
|
||||
// 2,3,4 = size of bond-only cluster
|
||||
int **shake_atom; // global IDs of atoms in cluster
|
||||
tagint **shake_atom; // global IDs of atoms in cluster
|
||||
// central atom is 1st
|
||||
// lowest global ID is 1st for size 2
|
||||
int **shake_type; // bondtype of each bond in cluster
|
||||
|
@ -115,8 +115,8 @@ class FixShake : public Fix {
|
|||
void shake4(int);
|
||||
void shake3angle(int);
|
||||
void stats();
|
||||
int bondfind(int, int, int);
|
||||
int anglefind(int, int, int);
|
||||
int bondfind(int, tagint, tagint);
|
||||
int anglefind(int, tagint, tagint);
|
||||
|
||||
// static variable for ring communication callback to access class data
|
||||
// callback functions for ring communication
|
||||
|
|
|
@ -495,14 +495,14 @@ void FixAppendAtoms::pre_exchange()
|
|||
|
||||
if (addtotal) {
|
||||
domain->reset_box();
|
||||
if (atom->tag_enable) {
|
||||
atom->tag_extend();
|
||||
atom->natoms += addtotal;
|
||||
if (atom->map_style) {
|
||||
atom->nghost = 0;
|
||||
atom->map_init();
|
||||
atom->map_set();
|
||||
}
|
||||
atom->natoms += addtotal;
|
||||
if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
|
||||
error->all(FLERR,"Too many total atoms");
|
||||
if (atom->tag_enable) atom->tag_extend();
|
||||
if (atom->map_style) {
|
||||
atom->nghost = 0;
|
||||
atom->map_init();
|
||||
atom->map_set();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,10 +572,12 @@ void FixSRD::pre_neighbor()
|
|||
|
||||
if (jx < 0 || jx >= nbin2x || jy < 0 || jy >= nbin2y ||
|
||||
jz < 0 || jz >= nbin2z) {
|
||||
printf("Big particle %d %d %g %g %g\n",
|
||||
atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
|
||||
printf("Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
|
||||
ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
|
||||
if (screen) {
|
||||
fprintf(screen,"Big particle " TAGINT_FORMAT " %d %g %g %g\n",
|
||||
atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
|
||||
fprintf(screen,"Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
|
||||
ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
|
||||
}
|
||||
error->one(FLERR,"Fix SRD: bad stencil bin for big particle");
|
||||
}
|
||||
rsq = point_bin_distance(x[i],jx,jy,jz);
|
||||
|
@ -742,7 +744,8 @@ void FixSRD::post_force(int vflag)
|
|||
if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
|
||||
iz < 0 || iz >= nbin2z) {
|
||||
if (screen) {
|
||||
fprintf(screen,"SRD particle %d on step " BIGINT_FORMAT "\n",
|
||||
fprintf(screen,"SRD particle " TAGINT_FORMAT
|
||||
" on step " BIGINT_FORMAT "\n",
|
||||
atom->tag[i],update->ntimestep);
|
||||
fprintf(screen,"v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
|
||||
fprintf(screen,"x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
|
||||
|
@ -1224,15 +1227,15 @@ void FixSRD::collisions_single()
|
|||
char str[128];
|
||||
if (type != WALL)
|
||||
sprintf(str,
|
||||
"SRD particle %d started "
|
||||
"inside big particle %d on step " BIGINT_FORMAT
|
||||
" bounce %d",
|
||||
"SRD particle " TAGINT_FORMAT " started "
|
||||
"inside big particle " TAGINT_FORMAT
|
||||
" on step " BIGINT_FORMAT " bounce %d",
|
||||
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
|
||||
else
|
||||
sprintf(str,
|
||||
"SRD particle %d started "
|
||||
"inside big particle %d on step " BIGINT_FORMAT
|
||||
" bounce %d",
|
||||
"SRD particle " TAGINT_FORMAT " started "
|
||||
"inside big particle " TAGINT_FORMAT
|
||||
" on step " BIGINT_FORMAT " bounce %d",
|
||||
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
|
||||
if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
|
||||
error->warning(FLERR,str);
|
||||
|
@ -1380,9 +1383,9 @@ void FixSRD::collisions_multi()
|
|||
if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"SRD particle %d started "
|
||||
"inside big particle %d on step " BIGINT_FORMAT
|
||||
" bounce %d",
|
||||
"SRD particle " TAGINT_FORMAT " started "
|
||||
"inside big particle " TAGINT_FORMAT
|
||||
" on step " BIGINT_FORMAT " bounce %d",
|
||||
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
|
||||
if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
|
||||
error->warning(FLERR,str);
|
||||
|
@ -2381,7 +2384,8 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
|
|||
xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
|
||||
if (screen) {
|
||||
error->warning(FLERR,"Fix srd particle moved outside valid domain");
|
||||
fprintf(screen," particle %d on proc %d at timestep " BIGINT_FORMAT,
|
||||
fprintf(screen," particle " TAGINT_FORMAT
|
||||
" on proc %d at timestep " BIGINT_FORMAT,
|
||||
atom->tag[i],me,update->ntimestep);
|
||||
fprintf(screen," xnew %g %g %g\n",xs[0],xs[1],xs[2]);
|
||||
fprintf(screen," srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
|
||||
|
@ -3883,7 +3887,8 @@ void FixSRD::print_collision(int i, int j, int ibounce,
|
|||
double **v = atom->v;
|
||||
|
||||
if (type != WALL) {
|
||||
printf("COLLISION between SRD %d and BIG %d\n",atom->tag[i],atom->tag[j]);
|
||||
printf("COLLISION between SRD " TAGINT_FORMAT
|
||||
" and BIG " TAGINT_FORMAT "\n",atom->tag[i],atom->tag[j]);
|
||||
printf(" bounce # = %d\n",ibounce+1);
|
||||
printf(" local indices: %d %d\n",i,j);
|
||||
printf(" timestep = %g\n",dt);
|
||||
|
@ -3928,7 +3933,8 @@ void FixSRD::print_collision(int i, int j, int ibounce,
|
|||
} else {
|
||||
int dim = wallwhich[j] / 2;
|
||||
|
||||
printf("COLLISION between SRD %d and WALL %d\n",atom->tag[i],j);
|
||||
printf("COLLISION between SRD " TAGINT_FORMAT " and WALL %d\n",
|
||||
atom->tag[i],j);
|
||||
printf(" bounce # = %d\n",ibounce+1);
|
||||
printf(" local indices: %d %d\n",i,j);
|
||||
printf(" timestep = %g\n",dt);
|
||||
|
|
|
@ -618,7 +618,7 @@ void AtomVecWavepacket::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -646,7 +646,7 @@ void AtomVecWavepacket::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -737,7 +737,7 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -834,7 +834,7 @@ int AtomVecWavepacket::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -902,17 +902,14 @@ void AtomVecWavepacket::create_atom(int itype, double *coord)
|
|||
AWPMD: 0-tag 1-type 2-q 3-spin 4-eradius 5-etag 6-cs_re 7-cs_im
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, char **values)
|
||||
void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp,
|
||||
char **values)
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of "
|
||||
"data file (ID tag must be >0)");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -923,12 +920,10 @@ void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, char **value
|
|||
if (eradius[nlocal] < 0.0)
|
||||
error->one(FLERR,"Invalid eradius in Atoms section of data file");
|
||||
|
||||
|
||||
etag[nlocal] = atoi(values[5]);
|
||||
cs[2*nlocal] = atoi(values[6]);
|
||||
cs[2*nlocal+1] = atof(values[7]);
|
||||
|
||||
|
||||
x[nlocal][0] = coord[0];
|
||||
x[nlocal][1] = coord[1];
|
||||
x[nlocal][2] = coord[2];
|
||||
|
@ -961,7 +956,6 @@ int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values)
|
|||
cs[2*nlocal] = atoi(values[4]);
|
||||
cs[2*nlocal+1] = atof(values[5]);
|
||||
|
||||
|
||||
v[nlocal][0] = 0.0;
|
||||
v[nlocal][1] = 0.0;
|
||||
v[nlocal][2] = 0.0;
|
||||
|
@ -1039,9 +1033,10 @@ int AtomVecWavepacket::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecWavepacket::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %d %-1.16e %d %-1.16e %-1.16e %-1.16e "
|
||||
fprintf(fp,TAGINT_FORMAT
|
||||
" %d %-1.16e %d %-1.16e %d %-1.16e %-1.16e %-1.16e "
|
||||
"%-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],(int) ubuf(buf[i][3]).i,buf[i][4],
|
||||
(int) ubuf(buf[i][5]).i,buf[i][6],buf[i][8],
|
||||
buf[i][8],buf[i][9],buf[i][10],
|
||||
|
@ -1094,8 +1089,8 @@ int AtomVecWavepacket::pack_vel_hybrid(int i, double *buf)
|
|||
void AtomVecWavepacket::write_vel(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e\n",
|
||||
(int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e %-1.16e\n",
|
||||
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -73,7 +73,8 @@ public:
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
|
||||
|
|
|
@ -534,7 +534,7 @@ void AtomVecElectron::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -561,7 +561,7 @@ void AtomVecElectron::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -639,7 +639,7 @@ int AtomVecElectron::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -727,7 +727,7 @@ int AtomVecElectron::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -791,10 +791,7 @@ void AtomVecElectron::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -904,8 +901,9 @@ int AtomVecElectron::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecElectron::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,buf[i][2],
|
||||
fprintf(fp,TAGINT_FORMAT
|
||||
" %d %-1.16e %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,buf[i][2],
|
||||
(int) ubuf(buf[i][3]).i,buf[i][4],buf[i][5],buf[i][6],buf[i][7],
|
||||
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
|
||||
(int) ubuf(buf[i][10]).i);
|
||||
|
@ -954,8 +952,8 @@ int AtomVecElectron::pack_vel_hybrid(int i, double *buf)
|
|||
void AtomVecElectron::write_vel(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e\n",
|
||||
(int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e %-1.16e\n",
|
||||
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -68,7 +68,8 @@ class AtomVecElectron : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
int *spin;
|
||||
|
|
|
@ -93,8 +93,6 @@ void PairEffCut::compute(int eflag, int vflag)
|
|||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int *id = atom->tag;
|
||||
|
||||
int newton_pair = force->newton_pair;
|
||||
double qqrd2e = force->qqrd2e;
|
||||
|
||||
|
|
|
@ -137,7 +137,9 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -149,7 +149,9 @@ void DihedralFourier::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -156,7 +156,9 @@ void DihedralNHarmonic::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -161,8 +161,10 @@ void DihedralQuadratic::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
me,update->ntimestep,
|
||||
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
fprintf(screen," 1st atom: %d %g %g %g\n",
|
||||
|
|
|
@ -110,8 +110,11 @@ void ImproperCossq::compute(int eflag, int vflag)
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
me,update->ntimestep,atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
fprintf(screen," 1st atom: %d %g %g %g\n",me,x[i1][0],x[i1][1],x[i1][2]);
|
||||
fprintf(screen," 2nd atom: %d %g %g %g\n",me,x[i2][0],x[i2][1],x[i2][2]);
|
||||
|
@ -120,7 +123,6 @@ void ImproperCossq::compute(int eflag, int vflag)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Apply corrections to round-off errors. */
|
||||
if (cosphi > 1.0) cosphi -= SMALL;
|
||||
if (cosphi < -1.0) cosphi += SMALL;
|
||||
|
|
|
@ -157,8 +157,9 @@ void ImproperFourier::addone(const int &i1,const int &i2,const int &i3,const int
|
|||
MPI_Comm_rank(world,&me);
|
||||
if (screen) {
|
||||
char str[128];
|
||||
sprintf(str,
|
||||
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
|
||||
sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
me,update->ntimestep,
|
||||
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
|
||||
error->warning(FLERR,str,0);
|
||||
|
|
|
@ -841,8 +841,6 @@ void PairEDIP::coeff(int narg, char **arg)
|
|||
|
||||
void PairEDIP::init_style()
|
||||
{
|
||||
if (atom->tag_enable == 0)
|
||||
error->all(FLERR,"Pair style EDIP requires atom IDs");
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style EDIP requires newton pair on");
|
||||
|
||||
|
|
|
@ -233,7 +233,9 @@ void PairList::settings(int narg, char **arg)
|
|||
// now read and parse pair list file for real
|
||||
npairs = 0;
|
||||
char *ptr;
|
||||
int id1, id2, nharm=0, nmorse=0, nlj126=0;
|
||||
tagint id1, id2;
|
||||
int nharm=0, nmorse=0, nlj126=0;
|
||||
|
||||
while(fgets(line,1024,fp)) {
|
||||
ptr = strtok(line," \t\n\r\f");
|
||||
|
||||
|
@ -244,11 +246,11 @@ void PairList::settings(int narg, char **arg)
|
|||
if (*ptr == '#') continue;
|
||||
|
||||
// get atom ids of pair
|
||||
id1 = atoi(ptr);
|
||||
id1 = ATOTAGINT(ptr);
|
||||
ptr = strtok(NULL," \t\n\r\f");
|
||||
if (!ptr)
|
||||
error->all(FLERR,"Incorrectly formatted pair list file");
|
||||
id2 = atoi(ptr);
|
||||
id2 = ATOTAGINT(ptr);
|
||||
|
||||
// get potential type
|
||||
ptr = strtok(NULL," \t\n\r\f");
|
||||
|
|
|
@ -53,7 +53,7 @@ class PairList : public Pair {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
int id1,id2; // global atom ids
|
||||
tagint id1,id2; // global atom ids
|
||||
double cutsq; // cutoff**2 for this pair
|
||||
double offset; // energy offset
|
||||
union parm_u parm; // parameters for style
|
||||
|
|
|
@ -815,8 +815,6 @@ void PairTersoffTable::coeff(int narg, char **arg)
|
|||
|
||||
void PairTersoffTable::init_style()
|
||||
{
|
||||
if (atom->tag_enable == 0)
|
||||
error->all(FLERR,"Pair style Tersoff requires atom IDs");
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style Tersoff requires newton pair on");
|
||||
|
||||
|
|
|
@ -578,7 +578,7 @@ void AtomVecMeso::unpack_border(int n, int first, double *buf) {
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
rho[i] = buf[m++];
|
||||
|
@ -609,7 +609,7 @@ void AtomVecMeso::unpack_border_vel(int n, int first, double *buf) {
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
v[i][0] = buf[m++];
|
||||
|
@ -677,7 +677,7 @@ int AtomVecMeso::unpack_exchange(double *buf) {
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -765,7 +765,7 @@ int AtomVecMeso::unpack_restart(double *buf) {
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -830,13 +830,9 @@ void AtomVecMeso::create_atom(int itype, double *coord) {
|
|||
|
||||
void AtomVecMeso::data_atom(double *coord, imageint imagetmp, char **values) {
|
||||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax)
|
||||
grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -923,9 +919,10 @@ int AtomVecMeso::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecMeso::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
|
||||
fprintf(fp,TAGINT_FORMAT
|
||||
" %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
|
||||
"%d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],buf[i][3],buf[i][4],
|
||||
buf[i][5],buf[i][6],buf[i][7],
|
||||
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
|
||||
|
|
|
@ -62,7 +62,8 @@ class AtomVecMeso : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
int *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
double *rho, *drho, *e, *de, *cv;
|
||||
|
|
|
@ -190,11 +190,11 @@ void DumpXTC::write_header(bigint nbig)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void DumpXTC::pack(int *ids)
|
||||
void DumpXTC::pack(tagint *ids)
|
||||
{
|
||||
int m,n;
|
||||
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
double **x = atom->x;
|
||||
imageint *image = atom->image;
|
||||
int *mask = atom->mask;
|
||||
|
|
|
@ -49,7 +49,7 @@ class DumpXTC : public Dump {
|
|||
int modify_param(int, char **);
|
||||
void openfile();
|
||||
void write_header(bigint);
|
||||
void pack(int *);
|
||||
void pack(tagint *);
|
||||
void write_data(int, double *);
|
||||
bigint memory_usage();
|
||||
|
||||
|
|
625
src/atom.cpp
625
src/atom.cpp
|
@ -57,8 +57,6 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
ntypes = 0;
|
||||
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
|
||||
nbonds = nangles = ndihedrals = nimpropers = 0;
|
||||
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
|
||||
extra_bond_per_atom = 0;
|
||||
|
||||
firstgroupname = NULL;
|
||||
sortfreq = 1000;
|
||||
|
@ -71,7 +69,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
// initialize atom arrays
|
||||
// customize by adding new array
|
||||
|
||||
tag = type = mask = NULL;
|
||||
tag = NULL;
|
||||
type = mask = NULL;
|
||||
image = NULL;
|
||||
x = v = f = NULL;
|
||||
|
||||
|
@ -92,24 +91,30 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
cv = NULL;
|
||||
vest = NULL;
|
||||
|
||||
bond_per_atom = extra_bond_per_atom = 0;
|
||||
num_bond = NULL;
|
||||
bond_type = NULL;
|
||||
bond_atom = NULL;
|
||||
|
||||
angle_per_atom = extra_angle_per_atom = 0;
|
||||
num_angle = NULL;
|
||||
angle_type = NULL;
|
||||
angle_atom1 = angle_atom2 = angle_atom3 = NULL;
|
||||
|
||||
dihedral_per_atom = extra_dihedral_per_atom = 0;
|
||||
num_dihedral = NULL;
|
||||
dihedral_type = NULL;
|
||||
dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL;
|
||||
|
||||
improper_per_atom = extra_improper_per_atom = 0;
|
||||
num_improper = NULL;
|
||||
improper_type = NULL;
|
||||
improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL;
|
||||
|
||||
maxspecial = 1;
|
||||
nspecial = NULL;
|
||||
special = NULL;
|
||||
|
||||
num_bond = NULL;
|
||||
bond_type = bond_atom = NULL;
|
||||
|
||||
num_angle = NULL;
|
||||
angle_type = angle_atom1 = angle_atom2 = angle_atom3 = NULL;
|
||||
|
||||
num_dihedral = NULL;
|
||||
dihedral_type = dihedral_atom1 = dihedral_atom2 = NULL;
|
||||
dihedral_atom3 = dihedral_atom4 = NULL;
|
||||
|
||||
num_improper = NULL;
|
||||
improper_type = improper_atom1 = improper_atom2 = NULL;
|
||||
improper_atom3 = improper_atom4 = NULL;
|
||||
|
||||
// user-defined molecules
|
||||
|
||||
nmolecule = maxmol = 0;
|
||||
|
@ -148,14 +153,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
nextra_store = 0;
|
||||
extra = NULL;
|
||||
|
||||
// default mapping values
|
||||
// default atom ID and mapping values
|
||||
|
||||
tag_enable = 1;
|
||||
map_style = 0;
|
||||
map_style = map_user = 0;
|
||||
map_tag_max = 0;
|
||||
map_nhash = 0;
|
||||
|
||||
smax = 0;
|
||||
max_same = 0;
|
||||
sametag = NULL;
|
||||
map_array = NULL;
|
||||
map_bucket = NULL;
|
||||
|
@ -283,7 +288,8 @@ Atom::~Atom()
|
|||
|
||||
void Atom::settings(Atom *old)
|
||||
{
|
||||
map_style = old->map_style;
|
||||
tag_enable = old->tag_enable;
|
||||
map_user = old->map_user;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -333,10 +339,11 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
|
|||
strcpy(atom_style,style);
|
||||
}
|
||||
|
||||
// if molecular system, default is to have array map
|
||||
// if molecular system, atom IDs must be defined
|
||||
|
||||
molecular = avec->molecular;
|
||||
if (map_style == 0 && molecular) map_style = 1;
|
||||
if (molecular && tag_enable == 0)
|
||||
error->all(FLERR,"Atom IDs must be used for molecular systems");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -444,14 +451,23 @@ void Atom::modify_params(int narg, char **arg)
|
|||
|
||||
int iarg = 0;
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"map") == 0) {
|
||||
if (strcmp(arg[iarg],"id") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
|
||||
if (strcmp(arg[iarg+1],"array") == 0) map_style = 1;
|
||||
else if (strcmp(arg[iarg+1],"hash") == 0) map_style = 2;
|
||||
if (domain->box_exist)
|
||||
error->all(FLERR,
|
||||
"Atom_modify id command after simulation box is defined");
|
||||
if (strcmp(arg[iarg+1],"yes") == 0) tag_enable = 1;
|
||||
else if (strcmp(arg[iarg+1],"no") == 0) tag_enable = 2;
|
||||
else error->all(FLERR,"Illegal atom_modify command");
|
||||
iarg += 2;
|
||||
} if (strcmp(arg[iarg],"map") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
|
||||
if (domain->box_exist)
|
||||
error->all(FLERR,
|
||||
"Atom_modify map command after simulation box is defined");
|
||||
if (strcmp(arg[iarg+1],"array") == 0) map_user = 1;
|
||||
else if (strcmp(arg[iarg+1],"hash") == 0) map_user = 2;
|
||||
else error->all(FLERR,"Illegal atom_modify command");
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"first") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
|
||||
|
@ -479,37 +495,82 @@ void Atom::modify_params(int narg, char **arg)
|
|||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs are valid
|
||||
error if any atom ID < 0 or atom ID = MAXTAGINT
|
||||
if any atom ID > 0, error if any atom ID == 0
|
||||
if all atom IDs = 0, tag_enable must be 0
|
||||
OK if atom IDs > natoms
|
||||
NOTE: not checking that atom IDs are unique
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::tag_check()
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
tagint min = MAXTAGINT;
|
||||
tagint max = 0;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
min = MIN(min,tag[i]);
|
||||
max = MAX(max,tag[i]);
|
||||
}
|
||||
|
||||
tagint minall,maxall;
|
||||
MPI_Allreduce(&min,&minall,1,MPI_LMP_TAGINT,MPI_MIN,world);
|
||||
MPI_Allreduce(&max,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
if (minall < 0) error->all(FLERR,"Atom ID is negative");
|
||||
if (maxall >= MAXTAGINT) error->all(FLERR,"Atom ID is too big");
|
||||
if (maxall > 0 && minall == 0) error->all(FLERR,"Atom ID is zero");
|
||||
if (maxall == 0 && tag_enable && natoms)
|
||||
error->all(FLERR,"Not all atom IDs are 0");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
add unique tags to any atoms with tag = 0
|
||||
new tags are grouped by proc and start after max current tag
|
||||
called after creating new atoms
|
||||
error if new tags will exceed MAXTAGINT
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::tag_extend()
|
||||
{
|
||||
// maxtag_all = max tag for all atoms
|
||||
|
||||
int maxtag = 0;
|
||||
tagint maxtag = 0;
|
||||
for (int i = 0; i < nlocal; i++) maxtag = MAX(maxtag,tag[i]);
|
||||
int maxtag_all;
|
||||
MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_INT,MPI_MAX,world);
|
||||
tagint maxtag_all;
|
||||
MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
// DEBUG: useful for generating 64-bit IDs even for small systems
|
||||
// use only when LAMMPS is compiled with BIGBIG
|
||||
|
||||
//maxtag_all += 1000000000000;
|
||||
|
||||
// notag = # of atoms I own with no tag (tag = 0)
|
||||
// notag_sum = # of total atoms on procs <= me with no tag
|
||||
|
||||
int notag = 0;
|
||||
bigint notag = 0;
|
||||
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) notag++;
|
||||
int notag_sum;
|
||||
MPI_Scan(¬ag,¬ag_sum,1,MPI_INT,MPI_SUM,world);
|
||||
|
||||
bigint notag_total;
|
||||
MPI_Allreduce(¬ag,¬ag_total,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
if (notag_total >= MAXTAGINT)
|
||||
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
|
||||
|
||||
bigint notag_sum;
|
||||
MPI_Scan(¬ag,¬ag_sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
|
||||
// itag = 1st new tag that my untagged atoms should use
|
||||
|
||||
int itag = maxtag_all + notag_sum - notag + 1;
|
||||
tagint itag = maxtag_all + notag_sum - notag + 1;
|
||||
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) tag[i] = itag++;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs span range from 1 to Natoms
|
||||
check that atom IDs span range from 1 to Natoms inclusive
|
||||
return 0 if mintag != 1 or maxtag != Natoms
|
||||
return 1 if OK
|
||||
doesn't actually check if all tag values are used
|
||||
|
@ -517,20 +578,18 @@ void Atom::tag_extend()
|
|||
|
||||
int Atom::tag_consecutive()
|
||||
{
|
||||
// change this when allow tagint = bigint
|
||||
//int idmin = MAXTAGINT;
|
||||
int idmin = MAXSMALLINT;
|
||||
int idmax = 0;
|
||||
tagint idmin = MAXTAGINT;
|
||||
tagint idmax = 0;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
idmin = MIN(idmin,tag[i]);
|
||||
idmax = MAX(idmax,tag[i]);
|
||||
}
|
||||
int idminall,idmaxall;
|
||||
MPI_Allreduce(&idmin,&idminall,1,MPI_INT,MPI_MIN,world);
|
||||
MPI_Allreduce(&idmax,&idmaxall,1,MPI_INT,MPI_MAX,world);
|
||||
tagint idminall,idmaxall;
|
||||
MPI_Allreduce(&idmin,&idminall,1,MPI_LMP_TAGINT,MPI_MIN,world);
|
||||
MPI_Allreduce(&idmax,&idmaxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
if (idminall != 1 || idmaxall != static_cast<int> (natoms)) return 0;
|
||||
if (idminall != 1 || idmaxall != natoms) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -683,7 +742,8 @@ void Atom::data_atoms(int n, char *buf)
|
|||
|
||||
void Atom::data_vels(int n, char *buf)
|
||||
{
|
||||
int j,m,tagdata;
|
||||
int j,m;
|
||||
tagint tagdata;
|
||||
char *next;
|
||||
|
||||
next = strchr(buf,'\n');
|
||||
|
@ -707,7 +767,7 @@ void Atom::data_vels(int n, char *buf)
|
|||
for (j = 1; j < nwords; j++)
|
||||
values[j] = strtok(NULL," \t\n\r\f");
|
||||
|
||||
tagdata = atoi(values[0]);
|
||||
tagdata = ATOTAGINT(values[0]);
|
||||
if (tagdata <= 0 || tagdata > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Velocities section of data file");
|
||||
if ((m = map(tagdata)) >= 0) avec->data_vel(m,&values[1]);
|
||||
|
@ -718,6 +778,269 @@ void Atom::data_vels(int n, char *buf)
|
|||
delete [] values;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
process N bonds read into buf from data files
|
||||
if count is non-NULL, just count bonds per atom
|
||||
else store them with atoms
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_bonds(int n, char *buf, int *count)
|
||||
{
|
||||
int m,tmp,itype;
|
||||
tagint atom1,atom2;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
&tmp,&itype,&atom1,&atom2);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Bonds section of data file");
|
||||
if (itype <= 0 || itype > nbondtypes)
|
||||
error->one(FLERR,"Invalid bond type in Bonds section of data file");
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
bond_type[m][num_bond[m]] = itype;
|
||||
bond_atom[m][num_bond[m]] = atom2;
|
||||
num_bond[m]++;
|
||||
}
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
bond_type[m][num_bond[m]] = itype;
|
||||
bond_atom[m][num_bond[m]] = atom1;
|
||||
num_bond[m]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
process N angles read into buf from data files
|
||||
if count is non-NULL, just count angles per atom
|
||||
else store them with atoms
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_angles(int n, char *buf, int *count)
|
||||
{
|
||||
int m,tmp,itype;
|
||||
tagint atom1,atom2,atom3;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
&tmp,&itype,&atom1,&atom2,&atom3);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Angles section of data file");
|
||||
if (itype <= 0 || itype > nangletypes)
|
||||
error->one(FLERR,"Invalid angle type in Angles section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
process N dihedrals read into buf from data files
|
||||
if count is non-NULL, just count diihedrals per atom
|
||||
else store them with atoms
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_dihedrals(int n, char *buf, int *count)
|
||||
{
|
||||
int m,tmp,itype;
|
||||
tagint atom1,atom2,atom3,atom4;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max ||
|
||||
atom4 <= 0 || atom4 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
|
||||
if (itype <= 0 || itype > ndihedraltypes)
|
||||
error->one(FLERR,
|
||||
"Invalid dihedral type in Dihedrals section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
}
|
||||
if ((m = map(atom4)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
process N impropers read into buf from data files
|
||||
if count is non-NULL, just count impropers per atom
|
||||
else store them with atoms
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_impropers(int n, char *buf, int *count)
|
||||
{
|
||||
int m,tmp,itype;
|
||||
tagint atom1,atom2,atom3,atom4;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
|
||||
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max ||
|
||||
atom4 <= 0 || atom4 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Impropers section of data file");
|
||||
if (itype <= 0 || itype > nimpropertypes)
|
||||
error->one(FLERR,
|
||||
"Invalid improper type in Impropers section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
}
|
||||
if ((m = map(atom4)) >= 0) {
|
||||
if (count) count[m]++;
|
||||
else {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack n lines from atom-style specific section of data file
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
|
@ -750,7 +1073,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus)
|
|||
for (j = 1; j < nwords; j++)
|
||||
values[j] = strtok(NULL," \t\n\r\f");
|
||||
|
||||
tagdata = atoi(values[0]);
|
||||
tagdata = ATOTAGINT(values[0]);
|
||||
if (tagdata <= 0 || tagdata > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Bonus section of data file");
|
||||
|
||||
|
@ -783,8 +1106,8 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body)
|
|||
// if I own atom tag, unpack its values
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (i == 0) tagdata = atoi(strtok(buf," \t\n\r\f"));
|
||||
else tagdata = atoi(strtok(NULL," \t\n\r\f"));
|
||||
if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f"));
|
||||
else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f"));
|
||||
ninteger = atoi(strtok(NULL," \t\n\r\f"));
|
||||
ndouble = atoi(strtok(NULL," \t\n\r\f"));
|
||||
|
||||
|
@ -804,208 +1127,6 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body)
|
|||
delete [] dvalues;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_bonds(int n, char *buf)
|
||||
{
|
||||
int m,tmp,itype,atom1,atom2;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d %d %d",&tmp,&itype,&atom1,&atom2);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Bonds section of data file");
|
||||
if (itype <= 0 || itype > nbondtypes)
|
||||
error->one(FLERR,"Invalid bond type in Bonds section of data file");
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
bond_type[m][num_bond[m]] = itype;
|
||||
bond_atom[m][num_bond[m]] = atom2;
|
||||
num_bond[m]++;
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
bond_type[m][num_bond[m]] = itype;
|
||||
bond_atom[m][num_bond[m]] = atom1;
|
||||
num_bond[m]++;
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_angles(int n, char *buf)
|
||||
{
|
||||
int m,tmp,itype,atom1,atom2,atom3;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Angles section of data file");
|
||||
if (itype <= 0 || itype > nangletypes)
|
||||
error->one(FLERR,"Invalid angle type in Angles section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
angle_type[m][num_angle[m]] = itype;
|
||||
angle_atom1[m][num_angle[m]] = atom1;
|
||||
angle_atom2[m][num_angle[m]] = atom2;
|
||||
angle_atom3[m][num_angle[m]] = atom3;
|
||||
num_angle[m]++;
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_dihedrals(int n, char *buf)
|
||||
{
|
||||
int m,tmp,itype,atom1,atom2,atom3,atom4;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max ||
|
||||
atom4 <= 0 || atom4 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
|
||||
if (itype <= 0 || itype > ndihedraltypes)
|
||||
error->one(FLERR,
|
||||
"Invalid dihedral type in Dihedrals section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
if ((m = map(atom4)) >= 0) {
|
||||
dihedral_type[m][num_dihedral[m]] = itype;
|
||||
dihedral_atom1[m][num_dihedral[m]] = atom1;
|
||||
dihedral_atom2[m][num_dihedral[m]] = atom2;
|
||||
dihedral_atom3[m][num_dihedral[m]] = atom3;
|
||||
dihedral_atom4[m][num_dihedral[m]] = atom4;
|
||||
num_dihedral[m]++;
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::data_impropers(int n, char *buf)
|
||||
{
|
||||
int m,tmp,itype,atom1,atom2,atom3,atom4;
|
||||
char *next;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
|
||||
if (atom1 <= 0 || atom1 > map_tag_max ||
|
||||
atom2 <= 0 || atom2 > map_tag_max ||
|
||||
atom3 <= 0 || atom3 > map_tag_max ||
|
||||
atom4 <= 0 || atom4 > map_tag_max)
|
||||
error->one(FLERR,"Invalid atom ID in Impropers section of data file");
|
||||
if (itype <= 0 || itype > nimpropertypes)
|
||||
error->one(FLERR,
|
||||
"Invalid improper type in Impropers section of data file");
|
||||
if ((m = map(atom2)) >= 0) {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
if (newton_bond == 0) {
|
||||
if ((m = map(atom1)) >= 0) {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
if ((m = map(atom3)) >= 0) {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
if ((m = map(atom4)) >= 0) {
|
||||
improper_type[m][num_improper[m]] = itype;
|
||||
improper_atom1[m][num_improper[m]] = atom1;
|
||||
improper_atom2[m][num_improper[m]] = atom2;
|
||||
improper_atom3[m][num_improper[m]] = atom3;
|
||||
improper_atom4[m][num_improper[m]] = atom4;
|
||||
num_improper[m]++;
|
||||
}
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
allocate arrays of length ntypes
|
||||
only done after ntypes is set
|
||||
|
@ -1210,7 +1331,7 @@ int Atom::find_molecule(char *id)
|
|||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::add_molecule_atom(Molecule *onemol, int iatom,
|
||||
int ilocal, int offset)
|
||||
int ilocal, tagint offset)
|
||||
{
|
||||
if (onemol->qflag) q[ilocal] = onemol->q[iatom];
|
||||
if (onemol->radiusflag) radius[ilocal] = onemol->radius[iatom];
|
||||
|
@ -1709,9 +1830,9 @@ bigint Atom::memory_usage()
|
|||
bigint bytes = avec->memory_usage();
|
||||
memory->destroy(memstr);
|
||||
|
||||
bytes += smax*sizeof(int);
|
||||
bytes += max_same*sizeof(int);
|
||||
if (map_style == 1)
|
||||
bytes += memory->usage(map_array,map_tag_max+1);
|
||||
bytes += memory->usage(map_array,max_array);
|
||||
else if (map_style == 2) {
|
||||
bytes += map_nbucket*sizeof(int);
|
||||
bytes += map_nhash*sizeof(HashElem);
|
||||
|
|
62
src/atom.h
62
src/atom.h
|
@ -45,7 +45,8 @@ class Atom : protected Pointers {
|
|||
// per-atom arrays
|
||||
// customize by adding new array
|
||||
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
|
||||
|
@ -65,24 +66,24 @@ class Atom : protected Pointers {
|
|||
double *cv;
|
||||
|
||||
int **nspecial; // 0,1,2 = cummulative # of 1-2,1-3,1-4 neighs
|
||||
int **special; // IDs of 1-2,1-3,1-4 neighs of each atom
|
||||
tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom
|
||||
int maxspecial; // special[nlocal][maxspecial]
|
||||
|
||||
int *num_bond;
|
||||
int **bond_type;
|
||||
int **bond_atom;
|
||||
tagint **bond_atom;
|
||||
|
||||
int *num_angle;
|
||||
int **angle_type;
|
||||
int **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
tagint **angle_atom1,**angle_atom2,**angle_atom3;
|
||||
|
||||
int *num_dihedral;
|
||||
int **dihedral_type;
|
||||
int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
|
||||
|
||||
int *num_improper;
|
||||
int **improper_type;
|
||||
int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
|
||||
|
||||
// custom arrays used by fix property/atom
|
||||
|
||||
|
@ -133,9 +134,9 @@ class Atom : protected Pointers {
|
|||
int nextra_border_max;
|
||||
int nextra_store;
|
||||
|
||||
int map_style; // default or user-specified style of map
|
||||
// 0 = none, 1 = array, 2 = hash
|
||||
int map_tag_max; // max atom ID that map() is setup for
|
||||
int map_style; // style of atom map: 0=none, 1=array, 2=hash
|
||||
int map_user; // user selected style = same 0,1,2
|
||||
tagint map_tag_max; // max atom ID that map() is setup for
|
||||
|
||||
// spatial sorting of atoms
|
||||
|
||||
|
@ -159,6 +160,7 @@ class Atom : protected Pointers {
|
|||
|
||||
class AtomVec *style_match(const char *);
|
||||
void modify_params(int, char **);
|
||||
void tag_check();
|
||||
void tag_extend();
|
||||
int tag_consecutive();
|
||||
|
||||
|
@ -167,14 +169,15 @@ class Atom : protected Pointers {
|
|||
|
||||
void data_atoms(int, char *);
|
||||
void data_vels(int, char *);
|
||||
|
||||
void data_bonds(int, char *, int *);
|
||||
void data_angles(int, char *, int *);
|
||||
void data_dihedrals(int, char *, int *);
|
||||
void data_impropers(int, char *, int *);
|
||||
|
||||
void data_bonus(int, char *, class AtomVec *);
|
||||
void data_bodies(int, char *, class AtomVecBody *);
|
||||
|
||||
void data_bonds(int, char *);
|
||||
void data_angles(int, char *);
|
||||
void data_dihedrals(int, char *);
|
||||
void data_impropers(int, char *);
|
||||
|
||||
void allocate_type_arrays();
|
||||
void set_mass(const char *);
|
||||
void set_mass(int, double);
|
||||
|
@ -187,7 +190,7 @@ class Atom : protected Pointers {
|
|||
|
||||
void add_molecule(int, char **);
|
||||
int find_molecule(char *);
|
||||
void add_molecule_atom(class Molecule *, int, int, int);
|
||||
void add_molecule_atom(class Molecule *, int, int, tagint);
|
||||
|
||||
void first_reorder();
|
||||
void sort();
|
||||
|
@ -212,7 +215,7 @@ class Atom : protected Pointers {
|
|||
// map lookup function inlined for efficiency
|
||||
// return -1 if no map defined
|
||||
|
||||
inline int map(int global) {
|
||||
inline int map(tagint global) {
|
||||
if (map_style == 1) return map_array[global];
|
||||
else if (map_style == 2) return map_find_hash(global);
|
||||
else return -1;
|
||||
|
@ -221,28 +224,31 @@ class Atom : protected Pointers {
|
|||
void map_init();
|
||||
void map_clear();
|
||||
void map_set();
|
||||
void map_one(int, int);
|
||||
void map_one(tagint, int);
|
||||
void map_delete();
|
||||
int map_find_hash(int);
|
||||
int map_find_hash(tagint);
|
||||
|
||||
private:
|
||||
|
||||
// global to local ID mapping
|
||||
|
||||
int *map_array; // direct map of length map_tag_max + 1
|
||||
int smax; // max size of sametag
|
||||
|
||||
struct HashElem {
|
||||
int global; // key to search on = global ID
|
||||
int local; // value associated with key = local index
|
||||
int next; // next entry in this bucket, -1 if last
|
||||
tagint global; // key to search on = global ID
|
||||
int local; // value associated with key = local index
|
||||
int next; // next entry in this bucket, -1 if last
|
||||
};
|
||||
int map_nhash; // # of entries hash table can hold
|
||||
int map_nused; // # of actual entries in hash table
|
||||
int map_free; // ptr to 1st unused entry in hash table
|
||||
int map_nbucket; // # of hash buckets
|
||||
int *map_bucket; // ptr to 1st entry in each bucket
|
||||
HashElem *map_hash; // hash table
|
||||
int map_nhash; // # of entries hash table can hold
|
||||
int map_nused; // # of actual entries in hash table
|
||||
int map_free; // ptr to 1st unused entry in hash table
|
||||
int map_nbucket; // # of hash buckets
|
||||
int *map_bucket; // ptr to 1st entry in each bucket
|
||||
HashElem *map_hash; // hash table
|
||||
|
||||
int max_array; // allocated size of map_array (+1)
|
||||
int max_nhash; // allocated size of hash table
|
||||
int max_same; // allocated size of sametag
|
||||
|
||||
// spatial sorting of atoms
|
||||
|
||||
|
|
140
src/atom_map.cpp
140
src/atom_map.cpp
|
@ -25,61 +25,100 @@ using namespace LAMMPS_NS;
|
|||
allocate and initialize array or hash table for global -> local map
|
||||
set map_tag_max = largest atom ID (may be larger than natoms)
|
||||
for array option:
|
||||
array length = 1 to largest tag of any atom
|
||||
array length = 1 to map_tag_max
|
||||
set entire array to -1 as initial values
|
||||
for hash option:
|
||||
map_nhash = length of hash table
|
||||
map_nbucket = # of hash buckets, prime larger than map_nhash
|
||||
map_nbucket = # of hash buckets, prime larger than map_nhash * 2
|
||||
so buckets will only be filled with 0 or 1 atoms on average
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::map_init()
|
||||
{
|
||||
map_delete();
|
||||
|
||||
if (tag_enable == 0)
|
||||
error->all(FLERR,"Cannot create an atom map unless atoms have IDs");
|
||||
|
||||
int max = 0;
|
||||
int map_style_old = map_style;
|
||||
|
||||
// map_tag_max = max ID of any atom that will be in new map
|
||||
|
||||
tagint max = 0;
|
||||
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
||||
MPI_Allreduce(&max,&map_tag_max,1,MPI_INT,MPI_MAX,world);
|
||||
MPI_Allreduce(&max,&map_tag_max,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
|
||||
memory->destroy(sametag);
|
||||
smax = nlocal + nghost + EXTRA;
|
||||
memory->create(sametag,smax,"atom:sametag");
|
||||
// set map_style for new map
|
||||
// if user-selected, use that setting
|
||||
// else if map_tag_max > 1M, use hash
|
||||
// else use array
|
||||
|
||||
if (map_user) map_style = map_user;
|
||||
else if (map_tag_max > 1000000) map_style = 2;
|
||||
else map_style = 1;
|
||||
|
||||
if (map_style == 1) {
|
||||
memory->create(map_array,map_tag_max+1,"atom:map_array");
|
||||
for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
|
||||
// recreate = 1 if must delete old map and create new map
|
||||
// recreate = 0 if can re-use old map w/out realloc and just adjust settings
|
||||
|
||||
int recreate = 0;
|
||||
if (map_style != map_style_old) recreate = 1;
|
||||
else if (map_style == 1 && map_tag_max > max_array) recreate = 1;
|
||||
else if (map_style == 2 && nlocal+nghost > map_nhash) recreate = 1;
|
||||
|
||||
// if not recreating:
|
||||
// for array, just initialize current map_tag_max values
|
||||
// for hash, set all buckets to empty, put all entries in free list
|
||||
|
||||
if (!recreate) {
|
||||
if (map_style == 1) {
|
||||
for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
|
||||
} else {
|
||||
for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
|
||||
map_nused = 0;
|
||||
map_free = 0;
|
||||
for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
|
||||
map_hash[map_nhash-1].next = -1;
|
||||
}
|
||||
|
||||
// delete old map and create new one for array or hash
|
||||
|
||||
} else {
|
||||
map_delete();
|
||||
|
||||
// map_nhash = max # of atoms that can be hashed on this proc
|
||||
// set to max of ave atoms/proc or atoms I can store
|
||||
// multiply by 2, require at least 1000
|
||||
// doubling means hash table will be re-init only rarely
|
||||
if (map_style == 1) {
|
||||
max_array = map_tag_max;
|
||||
memory->create(map_array,max_array+1,"atom:map_array");
|
||||
for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
|
||||
|
||||
} else {
|
||||
|
||||
int nper = static_cast<int> (natoms/comm->nprocs);
|
||||
map_nhash = MAX(nper,nmax);
|
||||
map_nhash *= 2;
|
||||
map_nhash = MAX(map_nhash,1000);
|
||||
// map_nhash = max # of atoms that can be hashed on this proc
|
||||
// set to max of ave atoms/proc or atoms I can store
|
||||
// multiply by 2, require at least 1000
|
||||
// doubling means hash table will need to be re-init only rarely
|
||||
|
||||
// map_nbucket = prime just larger than map_nhash
|
||||
int nper = static_cast<int> (natoms/comm->nprocs);
|
||||
map_nhash = MAX(nper,nmax);
|
||||
map_nhash *= 2;
|
||||
map_nhash = MAX(map_nhash,1000);
|
||||
|
||||
map_nbucket = next_prime(map_nhash);
|
||||
// map_nbucket = prime just larger than map_nhash
|
||||
// next_prime() should be fast enough,
|
||||
// about 10% of odd integers are prime above 1M
|
||||
|
||||
// set all buckets to empty
|
||||
// set hash to map_nhash in length
|
||||
// put all hash entries in free list and point them to each other
|
||||
map_nbucket = next_prime(map_nhash);
|
||||
|
||||
map_bucket = new int[map_nbucket];
|
||||
for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
|
||||
// set all buckets to empty
|
||||
// set hash to map_nhash in length
|
||||
// put all hash entries in free list and point them to each other
|
||||
|
||||
map_bucket = new int[map_nbucket];
|
||||
for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
|
||||
|
||||
map_hash = new HashElem[map_nhash];
|
||||
map_nused = 0;
|
||||
map_free = 0;
|
||||
for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
|
||||
map_hash[map_nhash-1].next = -1;
|
||||
map_hash = new HashElem[map_nhash];
|
||||
map_nused = 0;
|
||||
map_free = 0;
|
||||
for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
|
||||
map_hash[map_nhash-1].next = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,7 +138,8 @@ void Atom::map_clear()
|
|||
}
|
||||
|
||||
} else {
|
||||
int previous,global,ibucket,index;
|
||||
int previous,ibucket,index;
|
||||
tagint global;
|
||||
int nall = nlocal + nghost;
|
||||
for (int i = 0; i < nall; i++) {
|
||||
sametag[i] = -1;
|
||||
|
@ -144,21 +184,37 @@ void Atom::map_clear()
|
|||
void Atom::map_set()
|
||||
{
|
||||
int nall = nlocal + nghost;
|
||||
if (nall > smax) {
|
||||
smax = nall + EXTRA;
|
||||
memory->destroy(sametag);
|
||||
memory->create(sametag,smax,"atom:sametag");
|
||||
}
|
||||
|
||||
if (map_style == 1) {
|
||||
|
||||
// possible reallocation of sametag must come before loop over atoms
|
||||
// since loop sets sametag
|
||||
|
||||
if (nall > max_same) {
|
||||
max_same = nall + EXTRA;
|
||||
memory->destroy(sametag);
|
||||
memory->create(sametag,max_same,"atom:sametag");
|
||||
}
|
||||
|
||||
for (int i = nall-1; i >= 0 ; i--) {
|
||||
sametag[i] = map_array[tag[i]];
|
||||
map_array[tag[i]] = i;
|
||||
}
|
||||
|
||||
} else {
|
||||
int previous,global,ibucket,index;
|
||||
|
||||
// possible reallocation of sametag must come after map_init()
|
||||
// since map_init() will invoke map_delete(), whacking sametag
|
||||
|
||||
if (nall > map_nhash) map_init();
|
||||
if (nall > max_same) {
|
||||
max_same = nall + EXTRA;
|
||||
memory->destroy(sametag);
|
||||
memory->create(sametag,max_same,"atom:sametag");
|
||||
}
|
||||
|
||||
int previous,ibucket,index;
|
||||
tagint global;
|
||||
|
||||
for (int i = nall-1; i >= 0 ; i--) {
|
||||
sametag[i] = map_find_hash(tag[i]);
|
||||
|
@ -203,7 +259,7 @@ void Atom::map_set()
|
|||
called by Special class
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::map_one(int global, int local)
|
||||
void Atom::map_one(tagint global, int local)
|
||||
{
|
||||
if (map_style == 1) map_array[global] = local;
|
||||
else {
|
||||
|
@ -246,6 +302,7 @@ void Atom::map_delete()
|
|||
{
|
||||
memory->destroy(sametag);
|
||||
sametag = NULL;
|
||||
max_same = 0;
|
||||
|
||||
if (map_style == 1) {
|
||||
memory->destroy(map_array);
|
||||
|
@ -259,7 +316,6 @@ void Atom::map_delete()
|
|||
}
|
||||
map_nhash = 0;
|
||||
}
|
||||
map_tag_max = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -267,7 +323,7 @@ void Atom::map_delete()
|
|||
called by map() in atom.h
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Atom::map_find_hash(int global)
|
||||
int Atom::map_find_hash(tagint global)
|
||||
{
|
||||
int local = -1;
|
||||
int index = map_bucket[global % map_nbucket];
|
||||
|
|
|
@ -82,7 +82,7 @@ void AtomVec::data_vel(int m, char **values)
|
|||
void AtomVec::pack_vel(double **buf)
|
||||
{
|
||||
double **v = atom->v;
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
|
@ -100,8 +100,8 @@ void AtomVec::pack_vel(double **buf)
|
|||
void AtomVec::write_vel(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %-1.16e %-1.16e %-1.16e\n",
|
||||
(int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
|
||||
fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e\n",
|
||||
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -111,12 +111,12 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf)
|
|||
if bondtype is negative, flip back to positive
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int AtomVec::pack_bond(int **buf)
|
||||
int AtomVec::pack_bond(tagint **buf)
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *num_bond = atom->num_bond;
|
||||
int **bond_type = atom->bond_type;
|
||||
int **bond_atom = atom->bond_atom;
|
||||
tagint **bond_atom = atom->bond_atom;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
|
@ -154,10 +154,11 @@ int AtomVec::pack_bond(int **buf)
|
|||
write bond info to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::write_bond(FILE *fp, int n, int **buf, int index)
|
||||
void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index)
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
fprintf(fp,"%d %d %d %d\n",index,buf[i][0],buf[i][1],buf[i][2]);
|
||||
fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
|
||||
index,buf[i][0],buf[i][1],buf[i][2]);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
@ -169,14 +170,14 @@ void AtomVec::write_bond(FILE *fp, int n, int **buf, int index)
|
|||
if angletype is negative, flip back to positive
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int AtomVec::pack_angle(int **buf)
|
||||
int AtomVec::pack_angle(tagint **buf)
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *num_angle = atom->num_angle;
|
||||
int **angle_type = atom->angle_type;
|
||||
int **angle_atom1 = atom->angle_atom1;
|
||||
int **angle_atom2 = atom->angle_atom2;
|
||||
int **angle_atom3 = atom->angle_atom3;
|
||||
tagint **angle_atom1 = atom->angle_atom1;
|
||||
tagint **angle_atom2 = atom->angle_atom2;
|
||||
tagint **angle_atom3 = atom->angle_atom3;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
|
@ -216,11 +217,12 @@ int AtomVec::pack_angle(int **buf)
|
|||
write angle info to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::write_angle(FILE *fp, int n, int **buf, int index)
|
||||
void AtomVec::write_angle(FILE *fp, int n, tagint **buf, int index)
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
fprintf(fp,"%d %d %d %d %d\n",index,
|
||||
buf[i][0],buf[i][1],buf[i][2],buf[i][3]);
|
||||
fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT "\n",
|
||||
index,buf[i][0],buf[i][1],buf[i][2],buf[i][3]);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
@ -229,15 +231,15 @@ void AtomVec::write_angle(FILE *fp, int n, int **buf, int index)
|
|||
pack dihedral info for data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::pack_dihedral(int **buf)
|
||||
void AtomVec::pack_dihedral(tagint **buf)
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *num_dihedral = atom->num_dihedral;
|
||||
int **dihedral_type = atom->dihedral_type;
|
||||
int **dihedral_atom1 = atom->dihedral_atom1;
|
||||
int **dihedral_atom2 = atom->dihedral_atom2;
|
||||
int **dihedral_atom3 = atom->dihedral_atom3;
|
||||
int **dihedral_atom4 = atom->dihedral_atom4;
|
||||
tagint **dihedral_atom1 = atom->dihedral_atom1;
|
||||
tagint **dihedral_atom2 = atom->dihedral_atom2;
|
||||
tagint **dihedral_atom3 = atom->dihedral_atom3;
|
||||
tagint **dihedral_atom4 = atom->dihedral_atom4;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
|
@ -271,11 +273,12 @@ void AtomVec::pack_dihedral(int **buf)
|
|||
write dihedral info to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::write_dihedral(FILE *fp, int n, int **buf, int index)
|
||||
void AtomVec::write_dihedral(FILE *fp, int n, tagint **buf, int index)
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
fprintf(fp,"%d %d %d %d %d %d\n",index,
|
||||
buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
|
||||
index,buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
@ -284,15 +287,15 @@ void AtomVec::write_dihedral(FILE *fp, int n, int **buf, int index)
|
|||
pack improper info for data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::pack_improper(int **buf)
|
||||
void AtomVec::pack_improper(tagint **buf)
|
||||
{
|
||||
int *tag = atom->tag;
|
||||
tagint *tag = atom->tag;
|
||||
int *num_improper = atom->num_improper;
|
||||
int **improper_type = atom->improper_type;
|
||||
int **improper_atom1 = atom->improper_atom1;
|
||||
int **improper_atom2 = atom->improper_atom2;
|
||||
int **improper_atom3 = atom->improper_atom3;
|
||||
int **improper_atom4 = atom->improper_atom4;
|
||||
tagint **improper_atom1 = atom->improper_atom1;
|
||||
tagint **improper_atom2 = atom->improper_atom2;
|
||||
tagint **improper_atom3 = atom->improper_atom3;
|
||||
tagint **improper_atom4 = atom->improper_atom4;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
|
@ -326,11 +329,12 @@ void AtomVec::pack_improper(int **buf)
|
|||
write improper info to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::write_improper(FILE *fp, int n, int **buf, int index)
|
||||
void AtomVec::write_improper(FILE *fp, int n, tagint **buf, int index)
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
fprintf(fp,"%d %d %d %d %d %d\n",index,
|
||||
buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
|
||||
index,buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,14 +99,14 @@ class AtomVec : protected Pointers {
|
|||
virtual int write_vel_hybrid(FILE *, double *) {return 0;}
|
||||
|
||||
void reset();
|
||||
int pack_bond(int **);
|
||||
void write_bond(FILE *, int, int **, int);
|
||||
int pack_angle(int **);
|
||||
void write_angle(FILE *, int, int **, int);
|
||||
void pack_dihedral(int **);
|
||||
void write_dihedral(FILE *, int, int **, int);
|
||||
void pack_improper(int **);
|
||||
void write_improper(FILE *, int, int **, int);
|
||||
int pack_bond(tagint **);
|
||||
void write_bond(FILE *, int, tagint **, int);
|
||||
int pack_angle(tagint **);
|
||||
void write_angle(FILE *, int, tagint **, int);
|
||||
void pack_dihedral(tagint **);
|
||||
void write_dihedral(FILE *, int, tagint **, int);
|
||||
void pack_improper(tagint **);
|
||||
void write_improper(FILE *, int, tagint **, int);
|
||||
|
||||
virtual bigint memory_usage() = 0;
|
||||
|
||||
|
@ -128,8 +128,8 @@ class AtomVec : protected Pointers {
|
|||
// the cast prevents compiler warnings about possible truncation
|
||||
|
||||
union ubuf {
|
||||
double d;
|
||||
int64_t i;
|
||||
double d;
|
||||
int64_t i;
|
||||
ubuf(double arg) : d(arg) {}
|
||||
ubuf(int64_t arg) : i(arg) {}
|
||||
ubuf(int arg) : i(arg) {}
|
||||
|
|
|
@ -402,7 +402,7 @@ void AtomVecAtomic::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ void AtomVecAtomic::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
v[i][0] = buf[m++];
|
||||
|
@ -481,7 +481,7 @@ int AtomVecAtomic::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -560,7 +560,7 @@ int AtomVecAtomic::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -613,10 +613,7 @@ void AtomVecAtomic::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -661,8 +658,8 @@ void AtomVecAtomic::pack_data(double **buf)
|
|||
void AtomVecAtomic::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],buf[i][3],buf[i][4],
|
||||
(int) ubuf(buf[i][5]).i,(int) ubuf(buf[i][6]).i,
|
||||
(int) ubuf(buf[i][7]).i);
|
||||
|
|
|
@ -53,7 +53,8 @@ class AtomVecAtomic : public AtomVec {
|
|||
bigint memory_usage();
|
||||
|
||||
protected:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
};
|
||||
|
|
|
@ -834,7 +834,7 @@ void AtomVecBody::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
body[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -882,7 +882,7 @@ void AtomVecBody::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
body[i] = (int) ubuf(buf[m++]).i;
|
||||
|
@ -1027,7 +1027,7 @@ int AtomVecBody::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -1176,7 +1176,7 @@ int AtomVecBody::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -1305,10 +1305,7 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -1442,8 +1439,8 @@ int AtomVecBody::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecBody::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %d %g %g %g %g %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %d %g %g %g %g %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
(int) ubuf(buf[i][2]).i,
|
||||
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
|
||||
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
|
||||
|
@ -1497,8 +1494,8 @@ int AtomVecBody::pack_vel_hybrid(int i, double *buf)
|
|||
void AtomVecBody::write_vel(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %g %g %g %g %g %g\n",
|
||||
(int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
|
||||
fprintf(fp,TAGINT_FORMAT " %g %g %g %g %g %g\n",
|
||||
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
|
||||
buf[i][4],buf[i][5],buf[i][6]);
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,8 @@ class AtomVecBody : public AtomVec {
|
|||
void data_body(int, int, int, char **, char **);
|
||||
|
||||
private:
|
||||
int *tag,*type,*mask;
|
||||
tagint *tag;
|
||||
int *type,*mask;
|
||||
imageint *image;
|
||||
double **x,**v,**f;
|
||||
double *rmass;
|
||||
|
|
|
@ -428,7 +428,7 @@ void AtomVecCharge::unpack_border(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -453,7 +453,7 @@ void AtomVecCharge::unpack_border_vel(int n, int first, double *buf)
|
|||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = (int) ubuf(buf[m++]).i;
|
||||
tag[i] = (tagint) ubuf(buf[m++]).i;
|
||||
type[i] = (int) ubuf(buf[m++]).i;
|
||||
mask[i] = (int) ubuf(buf[m++]).i;
|
||||
q[i] = buf[m++];
|
||||
|
@ -524,7 +524,7 @@ int AtomVecCharge::unpack_exchange(double *buf)
|
|||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -607,7 +607,7 @@ int AtomVecCharge::unpack_restart(double *buf)
|
|||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
type[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
mask[nlocal] = (int) ubuf(buf[m++]).i;
|
||||
image[nlocal] = (imageint) ubuf(buf[m++]).i;
|
||||
|
@ -664,10 +664,7 @@ void AtomVecCharge::data_atom(double *coord, imageint imagetmp, char **values)
|
|||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = atoi(values[0]);
|
||||
if (tag[nlocal] <= 0)
|
||||
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
|
||||
|
||||
tag[nlocal] = ATOTAGINT(values[0]);
|
||||
type[nlocal] = atoi(values[1]);
|
||||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one(FLERR,"Invalid atom type in Atoms section of data file");
|
||||
|
@ -737,8 +734,8 @@ int AtomVecCharge::pack_data_hybrid(int i, double *buf)
|
|||
void AtomVecCharge::write_data(FILE *fp, int n, double **buf)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
fprintf(fp,TAGINT_FORMAT " %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
|
||||
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
|
||||
buf[i][2],buf[i][3],buf[i][4],buf[i][5],
|
||||
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
|
||||
(int) ubuf(buf[i][8]).i);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue