enable write_data for atom styles with bonus data

This commit is contained in:
Steve Plimpton
2020-07-06 17:30:45 -06:00
parent 6bf329098e
commit 7918919d30
15 changed files with 447 additions and 128 deletions

View File

@ -579,6 +579,45 @@ void AtomVecBody::pack_data_pre(int ilocal)
else body[ilocal] = 1;
}
/* ----------------------------------------------------------------------
pack bonus body info for writing to data file
if buf is NULL, just return count of bodies
------------------------------------------------------------------------- */
int AtomVecBody::pack_data_bonus(double **buf, int /*flag*/)
{
int i,j;
tagint *tag = atom->tag;
int nlocal = atom->nlocal;
// NOTE: needs to call Body sub-class to fill buffer
int m = 0;
for (i = 0; i < nlocal; i++) {
if (body[i] < 0) continue;
if (buf) {
buf[m][0] = ubuf(tag[i]).d;
j = body[i];
}
m++;
}
return m;
}
/* ----------------------------------------------------------------------
write bonus body info to data file
------------------------------------------------------------------------- */
void AtomVecBody::write_data_bonus(FILE *fp, int n, double **buf, int /*flag*/)
{
// NOTE: needs to call Body sub-class to do the write
for (int i = 0; i < n; i++) {
}
}
/* ----------------------------------------------------------------------
unmodify values packed by AtomVec::pack_data()
------------------------------------------------------------------------- */