Closed gjepson closed 4 years ago
Hey! Thanks for the PR, I'll have a look at it later today.
Small nitpick: Not sure if rust does this for us, but you could replace f64::powi(s6, 2)
with s6 * s6
within the energy and force computation.
I'm not sure I understand the correction terms. Would it make sense to use the regular formulation of tail corrections but using 2^1/6 sigma
as upper limit instead of infinity (see here)? We could use such a correction when rc < 2^1/6 sigma
and zero if rc > 2^1/6 sigma
, or am I missing something?
Do you need help making the potential accessible from input files?
s6 * s6 works fine as well. I used f64::powi(s6, 2) because it was used in the Lennard-Jones potential implementation. Is there a benefit to using one over the other?
Regarding the cutoffs, I added a new commit which should correct the correction terms. If I'm thinking of this correctly, WCA converges, so this should yield 0 if the cutoff is beyond 2^1/6 sigma, and panic otherwise.
I'll check through the documentation regarding potential accessibility from input files and let you know if I have any questions.
Travis hasn't passed at the time of commenting, so it this may well be moot if it doesn't pass.
s6 * s6 works fine as well. I used f64::powi(s6, 2) because it was used in the Lennard-Jones potential implementation. Is there a benefit to using one over the other?
s6 * s6
should be faster, as powi
might call a function in libm. Expect from that, there should be no difference.
So what is missing here? I'd like to get this to go forward =)
I think this could be merged with some additional regressions tests; something like this:
Testing some specific values for energy and forces, and checking that the force is indeed the derivative of the energy using finite differences.
Support for WCA in input can come later.
Closing this due to inactivity. Feel free to create a new PR if you are still interested!
New WCA code examples, pair potentials. All tests passed.