Skip to content

Commit

Permalink
Set infintesimal charges to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchwiebert committed Jul 6, 2024
1 parent 7a4798a commit d430cb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Ewald.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ void Ewald::Init() {
particleKind.push_back(molKind.AtomKind(a));
particleMol.push_back(m);
particleCharge.push_back(molKind.AtomCharge(a));
if (std::abs(molKind.AtomCharge(a)) < 0.000000001) {
if (std::abs(molKind.AtomCharge(a)) < 1.0e-9) {
particleCharge.push_back(0.0);
particleHasNoCharge.push_back(true);
} else {
particleCharge.push_back(molKind.AtomCharge(a));
particleHasNoCharge.push_back(false);
}
}
Expand Down Expand Up @@ -1597,7 +1599,7 @@ void Ewald::BoxForceReciprocal(XYZArray const &molCoords,
}
#else
// Only one box, so clear all atoms and molecules and mark all particles as
// Used
// used
atomForceRec.Reset();
molForceRec.Reset();
memset((void *)particleUsed, true, atomForceRec.Count() * sizeof(bool));
Expand Down

0 comments on commit d430cb7

Please sign in to comment.