-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new HPMC pair potential framework #1676
Conversation
Add hoomd.hpmc.pair.LJ, compatible with HPMCIntegrator.pair_potential.
Refactor existing code to use computeTotalPairEnergy.
Individual pair potentials can convert to ShortReal when warranted. This improves performance by avoiding costly double->float conversions all the time.
This allows computeOnePairEnergy to apply type-specific r_cut checks before calling energy() to avoid the virtual function call overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good. I only have a few comments. Also, if possible we should document the expected changes between potentials in MC and MD.
Co-authored-by: Brandon Butler <butlerbr@umich.edu>
…loops. Also fix a bug where 0.5*diameter was replaced with 0.5*radius.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks ready to me.
Here is a performance test of
There is some small overhead introduced to the LLVM code path from the generalization to add multiple pair potentials together ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Just a few clarification questions, but otherwise seems ready to go.
Co-authored-by: Tim Moore <mtimc@umich.edu>
Description
HPMCIntegrator.pair_potentials
on the CPU.LennardJones
as the first example using the new framework.The new framework allows:
ShortReal
appropriately for mixed precision builds.PairPotential
to match thepair_potentials
name used in the documentation.Motivation and context
This is the first step toward implementing #1652. Future pull requests will add multi-site pair potentials (based on the
CPPPotentialUnion
code), anisotropic potentials (e.g. Kern-Frenkel) and provide an example component.How has this been tested?
TODO:
LennardJones
pair potential inhoomd-validation
.ComputeSDF
inhoomd-validation
.Change log
Checklist:
sphinx-doc/credits.rst
) in the pull request source branch.