accessing neighbor list in custom plugin without defining pair potentials

25 views
Skip to first unread message

Ian Seim

unread,
Jul 29, 2021, 3:16:12 PM7/29/21
to hoomd...@googlegroups.com
Hi,

I have created a custom plugin that uses the neighborlist to add and remove bonds given a distance cutoff. When I define a neighborlist in my main script, but don't define any pair potentials, my plugin no longer works. When I do define pair potentials it works fine. It seems like the neighborlist is not generated / accessible unless pair potentials are defined? I would like to be able to run the plugin without defining any pair potentials.

thanks for any help,

Ian

Joshua Anderson

unread,
Jul 29, 2021, 3:40:11 PM7/29/21
to hoomd...@googlegroups.com
Ian,

There is nothing special about a plugin vs the main code. The neighbor list is a class and it will compute the neighbor list you request via the API calls. You don't provide much information, so I can only guess at what the issue might be.

My best guess is that you are using the same neighbor list class instance for the pair potentials and your plugin. I would guess that your plugin doesn't not provide r_cut values to the neighbor list. Each neighbor list instance finds neighbors within the maximum r_cut from all registered consumer class instances.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> --
> You received this message because you are subscribed to the Google Groups "hoomd-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/CAH7vq%2BeikKdpHAekYrGeGNjas%2BRmhBR93Xc6FEkQDgwKdMpXJQ%40mail.gmail.com.

Joshua Anderson

unread,
Jul 30, 2021, 12:22:37 PM7/30/21
to hoomd...@googlegroups.com, Seim, Ian
Ian,

Replying to your question posted off the list so that all can see the answer, the code in v2.9 that sets the r_cut for the neighbor list is here:

https://github.com/glotzerlab/hoomd-blue/blob/2318ac8e950eb9055c74f41eb5e12c83627136a1/hoomd/md/nlist.py#L74-L80

One example using it is here.

https://github.com/glotzerlab/hoomd-blue/blob/2318ac8e950eb9055c74f41eb5e12c83627136a1/hoomd/md/pair.py#L374
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

Reply all
Reply to author
Forward
0 new messages