make energy handling consistent for variable field

This commit is contained in:
Axel Kohlmeyer
2023-03-11 18:56:29 -05:00
parent 251fac2c60
commit a8c1359c54
4 changed files with 12 additions and 34 deletions

View File

@ -387,12 +387,7 @@ void FixEfield::post_force(int vflag)
}
f[i][2] += fz;
fsum[3] += fz;
if (estyle == ATOM) {
fsum[0] += efield[0][3];
} else {
domain->unmap(x[i], image[i], unwrap);
fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2];
}
if (estyle == ATOM) fsum[0] += efield[0][3];
}
}