Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Constanze Kalcher

Pages: 1 [2] 3 4 ... 6
16
Support Forum / Re: Python Script Loop
« on: September 28, 2018, 09:29:50 AM »
Hi,
well you never calculated a global attribute "Displacement" that you're trying to export. You only created a selection based on the potential energy of the atoms. (This means that they now have a particle property "Selection" which is either 0 or 1. Again, what would you like to do with this selection?

-Constanze

17
Support Forum / Re: Python Script Loop
« on: September 26, 2018, 11:32:27 AM »
Hi,

I haven't gone through your whole script but the current error is definitely due to the naming of the variables in the expression select modifier. I tried with an expression select on an example file in the GUI version of ovito, where you can see the available particle properties in the "Variables" panel. 
You should try the following:

Code: [Select]
node.modifiers.append(SelectExpressionModifier(expression = 'c_disp_4_>0.8'))
This will select all atoms with displacement magnitudes larger than 0.8. What would you like to do with these atoms? Let me know if you need further help.

-Constanze

18
Support Forum / Re: Loading the dump file error in python script
« on: September 26, 2018, 11:17:52 AM »
Dear jatin1990,

the error message is telling you that there is no file called "dump.mix" in the folder where you're executing ovitos. Are you sure that's the correct name and location etc.?

-Constanze

19
Hi sairajdream,

I also tried and could open your file without any problem. Could you please upload your file here instead of just copying the text, because the latter one seems to be perfectly fine.

-Constanze

20
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 12:29:25 PM »
This doesn't answer my question. How do you want to save the information you calculated?

Besides, if your lammps command worked (I guess it's because the correct variable style should be atom not equal), the quantity VMS would also be a part of your dump file since it's a per-atom quantity. So now that you've calculated that with OVITO, why don't you append that new information as additional column to your .dump files?

However, the sum of all the per-atom values you compute for every snapshot and save as global attribute is something you could export as *.txt file, like you tried above.

21
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 11:50:22 AM »
That's what I meant with line 7 in your python script doesn't make much sense. Global attributes are not meant to save arrays.

Why don't you export the atomic von Mises stresses via the file-export formats *.dump"  or ".xyz"? Then you don't need that python script modifier at all.

Maybe you can explain how you want your output file to look like, because I'm having trouble understanding the issue.

22
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 10:51:50 AM »
If you want to sum up only the z-component of your stress tensor you can do:
Code: [Select]
numpy.sum( input.particles["Stress Tensor"][:,2] )

23
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 10:44:14 AM »
Code: [Select]
numpy.sum(Von_Mises) sums up all the atomic von Mises stresses.
See https://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html

24
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 10:06:40 AM »
Amir,

it's not an error, you trying to print a particle property object and that's what it does.
Try e.g.
Code: [Select]
print(Von_Mises[...])to print all the values in the von_Mises array,
or
Code: [Select]
print(Von_Mises[0])to print the first one.

Just so you know you didn't have to change the name of your particle property "Von Mises Stress",
Code: [Select]
input.particles["Von Mises Stress"]
Blank spaces in strings (enclosed by " ")  are fine. But since you apparently also changed it in the Compute property modifier that of course also works.

In line 7 you're saving the whole particle property object as a global attribute, which works but is probably not what you wanted to do.

-Constanze

25
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 08:10:09 AM »
Also in line 6 you‘re calling the particle property „Selection“, which I can see from your screenshot doesn’t exist. You can remove that line.
Also what are you trying to achieve with line 7?

26
Support Forum / Re: Von Mises Stress
« on: September 20, 2018, 08:04:49 AM »
Hi Amir,

the error is due to the way you’re trying to define variables.
You can’t use blank spaces, rather use „-„ or „_“.
Change your code to e.g.

Code: [Select]
von_Mises = ...
von_Mises_Stress = ...

-Constanze

27
Support Forum / Re: Exporting data
« 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
   

28
Support Forum / Re: Exporting data
« 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.


29
Support Forum / Re: Particles
« 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

30
Support Forum / Re: Particles
« 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




Pages: 1 [2] 3 4 ... 6