bugfix for writing data files with atom style dielectric

This commit is contained in:
Axel Kohlmeyer
2022-08-19 16:18:13 -04:00
parent 20f7e8dcb5
commit aa1762b815
2 changed files with 20 additions and 0 deletions

View File

@ -147,6 +147,24 @@ void AtomVecDielectric::data_atom_post(int ilocal)
mu_one[3] = sqrt(mu_one[0] * mu_one[0] + mu_one[1] * mu_one[1] + mu_one[2] * mu_one[2]);
}
/* ----------------------------------------------------------------------
restore original data for writing the data file
------------------------------------------------------------------------- */
void AtomVecDielectric::pack_data_pre(int ilocal)
{
atom->q[ilocal] = q_unscaled[ilocal];
}
/* ----------------------------------------------------------------------
undo restore and get back to post read data state
------------------------------------------------------------------------- */
void AtomVecDielectric::pack_data_post(int ilocal)
{
atom->q[ilocal] /= epsilon[ilocal];
}
/* ----------------------------------------------------------------------
initialize other atom quantities after AtomVec::unpack_restart()
------------------------------------------------------------------------- */

View File

@ -37,6 +37,8 @@ class AtomVecDielectric : public AtomVec {
void unpack_restart_init(int) override;
int property_atom(const std::string &) override;
void pack_property_atom(int, double *, int, int) override;
void pack_data_pre(int) override;
void pack_data_post(int) override;
protected:
int *num_bond, *num_angle, *num_dihedral, *num_improper;