Moving temp/heat keywords out of dump to compute prop/atom

This commit is contained in:
jtclemm
2024-02-23 14:31:40 -07:00
parent fef2150bfb
commit dd4cd240df
10 changed files with 64 additions and 63 deletions

View File

@ -205,6 +205,14 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
if (!atom->omega_flag)
error->all(FLERR,"Compute property/atom {} is not available", arg[iarg]);
pack_choice[i] = &ComputePropertyAtom::pack_omegaz;
} else if (strcmp(arg[iarg],"temperature") == 0) {
if (!atom->temperature_flag)
error->all(FLERR,"Compute property/atom {} is not available", arg[iarg]);
pack_choice[i] = &ComputePropertyAtom::pack_temperature;
} else if (strcmp(arg[iarg],"heatflow") == 0) {
if (!atom->heatflow_flag)
error->all(FLERR,"Compute property/atom {} is not available", arg[iarg]);
pack_choice[i] = &ComputePropertyAtom::pack_heatflow;
} else if (strcmp(arg[iarg],"angmomx") == 0) {
if (!atom->angmom_flag)
error->all(FLERR,"Compute property/atom {} is not available", arg[iarg]);
@ -1213,6 +1221,36 @@ void ComputePropertyAtom::pack_omegaz(int n)
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_temperature(int n)
{
double *temperature = atom->temperature;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) buf[n] = temperature[i];
else buf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_heatflow(int n)
{
double *heatflow = atom->heatflow;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) buf[n] = heatflow[i];
else buf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_angmomx(int n)
{
double **angmom = atom->angmom;