Author Topic: Exporting data  (Read 149 times)

Amir Dehghan

  • Newbie
  • *
  • Posts: 11
Exporting data
« on: September 19, 2018, 11:41:31 AM »
Hi dears
How can i copy data from Particles in new ovito version?
« Last Edit: September 19, 2018, 01:47:54 PM by Constanze Kalcher »

Constanze Kalcher

  • Administrator
  • Jr. Member
  • *****
  • Posts: 81
Re: Particles
« Reply #1 on: September 19, 2018, 11:46:23 AM »
Hi Amir,

have you considered using the File Export function?

-Constanze

Amir Dehghan

  • Newbie
  • *
  • Posts: 11
Re: Particles
« Reply #2 on: September 19, 2018, 11:55:18 AM »
No, My aim is to get tension in different strains, and for this purpose, I want to have strain and stress data in different steps.
For example: I attached one file

Constanze Kalcher

  • Administrator
  • Jr. Member
  • *****
  • Posts: 81
Re: Particles
« Reply #3 on: September 19, 2018, 12:06:26 PM »
Amir,
it's not clear what you mean by "tension in different strains" and "copy" the data. What you where trying to reference in your first screenshot as StressTensor.ZZ is a per-atom information, not the total stress.
If you're trying to calculate the total stress and strain you can do so, e.g. with a python script modifier. This has been explained here:

http://forum.ovito.org/index.php?topic=376.0

Still, the file-export is the way to go to export the time-evolution these quantities.

-Constanze




Amir Dehghan

  • Newbie
  • *
  • Posts: 11
Re: Particles
« Reply #4 on: September 19, 2018, 12:18:02 PM »
I need atomic information(per/atom)   as data file, Including stress and strain in different steps and total strain and overall stresses(Such as stress-strain data in the tensile test)

Constanze Kalcher

  • Administrator
  • Jr. Member
  • *****
  • Posts: 81
Re: Particles
« Reply #5 on: September 19, 2018, 01:36:58 PM »
OVITO currently has the following file export functions:

1) Either you can export a selection of particles along with their properties, like e.g. the atomic stresses. If you choose the *.dump or *.xyz format as export file format you can select which particle-properties you want to export, e.g. only the Stress Tensor (see screenshot 1).

2) Global attributes like the total strain and stress (which you probably first need to calculate using a Python script modifier as explained above) can be exported as well. Simply choose "Table of values" as export file format (see screenshot 2).

-Constanze

Constanze Kalcher

  • Administrator
  • Jr. Member
  • *****
  • Posts: 81
Re: Exporting data
« Reply #6 on: September 19, 2018, 05:42:07 PM »
In case you are just getting familiar with python, here's how you could reference the z component of the per-atom stress and strain tensors.
Code: [Select]
strain_zz = input.particles["Strain Tensor"][:,2]
stress_zz = input.particles["Stress Tensor"][:,2]

To calculate the strain tensor activate the option "Output strain tensors" in the Atomic strain modifier.


Constanze Kalcher

  • Administrator
  • Jr. Member
  • *****
  • Posts: 81
Re: Exporting data
« Reply #7 on: September 19, 2018, 05:57:44 PM »
But if you simply want to compute the strain from the length-change of your simulation cell, e.g. in z-direction, you could use a python script modifier function like this one:
Code: [Select]
from ovito.data import *
import ovito

l0 = ovito.scene.selected_pipeline.source.compute(0).cell[2][2]

def modify(frame, input, output):
    cell = input.expect(SimulationCell)
    print(cell)
    output.attributes["Strain"] = (cell[2][2] - l0)/l0
   

Amir Dehghan

  • Newbie
  • *
  • Posts: 11
Re: Exporting data
« Reply #8 on: September 19, 2018, 06:13:03 PM »
I'm not familiar with Python's script.
I do not have the strain magnitude in the dump files (I only have stress/atom in different directions)

mass id type x y z c_Stress [1] c_Stress [2] c_Stress [3] c_Stress [4] c_Stress [5] c_Stress [6]
In order to exert deformation, i use "fix deform" in lammps and my strain is: "(lz - v_L0z)/v_L0z"

My main goal is to have the stresses and the strains in different places (such as the failure point, etc.) because I want to know what changes on my structure in different strain and stress.
Thanks for giving me guidance
« Last Edit: September 19, 2018, 06:40:36 PM by Amir Dehghan »