OVITO Forum

OVITO => Support Forum => Topic started by: Qriver on June 27, 2018, 06:10:04 PM

Title: Questions about common neighbor analysis and cluster analysis.
Post by: Qriver on June 27, 2018, 06:10:04 PM
Hi, every one

I have two questions:
1. if the common neighbor analysis will have deviation on the structure identification?
2. Why the method of cluster analysis will identify one atom as a cluster?

Thank you!
Shuai
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on June 28, 2018, 01:47:45 PM
Hi Shuai,

regarding your first question, please explain what you mean by structure identification. I'm guessing you're asking about the difference between the common neighbor analysis modifier and one of the other structure identification methods implemented in OVITO (to which the common neighbor analysis also belongs). Or is your question aiming at if you can identify defects?

As for the cluster analysis, this modifier decomposes a particle system into disconnected sets of particles (clusters) based on a local neighboring criterion, i.e. the cutoff you specified. So if no neighbors are found within the cutoff of a single atom, this atom will appear as a single atom cluster with its own cluster ID. Look at the example picture I attached. Here the cluster analysis was used to find the "free floating" atoms so to say, that do not belong to the nanoporous particle.

-Constanze
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Qriver on June 28, 2018, 05:47:49 PM
Hi Constanze,
My first question is if the common neighbor analysis is enough precise, e.g. this method will identify the outermost atom of the crystal cluster to be non-crystal atoms.
Thank You!
Shuai
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on June 28, 2018, 06:27:44 PM
Hi Shuai,

yes indeed. Let me bring up the example of the nanoporous particle again, which was set up as single crystalline fcc. The common neighbor analysis will not identify the surface atoms as fcc (here colored in green) since they don't have 12 nearest neighbors anymore.
The CNA actually takes into account 1) the number of common neighbors of each atom and its neighbors, 2) the number of bonds between these common neighbors and 3) the number of bonds in the longest continuous chain of bonds between the common neighbors. This triplet of values would be (4 2 1) for an fcc atom.

For more details, I would like to refer you to the references given in the manual,
 
https://ovito.org/manual/particles.modifiers.common_neighbor_analysis.html

or this book chapter:

https://link.springer.com/chapter/10.1007/978-3-319-33480-6_10

Let me know if you have further questions,
-Constanze
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Qriver on June 29, 2018, 02:53:51 PM
Hi Constanze,

Thank you very much for your help.
I have a question about the method, do you know how to leave the outermost crystal atoms with code?
Thank you!

Shuai
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on July 02, 2018, 10:49:23 AM
Hi Shuai,

do you want to do that with python code? And do you want to specifically select non-fcc atoms that are neighbors to at least one fcc atom?

Constanze
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Qriver on July 02, 2018, 03:59:49 PM
Hi Constanze,

Can CNA identify all BCC atoms? if not, I want to get the BCC atoms with python code which will be identified to be non-BCC atoms by CNA.

Shuai
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on July 02, 2018, 04:41:44 PM
Hi Shuai,

the CNA will only identify those atoms as bcc which have 8 nearest neighbors and 6 second nearest neighbors and only if all these 14 neighbors are sitting on regular bcc sites. But note that these neighbor atoms themselves may not be labeled as bcc by the CNA if they do not fulfill these criteria just mentioned.

One way of selecting these atoms which are neighbors of bcc atoms but which have not been labeled as bcc themselves is to use the Expand selection modifier. First you select the bcc atoms using the Select type modifier as usual. Then, the Expand selection modifier allows you to also select atoms in the immediate neighborhood of the already selected bcc atoms. In your case you should expand the selection among the N nearest neighbors (second option) and set the value to 14.

Code: [Select]
from ovito.modifiers import CommonNeighborAnalysisModifier, SelectTypeModifier, ExpandSelectionModifier

node.modifiers.append(CommonNeighborAnalysisModifier(
    mode = CommonNeighborAnalysisModifier.Mode.AdaptiveCutoff
))
node.modifiers.append(SelectTypeModifier(
    property = "Structure Type",
    types = { CommonNeighborAnalysisModifier.Type.BCC }
))
node.modifiers.append(ExpandSelectionModifier(
    mode = ExpandSelectionModifier.ExpansionMode.Nearest,
    num_neighbors = 14
))


Constanze
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Qriver on July 06, 2018, 04:34:36 PM
Hi Constanze,
Thank you for your help!
Shuai
Title: Questions about common neighbor analysis
Post by: Sacho on July 11, 2019, 09:30:00 AM
Hello,everyone
I have two questions
one is the result of program cna_bond_analysis.py that was showed by Alexander Stukowski nine months ago, I don't know if the result after the program is running is correct and the code and results are placed in the attachment,and the meaning of each line is not very clear for me,it has cna index and counts,why are there many cnd index in every line?If I want to get a statistical result of a structure type, what else do I need to add to the program?

And another question is whether these analysis methods consider periodic boundary conditions,incluing cna ,bong angle analysisand Voronoi analysis?

Thanks very much
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on July 16, 2019, 10:03:34 AM
Hello Sacho,

as explained both in the manual and in the comments of the code example, for each particle in your system this script prints a histogram of the CNA indices (which are triplets of indices) for each bond from the topology of the surrounding bond network.
http://www.ovito.org/manual_testing/python/introduction/examples.html#example-compute-cna-bond-indices (http://www.ovito.org/manual_testing/python/introduction/examples.html#example-compute-cna-bond-indices)

To be able to assign a structure type to a particle, each particle's list of triplets then is compared to a set of signature references. As an example, in an fcc structure each particle will have 12 neighbor bonds thus 12 triplets. Moreover all of those have to be of (421) type. An hcp-coordinated atom has six bonds of (4 2 1) type and six of (4 2 2) type.
Have a look at this paper for a more detailed description:
https://iopscience.iop.org/article/10.1088/0965-0393/20/4/045021/meta

It's not quite clear to me if you're goal is to create a histogram of all CNA indices or only the structure types of the particles. In the latter case, it is enough to just apply the Common neighbor analysis modifier and then create a histogram from the particle property "Particle Type".

-Constanze

Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Sacho on July 16, 2019, 11:12:15 AM
Hello,Constanze

Thank you for your careful answer.
I am sorry to make the problem not clear. I am doing some metal liquid structural characterization, I want to get the local cluster changes with temperature. So I tried to use the CNA method, but I can't get the result I want, as shown below, I don’t know how to solve it. And I also used the Voronoi analysis, the results showed that the distribution of clusters is very scattered, and the maximum number of clusters is less than one percent. Maybe you can give me some help and advice for cluster analysis. Thanks again.
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on July 16, 2019, 03:36:41 PM
Hello Sacho,
you might want to try the Polyhedral template matching (PTM) modifier instead of the Common neighbor analysis (CNA) modifier, since the PTM approach promises greater reliability than the CNA in the presence of strong thermal fluctuations and strains. See the corresponding manual entry for more details:
 https://ovito.org/manual_testing/particles.modifiers.polyhedral_template_matching.html (https://ovito.org/manual_testing/particles.modifiers.polyhedral_template_matching.html)

Anyhow, may I ask what your expectation for your system is? I have no information about the temperature you were running the simulation, but the snapshot you're showing here looks like you fully melted your metal. In that case it makes sense that that the Voronoi signature of the liquid is quite "scattered" as you describe it.

-Constanze
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Sacho on July 17, 2019, 03:12:49 AM
Dear Constanze
Thanks. I used the PTM under your suggestion, but the result is same as the CAN, as shown in the attachment. From its liquid structural factor curve, it has a pre-peak and a second peak with a shoulder. According to the literature, there should be icosahedral clusters. This alloy is a ternary system. Is it useful to calculate the bond angle distribution or bond order parameter?
Sacho
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Sacho on July 17, 2019, 08:49:30 AM
Dear Constanze
I have another problem. Is there a difference between the CAN index and HA index?

for HA index: (i) The second index represents whether or not they are near-neighbor (ii) The second index represents the number of near neighbors they have in common. (iii) The third index is for the number of nearest-neighbor bonds among the shared neighbors. (iv) A fourth index is used to distinguish configurations with the same first three indices but with a different topology.

According the literature [Faken and Jonsson, Comput. Mater. Sci. 2, 279], the bonded pairs of type 555 are characteristic of Icosahedral order , but in HA index, the 1551 and 1541 pairs are icosahedral order. Based on the definition of both, I think that 55x and 54x in CAN index is same as the 155x and 154x, is this right? If it is right, the type 55x and 54x in CAN index can represent the five-fold symmetry based motifs, that is, the icosahedral order degree.

Thanks
-Sacho
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Sacho on July 17, 2019, 09:39:19 AM
Dear Constanze

I am a newbie and some problems may be stupid. I want to know if the atom corresponding to the atomic number before the CNA index in the output file is the same as the input file. Because I want to count the CNA index for each atom type. If they are not the same, what should I do?

Thanks, best wish for you.
-Sacho
Title: Re: Questions about common neighbor analysis and cluster analysis.
Post by: Constanze Kalcher on July 19, 2019, 04:33:41 PM
Hi Sacho,

1) I don't think you would get more information from the bond angle distribution or bond order parameters. It just seems that at that temperature you're using crystallization cannot occur (yet).

2) I haven't been familiar with the concept of the Honeycutt-Anderson index, but yes, the CNA indices of an atom with icosahedral coordination have to be 12 x (555).
The two notations seem to be a little different though:
    - The first HA index is not used in the CNA notation since OVITO only performs the analysis if a bond exists. As you said above that would always be "1" for all the CNA indices you get.
    - The second and third index in the HA-nomenclature are the same as the first and second CNA-index.
    - I don't have a good understanding what the fourth HA index represents. Yes, it's used to distinguish between different topologies of the clusters, but in what way? The third index in the CNA notation is more specific since it represents the length of the longest continuous chain of bonds from all the bonds between common neighbors.

3) Yes, by default the order will be same as in the input file. This is something you should pay attention to if you want to average atomic properties over different time frames and the order of the atoms is not the same in every frame. That can be the case for lammps dump files for example. What you should do then is either use the property "Particle Identifier" instead to index atoms or activate the option "sort_particles=True" in the import_file() function. See section "Particle ordering" in the manual:
http://www.ovito.org/manual_testing/python/modules/ovito_io.html

-Constanze