whitespace fixes
This commit is contained in:
@ -136,7 +136,7 @@ When that command is used specific names are given to each attribute
|
||||
which are the "name" portion of these attributes. For arrays *i2_name*
|
||||
and *d2_name*, the column of the array must also be included following
|
||||
the name in brackets: e.g. d2_xyz[2], i2_mySpin[3].
|
||||
|
||||
|
||||
The additional quantities only accessible via this command, and not
|
||||
directly via the :doc:`dump custom <dump>` command, are as follows.
|
||||
|
||||
|
||||
@ -272,7 +272,7 @@ int AtomKokkos::add_custom(const char *name, int flag, int cols)
|
||||
ivector = (int **) memory->srealloc(ivector,nivector*sizeof(int *),
|
||||
"atom:ivector");
|
||||
memory->create(ivector[index],nmax,"atom:ivector");
|
||||
|
||||
|
||||
} else if (flag == 1 && cols == 0) {
|
||||
index = ndvector;
|
||||
ndvector++;
|
||||
@ -299,10 +299,10 @@ int AtomKokkos::add_custom(const char *name, int flag, int cols)
|
||||
iarray = (int ***) memory->srealloc(iarray,niarray*sizeof(int **),
|
||||
"atom:iarray");
|
||||
memory->create(iarray[index],nmax,cols,"atom:iarray");
|
||||
|
||||
|
||||
icols = (int *) memory->srealloc(icols,niarray*sizeof(int),"atom:icols");
|
||||
icols[index] = cols;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols) {
|
||||
index = ndarray;
|
||||
ndarray++;
|
||||
@ -318,7 +318,7 @@ int AtomKokkos::add_custom(const char *name, int flag, int cols)
|
||||
dcols = (int *) memory->srealloc(dcols,ndarray*sizeof(int),"atom:dcols");
|
||||
dcols[index] = cols;
|
||||
}
|
||||
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -335,7 +335,7 @@ void AtomKokkos::remove_custom(int index, int flag, int cols)
|
||||
ivector[index] = NULL;
|
||||
delete [] ivname[index];
|
||||
ivname[index] = NULL;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols == 0) {
|
||||
dvector[index] = NULL;
|
||||
delete [] dvname[index];
|
||||
@ -346,7 +346,7 @@ void AtomKokkos::remove_custom(int index, int flag, int cols)
|
||||
iarray[index] = NULL;
|
||||
delete [] ianame[index];
|
||||
ianame[index] = NULL;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols) {
|
||||
memory->destroy(darray[index]);
|
||||
darray[index] = NULL;
|
||||
|
||||
@ -757,7 +757,7 @@ int DumpVTK::count()
|
||||
i = ATTRIBUTES + nfield + ithresh;
|
||||
iwhich = atom->find_custom(id_custom[field2index[i]],flag,cols);
|
||||
int *ivector = atom->ivector[iwhich];
|
||||
for (i = 0; i < nlocal; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
dchoose[i] = ivector[i];
|
||||
ptr = dchoose;
|
||||
nstride = 1;
|
||||
@ -775,7 +775,7 @@ int DumpVTK::count()
|
||||
iwhich = atom->find_custom(id_custom[field2index[i]],flag,cols);
|
||||
int **iarray = atom->iarray[iwhich];
|
||||
int icol = argindex[i] - 1;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
for (i = 0; i < nlocal; i++)
|
||||
dchoose[i] = iarray[i][icol];
|
||||
ptr = dchoose;
|
||||
nstride = 1;
|
||||
@ -1827,7 +1827,7 @@ int DumpVTK::parse_fields(int narg, char **arg)
|
||||
field2index[ATTRIBUTES+i] = add_variable(argi.get_name());
|
||||
name[ATTRIBUTES+i] = arg[iarg];
|
||||
break;
|
||||
|
||||
|
||||
// custom per-atom integer vector = i_ID
|
||||
|
||||
case ArgInfo::INAME:
|
||||
|
||||
24
src/atom.cpp
24
src/atom.cpp
@ -2481,7 +2481,7 @@ int Atom::add_custom(const char *name, int flag, int cols)
|
||||
ivector = (int **) memory->srealloc(ivector,nivector*sizeof(int *),
|
||||
"atom:ivector");
|
||||
memory->create(ivector[index],nmax,"atom:ivector");
|
||||
|
||||
|
||||
} else if (flag == 1 && cols == 0) {
|
||||
index = ndvector;
|
||||
ndvector++;
|
||||
@ -2501,10 +2501,10 @@ int Atom::add_custom(const char *name, int flag, int cols)
|
||||
iarray = (int ***) memory->srealloc(iarray,niarray*sizeof(int **),
|
||||
"atom:iarray");
|
||||
memory->create(iarray[index],nmax,cols,"atom:iarray");
|
||||
|
||||
|
||||
icols = (int *) memory->srealloc(icols,niarray*sizeof(int),"atom:icols");
|
||||
icols[index] = cols;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols) {
|
||||
index = ndarray;
|
||||
ndarray++;
|
||||
@ -2518,7 +2518,7 @@ int Atom::add_custom(const char *name, int flag, int cols)
|
||||
dcols = (int *) memory->srealloc(dcols,ndarray*sizeof(int),"atom:dcols");
|
||||
dcols[index] = cols;
|
||||
}
|
||||
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -2542,7 +2542,7 @@ void Atom::remove_custom(int index, int flag, int cols)
|
||||
ivector[index] = NULL;
|
||||
delete [] ivname[index];
|
||||
ivname[index] = NULL;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols == 0) {
|
||||
memory->destroy(dvector[index]);
|
||||
dvector[index] = NULL;
|
||||
@ -2554,7 +2554,7 @@ void Atom::remove_custom(int index, int flag, int cols)
|
||||
iarray[index] = NULL;
|
||||
delete [] ianame[index];
|
||||
ianame[index] = NULL;
|
||||
|
||||
|
||||
} else if (flag == 1 && cols) {
|
||||
memory->destroy(darray[index]);
|
||||
darray[index] = NULL;
|
||||
@ -2762,7 +2762,7 @@ void *Atom::extract(const char *name)
|
||||
if (strcmp(name, "damage") == 0) return (void *) damage;
|
||||
|
||||
// DPD-REACT pakage
|
||||
|
||||
|
||||
if (strcmp(name,"dpdTheta") == 0) return (void *) dpdTheta;
|
||||
|
||||
// DPD-MESO package
|
||||
@ -2790,15 +2790,15 @@ void *Atom::extract(const char *name)
|
||||
if (name[0] == 'd') which = 1;
|
||||
int array = 0;
|
||||
if (name[1] == '2') array = 1;
|
||||
|
||||
|
||||
int index,flag,cols;
|
||||
if (!array) index = find_custom(&name[2],flag,cols);
|
||||
else index = find_custom(&name[3],flag,cols);
|
||||
|
||||
|
||||
if (index < 0) return NULL;
|
||||
if (which != flag) return NULL;
|
||||
if ((!array && cols) || (array && !cols)) return NULL;
|
||||
|
||||
|
||||
if (!which && !array) return (void *) ivector[index];
|
||||
if (which && !array) return (void *) dvector[index];
|
||||
if (!which && array) return (void *) iarray[index];
|
||||
@ -2906,14 +2906,14 @@ int Atom::extract_datatype(const char *name)
|
||||
|
||||
// custom vectors and arrays
|
||||
// OLDSTYLE code
|
||||
|
||||
|
||||
if (strstr(name,"i_") == name || strstr(name,"d_") == name ||
|
||||
strstr(name,"i2_") == name || strstr(name,"d2_") == name) {
|
||||
int which = 0;
|
||||
if (name[0] == 'd') which = 1;
|
||||
int array = 0;
|
||||
if (name[1] == '2') array = 1;
|
||||
|
||||
|
||||
int index,flag,cols;
|
||||
if (!array) index = find_custom(&name[2],flag,cols);
|
||||
else index = find_custom(&name[3],flag,cols);
|
||||
|
||||
@ -147,8 +147,8 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_mu;
|
||||
|
||||
// pack magnetic variables
|
||||
|
||||
} else if (strcmp(arg[iarg],"spx") == 0) {
|
||||
|
||||
} else if (strcmp(arg[iarg],"spx") == 0) {
|
||||
if (!atom->sp_flag)
|
||||
error->all(FLERR,"Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
@ -185,7 +185,7 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_fmz;
|
||||
|
||||
// bond count
|
||||
|
||||
|
||||
} else if (strcmp(arg[iarg],"nbonds") == 0) {
|
||||
if (!atom->molecule_flag)
|
||||
error->all(FLERR,"Compute property/atom for "
|
||||
@ -193,7 +193,7 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_nbonds;
|
||||
|
||||
// finite-size particles
|
||||
|
||||
|
||||
} else if (strcmp(arg[iarg],"radius") == 0) {
|
||||
if (!atom->radius_flag)
|
||||
error->all(FLERR,"Compute property/atom for "
|
||||
@ -401,11 +401,11 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// custom per-atom arrays, must include bracketed index
|
||||
// OLDSTYLE code
|
||||
|
||||
} else if (strstr(arg[iarg],"i2_") == arg[iarg] ||
|
||||
} else if (strstr(arg[iarg],"i2_") == arg[iarg] ||
|
||||
strstr(arg[iarg],"d2_") == arg[iarg]) {
|
||||
int which = 0;
|
||||
if (arg[iarg][0] == 'd') which = 1;
|
||||
|
||||
|
||||
int n = strlen(arg[iarg]);
|
||||
char *suffix = new char[n];
|
||||
strcpy(suffix,&arg[iarg][3]);
|
||||
@ -418,7 +418,7 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
colindex[i] = utils::inumeric(FLERR,ptr+1,true,lmp);
|
||||
*ptr = '\0';
|
||||
} else error->all(FLERR,"Compute property/atom custom array is not indexed");
|
||||
|
||||
|
||||
int flag,cols;
|
||||
index[i] = atom->find_custom(suffix,flag,cols);
|
||||
delete [] suffix;
|
||||
|
||||
@ -109,7 +109,7 @@ class ComputePropertyAtom : public Compute {
|
||||
void pack_tqx(int);
|
||||
void pack_tqy(int);
|
||||
void pack_tqz(int);
|
||||
|
||||
|
||||
void pack_end1x(int);
|
||||
void pack_end1y(int);
|
||||
void pack_end1z(int);
|
||||
|
||||
@ -1046,7 +1046,7 @@ int DumpCustom::count()
|
||||
int iwhich = custom[field2index[i]];
|
||||
ptr = atom->dvector[iwhich];
|
||||
nstride = 1;
|
||||
|
||||
|
||||
} else if (thresh_array[ithresh] == IARRAY) {
|
||||
i = nfield + ithresh;
|
||||
int iwhich = custom[field2index[i]];
|
||||
@ -1977,12 +1977,12 @@ int DumpCustom::modify_param(int narg, char **arg)
|
||||
"Dump custom property array is accessed out-of-range");
|
||||
thresh_array[nthresh] = DARRAY;
|
||||
}
|
||||
|
||||
|
||||
field2index[nfield+nthresh] = add_custom(name,0);
|
||||
break;
|
||||
|
||||
// custom per atom integer vector or array
|
||||
|
||||
|
||||
case ArgInfo::INAME:
|
||||
n = atom->find_custom(name,flag,cols);
|
||||
|
||||
@ -2015,7 +2015,7 @@ int DumpCustom::modify_param(int narg, char **arg)
|
||||
}
|
||||
|
||||
// set operation type of threshold
|
||||
|
||||
|
||||
if (strcmp(arg[2],"<") == 0) thresh_op[nthresh] = LT;
|
||||
else if (strcmp(arg[2],"<=") == 0) thresh_op[nthresh] = LE;
|
||||
else if (strcmp(arg[2],">") == 0) thresh_op[nthresh] = GT;
|
||||
@ -2024,11 +2024,11 @@ int DumpCustom::modify_param(int narg, char **arg)
|
||||
else if (strcmp(arg[2],"!=") == 0) thresh_op[nthresh] = NEQ;
|
||||
else if (strcmp(arg[2],"|^") == 0) thresh_op[nthresh] = XOR;
|
||||
else error->all(FLERR,"Invalid dump_modify thresh operator");
|
||||
|
||||
|
||||
// set threshold value as number or special LAST keyword
|
||||
// create FixStore to hold LAST values, should work with restart
|
||||
// id = dump-ID + nthreshlast + DUMP_STORE, fix group = dump group
|
||||
|
||||
|
||||
if (strcmp(arg[3],"LAST") != 0) {
|
||||
thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp);
|
||||
thresh_last[nthresh] = -1;
|
||||
@ -2038,17 +2038,17 @@ int DumpCustom::modify_param(int narg, char **arg)
|
||||
thresh_fixID = (char **)
|
||||
memory->srealloc(thresh_fixID,(nthreshlast+1)*sizeof(char *),"dump:thresh_fixID");
|
||||
memory->grow(thresh_first,(nthreshlast+1),"dump:thresh_first");
|
||||
|
||||
|
||||
std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast);
|
||||
thresh_fixID[nthreshlast] = utils::strdup(threshid);
|
||||
threshid += fmt::format(" {} STORE peratom 1 1", group->names[igroup]);
|
||||
thresh_fix[nthreshlast] = (FixStore *) modify->add_fix(threshid);
|
||||
|
||||
|
||||
thresh_last[nthreshlast] = nthreshlast;
|
||||
thresh_first[nthreshlast] = 1;
|
||||
nthreshlast++;
|
||||
}
|
||||
|
||||
|
||||
nthresh++;
|
||||
return 4;
|
||||
}
|
||||
@ -2135,7 +2135,7 @@ void DumpCustom::pack_custom(int n)
|
||||
int flag = custom_flag[field2index[n]];
|
||||
int iwhich = custom[field2index[n]];
|
||||
int index = argindex[n];
|
||||
|
||||
|
||||
if (flag == IVEC) {
|
||||
int *ivector = atom->ivector[iwhich];
|
||||
for (int i = 0; i < nchoose; i++) {
|
||||
|
||||
@ -61,7 +61,7 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
||||
delete [] idregion;
|
||||
idregion = utils::strdup(arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
|
||||
} else if (strcmp(arg[iarg],"var") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||
if (input->variable->find(arg[iarg+1]) < 0)
|
||||
@ -70,19 +70,19 @@ idregion(nullptr), idvar(nullptr), idprop(nullptr)
|
||||
delete [] idvar;
|
||||
idvar = utils::strdup(arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
|
||||
} else if (strcmp(arg[iarg],"property") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||
int flag,cols;
|
||||
iprop = atom->find_custom(arg[iarg+1],flag,cols);
|
||||
if (iprop < 1 || cols)
|
||||
if (iprop < 1 || cols)
|
||||
error->all(FLERR,"Custom per-atom vector for group dynamic "
|
||||
"does not exist");
|
||||
propflag = 1;
|
||||
delete [] idprop;
|
||||
idprop = utils::strdup(arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
|
||||
} else if (strcmp(arg[iarg],"every") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal group command");
|
||||
nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
|
||||
|
||||
@ -50,7 +50,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
nvalue = 0;
|
||||
values_peratom = 0;
|
||||
|
||||
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"mol") == 0) {
|
||||
if (atom->molecule_flag)
|
||||
@ -114,7 +114,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// custom atom array
|
||||
// OLDSTYLE code
|
||||
|
||||
} else if (strstr(arg[iarg],"i2_") == arg[iarg] ||
|
||||
} else if (strstr(arg[iarg],"i2_") == arg[iarg] ||
|
||||
strstr(arg[iarg],"d2_") == arg[iarg]) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix property/atom command");
|
||||
int which = 0;
|
||||
@ -539,7 +539,7 @@ void FixPropertyAtom::grow_arrays(int nmax)
|
||||
void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/)
|
||||
{
|
||||
int k,ncol;
|
||||
|
||||
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE)
|
||||
atom->molecule[j] = atom->molecule[i];
|
||||
@ -697,15 +697,15 @@ int FixPropertyAtom::pack_exchange(int i, double *buf)
|
||||
else if (style[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i];
|
||||
else if (style[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = atom->darray[index[nv]][i][k];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -731,15 +731,15 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf)
|
||||
atom->dvector[index[nv]][nlocal] = buf[m++];
|
||||
else if (style[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->darray[index[nv]][nlocal][k] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -750,9 +750,9 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf)
|
||||
int FixPropertyAtom::pack_restart(int i, double *buf)
|
||||
{
|
||||
int k,ncol;
|
||||
|
||||
|
||||
// pack buf[0] this way because other fixes unpack it
|
||||
|
||||
|
||||
buf[0] = values_peratom+1;
|
||||
|
||||
int m = 1;
|
||||
|
||||
@ -293,7 +293,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else if (which[i] == ArgInfo::DNAME) {
|
||||
int icustom,iflag,icol;
|
||||
icustom = atom->find_custom(ids[i],iflag,icol);
|
||||
if (icustom < 0)
|
||||
if (icustom < 0)
|
||||
error->all(FLERR,"Custom vector/array for fix store/state does not exist");
|
||||
if (argindex[i] == 0) {
|
||||
if (!iflag || icol)
|
||||
@ -311,7 +311,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else if (which[i] == ArgInfo::INAME) {
|
||||
int icustom,iflag,icol;
|
||||
icustom = atom->find_custom(ids[i],iflag,icol);
|
||||
if (icustom < 0)
|
||||
if (icustom < 0)
|
||||
error->all(FLERR,"Custom vector/array for fix store/state does not exist");
|
||||
if (argindex[i] == 0) {
|
||||
if (iflag || icol)
|
||||
@ -417,7 +417,7 @@ void FixStoreState::init()
|
||||
} else if (which[m] == ArgInfo::INAME || which[m] == ArgInfo::DNAME) {
|
||||
int icustom,iflag,cols;
|
||||
icustom = atom->find_custom(ids[m],iflag,cols);
|
||||
if (icustom < 0)
|
||||
if (icustom < 0)
|
||||
error->all(FLERR,"Custom vector/array for fix store/state does not exist");
|
||||
value2index[m] = icustom;
|
||||
}
|
||||
|
||||
@ -2834,7 +2834,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
int i,j,offset,fcid,ltype,icol;
|
||||
|
||||
// error if tags are not defined or not consecutive
|
||||
|
||||
|
||||
int flag = 0;
|
||||
if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0)
|
||||
flag = 1;
|
||||
@ -2849,7 +2849,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
void *vptr = lmp->atom->extract(name);
|
||||
|
||||
// fix
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^f_")) {
|
||||
|
||||
fcid = lmp->modify->find_fix(&name[2]);
|
||||
@ -2884,7 +2884,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
}
|
||||
|
||||
// compute
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^c_")) {
|
||||
|
||||
fcid = lmp->modify->find_compute(&name[2]);
|
||||
@ -2913,7 +2913,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
if (count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom;
|
||||
else vptr = (void *) lmp->modify->compute[fcid]->array_atom;
|
||||
}
|
||||
|
||||
|
||||
// custom fix property/atom vector or array
|
||||
// OLDSTYLE code
|
||||
|
||||
@ -2930,7 +2930,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
lmp->error->warning(FLERR,"lammps_gather: unknown property/atom id");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ltype != type) {
|
||||
if (lmp->comm->me == 0)
|
||||
lmp->error->warning(FLERR,"lammps_gather: mismatch property/atom type");
|
||||
@ -2950,7 +2950,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
if (count == 1) {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->ivector[fcid];
|
||||
else vptr = (void *) lmp->atom->dvector[fcid];
|
||||
} else {
|
||||
} else {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->iarray[fcid];
|
||||
else vptr = (void *) lmp->atom->darray[fcid];
|
||||
}
|
||||
@ -2963,11 +2963,11 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data)
|
||||
lmp->error->warning(FLERR,"lammps_gather: undefined property name");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// copy = Natom length vector of per-atom values
|
||||
// use atom ID to insert each atom's values into copy
|
||||
// MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID
|
||||
|
||||
|
||||
if (type==0) {
|
||||
int *vector = nullptr;
|
||||
int **array = nullptr;
|
||||
@ -3078,7 +3078,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d
|
||||
int i,offset,fcid,ltype,icol;
|
||||
|
||||
// error if tags are not defined or not consecutive
|
||||
|
||||
|
||||
int flag = 0;
|
||||
if (lmp->atom->tag_enable == 0) flag = 1;
|
||||
if (lmp->atom->natoms > MAXSMALLINT) flag = 1;
|
||||
@ -3126,7 +3126,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d
|
||||
}
|
||||
|
||||
// compute
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^c_")) {
|
||||
|
||||
fcid = lmp->modify->find_compute(&name[2]);
|
||||
@ -3162,7 +3162,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d
|
||||
if ((vptr==nullptr) &&
|
||||
((strstr(name,"d_") == name) || (strstr(name,"i_") == name) ||
|
||||
(strstr(name,"d2_") == name) || (strstr(name,"i2_") == name))) {
|
||||
|
||||
|
||||
if ((strstr(name,"d_") == name) || (strstr(name,"i_") == name))
|
||||
fcid = lmp->atom->find_custom(&name[2],ltype,icol);
|
||||
else fcid = lmp->atom->find_custom(&name[3],ltype,icol);
|
||||
@ -3173,7 +3173,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d
|
||||
"unknown property/atom id");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ltype != type) {
|
||||
if (lmp->comm->me == 0)
|
||||
lmp->error->warning(FLERR,"lammps_gather_concat: "
|
||||
@ -3221,7 +3221,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d
|
||||
if (type == 0) {
|
||||
int *vector = nullptr;
|
||||
int **array = nullptr;
|
||||
|
||||
|
||||
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
|
||||
|
||||
if ((count == 1) || imgunpack) vector = (int *) vptr;
|
||||
@ -3345,7 +3345,7 @@ void lammps_gather_subset(void *handle, char *name,
|
||||
tagint id;
|
||||
|
||||
// error if tags are not defined or not consecutive
|
||||
|
||||
|
||||
int flag = 0;
|
||||
if (lmp->atom->tag_enable == 0) flag = 1;
|
||||
if (lmp->atom->natoms > MAXSMALLINT) flag = 1;
|
||||
@ -3358,7 +3358,7 @@ void lammps_gather_subset(void *handle, char *name,
|
||||
void *vptr = lmp->atom->extract(name);
|
||||
|
||||
// fix
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^f_")) {
|
||||
|
||||
fcid = lmp->modify->find_fix(&name[2]);
|
||||
@ -3391,7 +3391,7 @@ void lammps_gather_subset(void *handle, char *name,
|
||||
}
|
||||
|
||||
// compute
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^c_")) {
|
||||
|
||||
fcid = lmp->modify->find_compute(&name[2]);
|
||||
@ -3438,7 +3438,7 @@ void lammps_gather_subset(void *handle, char *name,
|
||||
"unknown property/atom id");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ltype != type) {
|
||||
if (lmp->comm->me == 0)
|
||||
lmp->error->warning(FLERR,"lammps_gather_subset: "
|
||||
@ -3529,7 +3529,7 @@ void lammps_gather_subset(void *handle, char *name,
|
||||
} else {
|
||||
double *vector = nullptr;
|
||||
double **array = nullptr;
|
||||
|
||||
|
||||
if (count == 1) vector = (double *) vptr;
|
||||
else array = (double **) vptr;
|
||||
|
||||
@ -3619,7 +3619,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data)
|
||||
void *vptr = lmp->atom->extract(name);
|
||||
|
||||
// fix
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^f_")) {
|
||||
|
||||
fcid = lmp->modify->find_fix(&name[2]);
|
||||
@ -3647,7 +3647,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data)
|
||||
}
|
||||
|
||||
// compute
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^c_")) {
|
||||
|
||||
fcid = lmp->modify->find_compute(&name[2]);
|
||||
@ -3679,7 +3679,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data)
|
||||
|
||||
// custom fix property/atom vector or array
|
||||
// OLDSTYLE code
|
||||
|
||||
|
||||
if ((vptr == nullptr) &&
|
||||
((strstr(name,"d_") == name) || (strstr(name,"i_") == name) ||
|
||||
(strstr(name,"d2_") == name) || (strstr(name,"i2_") == name))) {
|
||||
@ -3693,7 +3693,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data)
|
||||
lmp->error->warning(FLERR,"lammps_scatter: unknown property/atom id");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ltype != type) {
|
||||
if (lmp->comm->me == 0)
|
||||
lmp->error->warning(FLERR,"lammps_scatter: mismatch property/atom type");
|
||||
@ -3713,7 +3713,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data)
|
||||
if (count == 1) {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->ivector[fcid];
|
||||
else vptr = (void *) lmp->atom->dvector[fcid];
|
||||
} else {
|
||||
} else {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->iarray[fcid];
|
||||
else vptr = (void *) lmp->atom->darray[fcid];
|
||||
}
|
||||
@ -3843,7 +3843,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count,
|
||||
void *vptr = lmp->atom->extract(name);
|
||||
|
||||
// fix
|
||||
|
||||
|
||||
if (vptr==nullptr && utils::strmatch(name,"^f_")) {
|
||||
|
||||
fcid = lmp->modify->find_fix(&name[2]);
|
||||
@ -3903,7 +3903,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count,
|
||||
|
||||
// custom fix property/atom vector or array
|
||||
// OLDSTYLE code
|
||||
|
||||
|
||||
if ((vptr == nullptr) &&
|
||||
((strstr(name,"d_") == name) || (strstr(name,"i_") == name) ||
|
||||
(strstr(name,"d2_") == name) || (strstr(name,"i2_") == name))) {
|
||||
@ -3918,7 +3918,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count,
|
||||
"unknown property/atom id");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ltype != type) {
|
||||
if (lmp->comm->me == 0)
|
||||
lmp->error->warning(FLERR,"lammps_scatter_subset: "
|
||||
@ -3939,7 +3939,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count,
|
||||
if (count == 1) {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->ivector[fcid];
|
||||
else vptr = (void *) lmp->atom->dvector[fcid];
|
||||
} else {
|
||||
} else {
|
||||
if (ltype==0) vptr = (void *) lmp->atom->iarray[fcid];
|
||||
else vptr = (void *) lmp->atom->darray[fcid];
|
||||
}
|
||||
|
||||
@ -581,7 +581,7 @@ void Set::command(int narg, char **arg)
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
|
||||
index_custom = atom->find_custom(argi.get_name(),flag,cols);
|
||||
if (index_custom < 0) error->all(FLERR,"Custom property {} does not exist",pname);
|
||||
|
||||
|
||||
switch (argi.get_type()) {
|
||||
|
||||
case ArgInfo::INAME:
|
||||
@ -1025,7 +1025,7 @@ void Set::set(int keyword)
|
||||
}
|
||||
|
||||
// update bonus data numbers
|
||||
|
||||
|
||||
if (keyword == SHAPE) {
|
||||
bigint nlocal_bonus = avec_ellipsoid->nlocal_bonus;
|
||||
MPI_Allreduce(&nlocal_bonus,&atom->nellipsoids,1,
|
||||
|
||||
@ -633,15 +633,15 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod
|
||||
expandflag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if (arg[iarg][0] == 'd') {
|
||||
*ptr1 = '\0';
|
||||
int flag,cols;
|
||||
int icustom = lmp->atom->find_custom(&arg[iarg][3],flag,cols);
|
||||
*ptr1 = '[';
|
||||
|
||||
|
||||
// check for custom per-atom floating point array
|
||||
|
||||
|
||||
if (icustom >= 0) {
|
||||
if (mode == 1 && flag && cols) {
|
||||
nmax = cols;
|
||||
|
||||
Reference in New Issue
Block a user