Author Topic: Unphysical generation of point defects through W-S defect analysis  (Read 384 times)

wufc

  • Newbie
  • *
  • Posts: 11
Dear all,

     I'm now trying to conduct multiple collision cascades simulations to study the radiation damage buildup in copper. Before each collision, the entire system is shifted so that the PKA is positioned at the center of the cell. This operation prevents the damage cascade from reaching the cell boundaries, and the system is shifted back after annealing each cascade to clearly uncover defect evolution. The above method is widely used to examine radiation damage production in metals. However, I meet some problems to implement OVITO to visualize the generation of point defects through W-S defect analysis. After only a few collision cascades, there are thousands of point defects identified by WS analysis, which is obviously unphysical. Using other analysis methods like CNA, we can find that the structure is not so damaged. Theoretically, the system should be exactly where it used to be, as we conduct reversible shift in each loop. Unfortunately, displacements on atoms are observed and it puzzles me a lot. I’m wondering if there is anything wrong and how to judge point defects in this situation. Thank you.
      In the attachment, I post two configurations: one is the reference and the other is the damaged configuration after 8 collision cascades. I would be grateful if you can give me some help.

wufc

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #1 on: January 02, 2019, 12:33:36 PM »
Dear wufc,

I had a look at the displacement vectors computed between your structure and the reference configuration and you're right it looks rather unphysical. Are you absolutely sure that the shifting of the cell doesn't mess with the Particle Identifiers? What code did produce the cfg snapshots?
Another thing I noticed is there is a small offset between the lattices of the final structure and and the reference configuration, which is probably what causes your problems with the WS analysis.

-Constanze
« Last Edit: January 02, 2019, 01:18:37 PM by Constanze Kalcher »

wufc

  • Newbie
  • *
  • Posts: 11
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #2 on: January 02, 2019, 01:25:37 PM »
Dear Constanze,

    Thank you for your reply. We use the LAMMPS code in our simulations. As stated in my question, in each loop, we firstly shift the system with certain distance. After the cascade, the system is shifted back in the inverse distance. However, some rearrangement of atom positions does occur in the annealing process of each cascade. I’m afraid such cumulative displacements finally lead to the unphysical results obtained through WS analysis, but I’m not sure. It should be mentioned in the damaged configuration file, the computed displacement magnitude from LAMMPS is included, which is different from that using OVITO. As the judgment of point defects is important to analysis the results, I wonder if there is any solution.

wufc
« Last Edit: January 02, 2019, 01:44:15 PM by wufc »

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #3 on: January 02, 2019, 02:57:46 PM »
Dear wufc,

Quote
It should be mentioned in the damaged configuration file, the computed displacement magnitude from LAMMPS is included, which is different from that using OVITO.
Yes, I saw that. OVITO calculates displacement vectors for particles with the same particle identifier. So I assume that somehow during the shifting or file export particle identifiers are reassigned which then gives you the artefacts you observe in OVITO since you're actually not comparing the positions of the same particle.

Quote
As stated in my question, in each loop, we firstly shift the system with certain distance. After the cascade, the system is shifted back in the inverse distance.
As for the Wigner-Seitz-defect analysis, if you compare the final and the reference structure, you can see that the final configuration is slightly translated with respect to the reference frame. As a test, I tried to map it back (by hand) to the reference lattice by using the Affine Transformation modifier. As shown in the attached screenshot, you get a more reasonable result then.
If you have stored the displacement vectors calculated with lammps, you of course have more elaborate means to compensate the offset of the damaged structure.

-Constanze
« Last Edit: January 02, 2019, 03:03:38 PM by Constanze Kalcher »

wufc

  • Newbie
  • *
  • Posts: 11
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #4 on: January 02, 2019, 04:37:19 PM »
Dear Constanze,

    Thank you for your patience. As for the displacement vectors, I agree with you that the particle identifier should be the same to compare the positions correctly in OVITO. About the simulation loop, maybe I didn’t make it clear. In each loop, the system is shifted with a certain vector (x1, y1, z1). After the shift, atoms that are outside the cell boundaries would return automatically inside via the periodic cell boundaries. Then the system undergo a collision cascade with defects generation. After the cascade, the system is shifted back by the vector (-x1, -y1, -z1). It seems reversible but we do find some displacements. In the attached damaged configuration, we include the computed displacement magnitude from LAMMPS. Your idea sounds interesting. I upload a new file containing displacement vectors. However, it puzzles me how you translate the atoms as the displacement magnitude varies all over the system. Besides, your expression to select non-defective atoms is not right in my opinion. All the remains defects are Occupancy.1==1&& Occupancy.2==1, which makes me confusing. You can check it by looking at WS output on defects number. I tried in your approach but made little progress.

wufc

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #5 on: January 03, 2019, 12:14:09 PM »
Dear wufc,

no you explained the simulation procedure very clearly from the beginning which I really appreciate, but there is no way for me to diagnose why your shifting process is not fully reversible from only seeing the two configurations. My suggestion would be to try to estimate the translation vector between your reference and your damaged structure by averaging over all displacements below a certain threshold value (excluding the cascade damage), so you will be able to use the WS defect analysis. In the first attached screenshot you can see the displacement vectors you uploaded and a histogram of the displacement magnitude, seems like a cutoff of 2 Å is reasonable.
Just in case you were not familiar with this, screenshot 2 shows you how to import the displacement vectors calculated in your simulation using the Compute property modifier.
Furthermore, this is how you approximate the offset between the two configurations using a Python script modifier.
Code: [Select]
from ovito.data import *
import numpy as np
def modify(frame, data):
    pos = data.particles_["Position"]
    displ = data.particles_["Displacement"]
    c_dis_4 = data.particles_["c_dis_4"]
   
    offset = np.mean( displ[ (c_dis_4 < 2)], axis = 0)
    print(offset)
The result was [ 0.69055972 -1.08762384  0.06726288] in this case. My idea would be you use that information to shift back the damaged structure, e.g. by adding this to the above code snippet:
Code: [Select]
new_pos = data.particles_.create_property('Position')
    with new_pos:
        new_pos[...] = pos[...] - offset
and then try to apply the WS defect analysis again and let me know what the outcome is.

Quote
Besides, your expression to select non-defective atoms is not right in my opinion. All the remains defects are Occupancy.1==1&& Occupancy.2==1, which makes me confusing.
I was just playing around with your structure there and deleted all sites that are either occupied by one atom of type 1 or one atom of type 2. But you're right, in this case I also might have accidentally deleted some sites with a total occupancy of 2, where both Occupancy.1=1 and Occupancy.2=1. To actually delete all non-defective sites the expression selection that the delete atoms modifier is based on should be (Occupancy.1 + Occupancy.2) == 1, right?

Hope that helps,

Constanze
« Last Edit: January 03, 2019, 04:00:58 PM by Constanze Kalcher »

wufc

  • Newbie
  • *
  • Posts: 11
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #6 on: January 04, 2019, 05:16:29 PM »
Dear Constanze,

Sorry for my late reply and thanks for your help. I followed you instructions. By shifting back the damaged structure, WS defect analysis was conducted. The corresponding results indicated there were 67 vacancies and 67 interstitials in the damaged configuration, which seemed to be reasonable. The image of point defects was attached. I think it is really a big progress for me and I will do more tests soon.
Another problem was found due to the incompatible on different versions of OVITO. Your Python script is feasible using OVITO 3.0.0. However, OVITO 2.8.1, which I was used to, would complain. I have modified some sentence and the offset could be calculated. But I was stuck in how to define new positions and assign them to atoms.
Code: [Select]
from ovito.data import *
import numpy as np
def modify(frame, data, output):
    pos = data.particle_properties["Position"].array
    displ = data.particle_properties["Displacement"].array
    c_dis_4 = data.particle_properties["c_dis_4"].array
    offset = np.mean( displ[ (c_dis_4 < 2)], axis = 0)
    print(offset)
    new_pos = data.create_particle_property(ParticleProperty.Type.Position)
    with new_pos:
        new_pos.marray[...] = pos.marray[...] - offset
Script output:
Code: [Select]
[ 0.69056547 -1.08762193  0.06726314]
The Python script has exited with an error.
Traceback (most recent call last):
  File "<string>", line 10, in modify
AttributeError: __exit__
I would be grateful if you can give me some help.

wufc
« Last Edit: January 05, 2019, 04:16:26 AM by wufc »

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #7 on: January 07, 2019, 12:48:58 PM »
Dear wufc,

as you already noticed there have been some changes in the python API. This is documented here:
http://ovito.org/manual_testing/python/introduction/version_changes.html

In older versions, you cannot use the "with" statement to get write permission to particle properties, but the following should work:
Code: [Select]
new_pos = output.copy_if_needed(output.particle_properties["Position"])
new_pos.marray[...] -= offset

-Constanze


wufc

  • Newbie
  • *
  • Posts: 11
Re: Unphysical generation of point defects through W-S defect analysis
« Reply #8 on: January 07, 2019, 03:22:22 PM »
Dear Constanze,

Thanks so much for your help. The code snippet works great.

Regards,
wufc