Accessing "ilist" from a bond style.

I made a new bond style where I want access to the “ilist” array in list->ilist. When I try to compile ilist=list->ilist in a bond style, I get the error:

error: ‘list’ was not declared in this scope

because I haven’t requested a list, I think? How can I access list->ilist in a bond style?

“list” isn’t a member of the Bond class, so you cannot access it. in fact, there are no provisions whatsoever in bond styles to request and access neighbor lists.
you can only do this is pair styles, fix styles and compute styles. and also commands can execute a direct build of a neighbor list.

if you want to access the neighbor list of your pair style, it would be available at “force->pair->list”

however, that requires that a) there is a pair style defined, b) that pair style uses a neighbor list and c) the neighbor list request settings (full/half, newton on/off, with ghost neighbors, and so on) matches what you need. another option would be to implement a custom compute or fix style that requests (and stores) a suitable neighbor list with the desired settings for your bond style and then you create/delete the fix with your bond style constructor/destructor and access the data from it as needed.

axel.

BTW: something sounded familiar about this, and a quick look through my e-mail archive shows me, that i gave you almost the same answer about two years ago to a very similar question.

axel.