Handle mass better

This commit is contained in:
Francois-Xavier Coudert
2025-03-27 20:14:29 +01:00
parent dcb844b01b
commit 032c1c39b0

View File

@ -145,6 +145,7 @@ void DumpExtXYZ::pack(tagint *ids)
double **v = atom->v;
double **f = atom->f;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
m = n = 0;
@ -166,8 +167,12 @@ void DumpExtXYZ::pack(tagint *ids)
buf[m++] = f[i][2];
}
if (with_mass) {
if (rmass) {
buf[m++] = rmass[i];
} else {
buf[m++] = mass[type[i]];
}
}
if (ids) ids[n++] = tag[i];
}