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

Not able to extract computed Total Energy for selected structure type of atoms.

Hello,

I wanted to extract Total Energy of selected structure type of atom (in my case it is BCC or FCC). I used CNA --> Select type--> Invert slec. --> Delete selc. and then Compute property modifications. But in the export attribute, I can not see the Total energy to write in the table.

Even in starting I edit user-defined column mapping and assign columns for potential energy and kinetic energy(so that I can use these values in Compute modifier).

Do, I have to add a python script to calculate the Total energy to extract it or compute type will work?

I need a table in which I can see how the Total energy of BCC atoms is changing with respect to time.

I'm attaching here 3 frames for reference.

 

Thank you so much for your time and great support system.

Best

Prashant

 

 

Uploaded files:

Hi Prashant,

with the Compute Property Modifier you can calculate per-particle information only. In your case e.g., to calculate the per-atom total energy you could use that modifier with the following settings:
Output Property -> "Total Energy"
Expression -> "c_my_pe + c_my_ke"

If you open the Data Inspector, you will now see an extra column "Total Energy" appear.

If I understand you correctly you're asking how to calculate and export the sum of a per-atom property for only a selection of atoms. You need to create a global attribute for this using a python script modifier. So, say you want to calculate the sum of the total energy of all bcc atoms: Then, add a python modifier to your pipeline and paste the following modifier function in the script editor:

from ovito.data import *
import numpy 
def modify(frame, data):
    structure_type = data.particles["Structure Type"]
    data.attributes["Total Energy bcc atoms"] = numpy.sum( data.particles["Total Energy"][ structure_type == 3])

You will now see the attribute "Total Energy bcc atoms" appear in the Data inspector under "Global attributes". You can export this information through the File-Export option "Table of values".

-Constanze

Hello,

Thanks, Constanze, it workes.

Best

Prashant

Hello,

I was wondering as I have a similar problem. However one of the differences I have is my material (Li2B12H12) has a more undefined strcuture. Merely, I tried to place it into a unit cell. The problem arises when I tried to analysis it, the structure is always 'Other' with none of the atoms being FCC or BCC. Due to this, I can not analysis total energy output. I was wondering if I can get some help on this. Without the system being equilibrated, I can not calculate energy and can not process with my project.

I have read the posts about and it still comes up as errors. Was wondering if you could help.

Thank you in Advance,

Christine

Uploaded files:

Hi Christine,

the trajectory file you import in the GUI is not stored as part of the ovito state file. So if you would like me to have a look at your system, please upload it here or send it to us through the official mail support.

-Constanze