diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index fada7e953b..3ca6082867 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -355,19 +355,19 @@ void FixStoreState::init() if (which[m] == COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) - error->all("Compute ID for fix ave/atom does not exist"); + error->all("Compute ID for fix store/state does not exist"); value2index[m] = icompute; } else if (which[m] == FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) - error->all("Fix ID for fix ave/atom does not exist"); + error->all("Fix ID for fix store/state does not exist"); value2index[m] = ifix; } else if (which[m] == VARIABLE) { int ivariable = input->variable->find(ids[m]); if (ivariable < 0) - error->all("Variable name for fix ave/atom does not exist"); + error->all("Variable name for fix store/state does not exist"); value2index[m] = ivariable; } } @@ -407,8 +407,8 @@ void FixStoreState::end_of_step() // fill vector or array with per-atom values - if (values) buf = &values[0][0]; - else buf = NULL; + if (values) vbuf = &values[0][0]; + else vbuf = NULL; for (int m = 0; m < nvalues; m++) { if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); @@ -487,7 +487,7 @@ void FixStoreState::grow_arrays(int nmax) { values = memory->grow_2d_double_array(values,nmax,nvalues, "fix_store:values"); - if (nvalues == 0) { + if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; else vector_atom = NULL; } else array_atom = values; @@ -583,8 +583,8 @@ void FixStoreState::pack_id(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = tag[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = tag[i]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -598,8 +598,8 @@ void FixStoreState::pack_molecule(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = molecule[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = molecule[i]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -613,8 +613,8 @@ void FixStoreState::pack_type(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = type[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = type[i]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -631,14 +631,14 @@ void FixStoreState::pack_mass(int n) if (rmass) { for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = rmass[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = rmass[i]; + else vbuf[n] = 0.0; n += nvalues; } } else { for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = mass[type[i]]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = mass[type[i]]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -653,8 +653,8 @@ void FixStoreState::pack_x(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = x[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = x[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -668,8 +668,8 @@ void FixStoreState::pack_y(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = x[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = x[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -683,8 +683,8 @@ void FixStoreState::pack_z(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = x[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = x[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -701,8 +701,8 @@ void FixStoreState::pack_xs(int n) double invxprd = 1.0/domain->xprd; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (x[i][0] - boxxlo) * invxprd; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (x[i][0] - boxxlo) * invxprd; + else vbuf[n] = 0.0; n += nvalues; } } @@ -719,8 +719,8 @@ void FixStoreState::pack_ys(int n) double invyprd = 1.0/domain->yprd; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (x[i][1] - boxylo) * invyprd; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (x[i][1] - boxylo) * invyprd; + else vbuf[n] = 0.0; n += nvalues; } } @@ -737,8 +737,8 @@ void FixStoreState::pack_zs(int n) double invzprd = 1.0/domain->zprd; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (x[i][2] - boxzlo) * invzprd; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (x[i][2] - boxzlo) * invzprd; + else vbuf[n] = 0.0; n += nvalues; } } @@ -756,9 +756,9 @@ void FixStoreState::pack_xs_triclinic(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) - buf[n] = h_inv[0]*(x[i][0]-boxlo[0]) + + vbuf[n] = h_inv[0]*(x[i][0]-boxlo[0]) + h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]); - else buf[n] = 0.0; + else vbuf[n] = 0.0; n += nvalues; } } @@ -776,8 +776,8 @@ void FixStoreState::pack_ys_triclinic(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) - buf[n] = h_inv[1]*(x[i][1]-boxlo[1]) + h_inv[3]*(x[i][2]-boxlo[2]); - else buf[n] = 0.0; + vbuf[n] = h_inv[1]*(x[i][1]-boxlo[1]) + h_inv[3]*(x[i][2]-boxlo[2]); + else vbuf[n] = 0.0; n += nvalues; } } @@ -795,8 +795,8 @@ void FixStoreState::pack_zs_triclinic(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) - buf[n] = h_inv[2]*(x[i][2]-boxlo[2]); - else buf[n] = 0.0; + vbuf[n] = h_inv[2]*(x[i][2]-boxlo[2]); + else vbuf[n] = 0.0; n += nvalues; } } @@ -814,9 +814,9 @@ void FixStoreState::pack_xu(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - buf[n] = x[i][0] + ((image[i] & 1023) - 512) * xprd; - if (comflag) buf[n] -= cm[0]; - } else buf[n] = 0.0; + vbuf[n] = x[i][0] + ((image[i] & 1023) - 512) * xprd; + if (comflag) vbuf[n] -= cm[0]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -834,9 +834,9 @@ void FixStoreState::pack_yu(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - buf[n] = x[i][1] + ((image[i] >> 10 & 1023) - 512) * yprd; - if (comflag) buf[n] -= cm[1]; - } else buf[n] = 0.0; + vbuf[n] = x[i][1] + ((image[i] >> 10 & 1023) - 512) * yprd; + if (comflag) vbuf[n] -= cm[1]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -854,9 +854,9 @@ void FixStoreState::pack_zu(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - buf[n] = x[i][2] + ((image[i] >> 20) - 512) * zprd; - if (comflag) buf[n] -= cm[2]; - } else buf[n] = 0.0; + vbuf[n] = x[i][2] + ((image[i] >> 20) - 512) * zprd; + if (comflag) vbuf[n] -= cm[2]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -878,9 +878,9 @@ void FixStoreState::pack_xu_triclinic(int n) xbox = (image[i] & 1023) - 512; ybox = (image[i] >> 10 & 1023) - 512; zbox = (image[i] >> 20) - 512; - buf[n] = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox; - if (comflag) buf[n] -= cm[0]; - } else buf[n] = 0.0; + vbuf[n] = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox; + if (comflag) vbuf[n] -= cm[0]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -901,9 +901,9 @@ void FixStoreState::pack_yu_triclinic(int n) if (mask[i] & groupbit) { ybox = (image[i] >> 10 & 1023) - 512; zbox = (image[i] >> 20) - 512; - buf[n] = x[i][1] + h[1]*ybox + h[3]*zbox; - if (comflag) buf[n] -= cm[1]; - } else buf[n] = 0.0; + vbuf[n] = x[i][1] + h[1]*ybox + h[3]*zbox; + if (comflag) vbuf[n] -= cm[1]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -923,9 +923,9 @@ void FixStoreState::pack_zu_triclinic(int n) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { zbox = (image[i] >> 20) - 512; - buf[n] = x[i][2] + h[2]*zbox; - if (comflag) buf[n] -= cm[2]; - } else buf[n] = 0.0; + vbuf[n] = x[i][2] + h[2]*zbox; + if (comflag) vbuf[n] -= cm[2]; + } else vbuf[n] = 0.0; n += nvalues; } } @@ -939,8 +939,8 @@ void FixStoreState::pack_ix(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (image[i] & 1023) - 512; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (image[i] & 1023) - 512; + else vbuf[n] = 0.0; n += nvalues; } } @@ -954,8 +954,8 @@ void FixStoreState::pack_iy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (image[i] >> 10 & 1023) - 512; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (image[i] >> 10 & 1023) - 512; + else vbuf[n] = 0.0; n += nvalues; } } @@ -969,8 +969,8 @@ void FixStoreState::pack_iz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = (image[i] >> 20) - 512; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = (image[i] >> 20) - 512; + else vbuf[n] = 0.0; n += nvalues; } } @@ -984,8 +984,8 @@ void FixStoreState::pack_vx(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = v[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = v[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -999,8 +999,8 @@ void FixStoreState::pack_vy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = v[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = v[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1014,8 +1014,8 @@ void FixStoreState::pack_vz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = v[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = v[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1029,8 +1029,8 @@ void FixStoreState::pack_fx(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = f[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = f[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1044,8 +1044,8 @@ void FixStoreState::pack_fy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = f[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = f[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1059,8 +1059,8 @@ void FixStoreState::pack_fz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = f[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = f[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1074,8 +1074,8 @@ void FixStoreState::pack_q(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = q[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = q[i]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1089,8 +1089,8 @@ void FixStoreState::pack_mux(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = mu[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = mu[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1104,8 +1104,8 @@ void FixStoreState::pack_muy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = mu[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = mu[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1119,8 +1119,8 @@ void FixStoreState::pack_muz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = mu[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = mu[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1134,8 +1134,8 @@ void FixStoreState::pack_radius(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = radius[i]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = radius[i]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1149,8 +1149,8 @@ void FixStoreState::pack_omegax(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = omega[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = omega[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1164,8 +1164,8 @@ void FixStoreState::pack_omegay(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = omega[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = omega[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1179,8 +1179,8 @@ void FixStoreState::pack_omegaz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = omega[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = omega[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1194,8 +1194,8 @@ void FixStoreState::pack_angmomx(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = angmom[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = angmom[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1209,8 +1209,8 @@ void FixStoreState::pack_angmomy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = angmom[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = angmom[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1224,8 +1224,8 @@ void FixStoreState::pack_angmomz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = angmom[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = angmom[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1239,8 +1239,8 @@ void FixStoreState::pack_quatw(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = quat[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = quat[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1254,8 +1254,8 @@ void FixStoreState::pack_quati(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = quat[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = quat[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1269,8 +1269,8 @@ void FixStoreState::pack_quatj(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = quat[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = quat[i][2]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1284,8 +1284,8 @@ void FixStoreState::pack_quatk(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = quat[i][3]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = quat[i][3]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1299,8 +1299,8 @@ void FixStoreState::pack_tqx(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = torque[i][0]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = torque[i][0]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1314,8 +1314,8 @@ void FixStoreState::pack_tqy(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = torque[i][1]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = torque[i][1]; + else vbuf[n] = 0.0; n += nvalues; } } @@ -1329,8 +1329,8 @@ void FixStoreState::pack_tqz(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = torque[i][2]; - else buf[n] = 0.0; + if (mask[i] & groupbit) vbuf[n] = torque[i][2]; + else vbuf[n] = 0.0; n += nvalues; } }