Fixed typos in compute efield/atom and bug with set charge for atom_style dieletric

This commit is contained in:
Trung Nguyen
2023-01-09 00:24:14 -06:00
parent 52b84c9776
commit f34fd96185
2 changed files with 8 additions and 5 deletions

View File

@ -855,8 +855,11 @@ void Set::set(int keyword)
else if (keyword == VX) atom->v[i][0] = dvalue;
else if (keyword == VY) atom->v[i][1] = dvalue;
else if (keyword == VZ) atom->v[i][2] = dvalue;
else if (keyword == CHARGE) atom->q[i] = dvalue;
else if (keyword == MASS) {
else if (keyword == CHARGE) {
atom->q[i] = dvalue;
// ensure that scaled charges are consistent the new charge value
if (atom->epsilon) atom->q_scaled[i] = dvalue / atom->epsilon[i];
} else if (keyword == MASS) {
if (dvalue <= 0.0) error->one(FLERR,"Invalid mass in set command");
atom->rmass[i] = dvalue;
}