Implementing a soft repulsion force for a polydisperse system #2066
Replies: 1 comment 1 reply
-
Unfortunately, the typing system in HOOMD-blue is the only way to achieve polydisperse r_cut values. HOOMD will issue a warning about performance, but on CPUs and modern GPUs the performance loss is manageable (see #2037 (comment)). This does result in O(N^2) memory usage for the r_cut and potential parameter matrix. FYI, you can obtain better performance by using the compiled potential I am working on a new code that will allow users to define custom per particle attributes and compute potentials that depend on these attributes. That code is not ready to share open source yet, but will be soon. Watch this discussion board for an announcement (https://github.com/glotzerlab/hoomd-blue/discussions). |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to implement a soft (linear) repulsive force in a hoomd simulation of the following form:
Fij = k(ai + aj -rij ) if rij < ai + aj
= 0 otherwise
where rij is the distance between the centers of two particles with radii ai and aj , and the force is along the relative position vector of the two particles. In other words, particles repel when overlapping and don't interact otherwise.
For a monodisperse system (all particles have the same radius a), I used hoomd.md.pair.Table with the code below.
For a system of particles with radii sampled from a uniform distribution [0.9a, 1.1a], how do I make sure that the correct cut-off radius is used every time? I have seen suggestions to define a typeid for each particle size and loop over all possible combinations of typeids and particle sizes, but I imagine that will be very inefficient for systems of thousands of particles.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions