Forum Navigation
You need to log in to create posts and topics.

Calculation of neighbors within distance

Hello everybody,

is there a way to calculate the neighbors of a atom 1 within a distance for multiple timesteps ? I could not do it with the common neighbor analysis.

E.G

atom 1 within 3.0 A has atom #100, atom #200 and so on as neighbors.

thank you

Hi,

are you asking (1) how to calculate the number of neighbors or (2) how to get the particle id's of the neighbors? For both questions there are several options to do this, here are two examples:

In the first case, you could e.g. use the Coordination Analysis modifier with a cutoff parameter of your choice, which will create a new particle property "Coordination", that gives you the neighbor count (coordination number) of each particle.

As for the particle id's, this will require you to use the python scripting interface. The CutoffNeighborFinder() function, e.g., allows you to iterate over the neighbors of a given particle within a specified cutoff distance. You can easily use it to access the neighbor particle's information. Let me know if you need help with that.

-Constanze

hello constanze,

the second one was the answer i was searching for. Thank you a lot.