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

cluster analyze

Dear all,

I have carried out the cluster analyze,and got the cluster ID ,cluster size. I want to know how can I select specific cluster through the cluster ID or cluster size,and show on the screen, could you help me to solve it?

Thank you!

Uploaded files:
  • 捕获.JPG

Hi,

you can use the Cluster identifier property within the Expression Selection modifier.

If you use "Cluster == 1", e.g., all particles that belong to the cluster with cluster id 1 will be selected.

-Constanze

Hi Constanze,

Is it possible to retain the same cluster-id if the members of the clusters remain the same and also assign a new one, that has never been assigned (in the previous data frame ) if members change?
Here I want to check how long a cluster has survived without changing its members.

That is a valid question. The ordering of clusters is arbitrary by default and will generally depend on the storage order of input particles. You could use the "Sort clusters by size" option, but even then there is no guarantee that the cluster id's are retained between different frames, especially of the sizes and number of clusters changes between different frames.

What I would suggest is to look up the Cluster Identifier property for each particle, and then always compare those with the previous frame. If the number of particles and the particle id's of the particles that are part of the same cluster remain the same, you can increase a life-time counter of that cluster. You will need to set up a python batch script for that. Let me know if you need help with this.

 

 

Thanks, Constanze,

In my data file, I am able to separate all the clusters of the same sizes with their cluster ids and members ids. I am attaching my data file here that is similar to the dump file obtained from LAMMPS.  I am quite new to the Python scripting in Ovito. I would be really kind if you could help me out with the python scripting.

Uploaded files:

Sure, you're welcome to post your script and any specific questions here for us to have a look at it. As a starting point, please first have a look at the first few pages of the introductory section in the scripting manual:
https://www.ovito.org/docs/current/python/introduction/running.php

Also, in case you didn't know, you can save quite some developing effort by using the Python code generator function available in the GUI of OVITO Pro.
https://www.ovito.org/docs/current/python_code_generation.php