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 - Kevin

Pages: [1] 2
1
Support Forum / Re: rendering quality
« on: May 07, 2018, 04:24:41 AM »
Hi Dr.Stukowski,

You indicated that I could change the zoom level with Viewport.fov attribute, but I am not sure how this changes the zoom level.

Doesn't Viewport.fov attribute change the angle of the camera, not the zoom level?

-Kyu

2
Support Forum / Re: viewport
« on: April 25, 2018, 06:04:43 PM »
Yes, zoom_all was what I meant to say. I should have clarified a little more when I asked the question. Thanks for clarifying.

I will report what I did wrong as follows in case other users encounter similar mistake:

So, zoom_all() has to be used after setting the viewing direction and the FOV angle.
1. set up viewing direction and FOV angle
2. zoom_all()

I used in the reverse order;
1. zoom_all()  #this sets up viewing position so that all system is viewed in current viewing direction and FOV angle.
2. set up viewing direction and FOV angle  #changing viewing direction and FOV angle here would result in previously set viewing position in step 1 obsolete.

Thanks again,
-Kyu

3
Support Forum / Re: viewport
« on: April 19, 2018, 12:42:29 AM »
I actually have an additional question.

Is there a way to access how how GUI version of OVITO's 'Perspective' viewport calculates its 'View position', 'View direction', and 'View angle' ?

Thank you,
Kyu

4
Support Forum / Re: viewport
« on: April 18, 2018, 11:08:24 PM »
Thank you so much.
This was exactly what I was looking for.
I can't believe I missed that part of the documentation, and only focused on scripting documentation.
Thanks again.

- Kyu

5
Support Forum / viewport
« on: April 17, 2018, 06:17:45 AM »
Hello Dr.Stukowski and OVITO users,

I am trying to output a movie in python scripting. I found there are three parameters I can adjust, but have struggled to really understand what the parameters actually do. Three parameters are as follows:
1. fov
2. camera_pos
3. camera_dir

Could anyone help me adjust the parameters so that I can mimic the 'Perspective' viewport as in GUI? (see attached image)

- Kyu

6
Support Forum / rendering quality
« on: March 11, 2018, 11:15:00 PM »
Hello OVITO users,


I am using 'TachyonRenderer' to output a movie from dump files. (TachyonRenderer is used because I am outputting movie on the remote cluster, so openGL doesn't work)

As you can see from the attached file, quality of the picture is low. This happens so because I am using very big simulation box (3200 angstrom in x direction). Is there a way to increase the definition of the movie?



-Kyu


7
Support Forum / how to import_file with specified dump files
« on: February 25, 2018, 07:32:53 AM »
Hello everyone,

Is there a way to import only the dump files that I want?

I know combining 'wildcard character' and 'multiple_frames' option would allow OVITO to import multiple frames as follows:
Code: [Select]
import_file("dump.200.*",  multiple_frames = True)
However, let's say one has dump files called dump.0000, dump.0001, dump.0002, dump.0003.
And one only wants OVITO to import all the frames only in dump.0000 and dump.0001, excluding dump.0002 and dump.0003.

If anyone has encountered a problem like this and figured out how to do so,
please share your solution.

-Kevin

8
Support Forum / Re: How to calculate max and min of cluster's position
« on: February 14, 2018, 09:00:46 PM »
I just wanted to add why I decided to add clustering feature when identifying stackingfault width.
This was a safety feature that will exclude some of the HCP structures randomly appearing from thermal fluctuation.

-Kevin

9
Support Forum / Re: How to calculate max and min of cluster's position
« on: February 13, 2018, 06:41:08 PM »
Yes definitely, it's always nice to have someone look at my code.

Yes, I don't know why I decided to use clustering when there is going to be only 1 cluster. Thanks for pointing that out.

-Kevin

10
Support Forum / How to calculate max and min of cluster's position
« on: February 13, 2018, 04:49:58 AM »
Hello everyone,

I figured out this problem after writing all the question and right before submitting it,
but I will just post this anyways with the working code in case someone finds helpful.

Following is the code that identifies a cluster of HCP atoms, extracts only the atoms in the cluster, and calculates maximum and minimum x-position of this cluster.

Essentially I was trying to find the stackingfault width of a dissociated dislocation.

Code: [Select]
from ovito.io import *
from ovito.modifiers import *
import numpy

node = import_file("dump.200.*",
                   multiple_frames = True)
# Modifiers                                                                                                 
# Modifier 1: CNA                                                                                           
node.modifiers.append(CommonNeighborAnalysisModifier())

# Modifier 2: Select HCP (dislocation)                                                                     
node.modifiers.append(SelectExpressionModifier
                      (expression = 'StructureType==2'))
# Modifier 3: Cluster HCP                                                                                   
node.modifiers.append(ClusterAnalysisModifier
                      (cutoff=3.5,
                       only_selected = True))
# Modifier 4: Select cluster 0, which doesn't belong to any cluster.                                                                           
node.modifiers.append(SelectExpressionModifier
                      (expression = 'Cluster==0'))
# Modifier 5: Delete cluster 0                                                                                       
node.modifiers.append(DeleteSelectedParticlesModifier())

#Each particle's Position.X in addition to cluster id                                                                   
#can be outputted to xyz format file as follows:                                                           
export_file(node, "1xyz", "xyz",
            columns = ["Cluster", "Position.X"])

# BUT, I wanted to have access to position data in this script level
# to calculate Min and Max values of Position.X
# All particle_properties that belong to 'deleted_particles' seem
# to get deleted
data = node.compute()
cluster = data.particle_properties['Cluster'].array #this is not necessary
pos = data.particle_properties['Position'].array
xpos = pos[:,0]
leading = max(xpos)
trailing= min(xpos)


PS. Just in case someone new to OVITO finds this post and is trying to understand better way of manipulating clustering feature, I found the following post helpful:
http://forum.ovito.org/index.php?topic=118.msg222#msg222
(Note that the post was written 2017 Feb, and note the version of OVITO by then.)

11
Support Forum / Re: source, output attributes
« on: February 11, 2018, 02:26:33 AM »
Thank you for the reply.
I came up with one additional question as follows:

Code: [Select]
# Note                                                                         
# :This works with ovito 3.0.0                                                 

from ovito.io import *
from ovito import dataset
from ovito.modifiers import *
import numpy

node = import_file("dump.200.*",
                   multiple_frames = True)
# Modifiers                                                                     
# Modifier 1: CNA                                                               
node.modifiers.append(CommonNeighborAnalysisModifier
                      (mode=CommonNeighborAnalysisModifier.Mode.FixedCutoff,
                       cutoff=3.5))
# Modifier 2: Selection                                                         
node.modifiers.append(SelectExpressionModifier
                      (expression = 'StructureType==3'))


print(node.source.attributes['Timestep'])
print(node.compute(3).attributes['Timestep'])
print(dataset.anim.current_frame)
dataset.anim.current_frame=3   
node.compute()
print(dataset.anim.current_frame)
print(node.source.attributes['Timestep'])

The results from the last 6 lines of the code are as follows:
print(node.source.attributes['Timestep'])           => 0   [This is OK]
print(node.compute(3).attributes['Timestep'])    => 7500  [This is OK]
print(dataset.anim.current_frame)                    => 0  [This is OK]
dataset.anim.current_frame=3
node.compute()
print(dataset.anim.current_frame)                     => 3  [This is OK]
print(node.source.attributes['Timestep'])            => 0  [This should be 7500]

Quote
node.source is the cache for the current animation time, which is controlled by the global ovito.dataset.anim.current_frame setting (basically the time slider in the GUI). This setting is not affected when you call node.compute(3). Thus, you'll still find data for the current animation time (frame 0) in that input cache.

According to the quote above, I expect the last line of the code to print 7500 instead of 0. Could you explain why this prints 0?

UPDATE
1. this happens only when previous node.compute(3) is there.
If 'frame1' in node.compute(frame1) (6th line from the bottom) and
'frame2' in dataset.anim.current_frame = frame2  (4th line from the bottom) is different, this behavior is not observed.

2. node.source seems to update only after both 'current_frame' has changed and node.compute() has been used.

12
Support Forum / source, output attributes
« on: February 10, 2018, 06:45:37 AM »
Dear Dr.Stukowski,

I observed a weird behavior in both OVITO 2.9.0 and 3.0.0, so I report it here.

The following code reads in two files(dump.200.0000 and dump.200.0001).
Each timestep is incremented by 2500.
So, node.compute(3) should result in timestep 7500.

Since node.compute() should cache the most recent compute to the node.output field,
expected outputs for the last 3 lines of the codes are as follows:
0        => node.source.attributes['Timestep']   
7500  => node.output.attributes['Timestep']
7500  => theOutput.attributes['Timestep']

However, the outputs from 2.9.0 version are as follows:
7500  => (source should remain at the timestep 0)
7500
7500


*I was going to say 3.0.0 version also behaves weirdly as follwos,
*but I guess 3.0.0 version doesn't have output field anymore.
Also, the outputs from 3.0.0 version are as follows:
0
0    =>(I don't think the most recent compute is cached into output field)
7500


Code: [Select]
from ovito.io import *
from ovito import dataset
from ovito.modifiers import *
import numpy

node = import_file("dump.200.*",
                   multiple_frames = True)
# Modifiers                                                                     
# Modifier 1: CNA                                                               
node.modifiers.append(CommonNeighborAnalysisModifier
                      (mode=CommonNeighborAnalysisModifier.Mode.FixedCutoff,
                       cutoff=3.5))
# Modifier 2: Selection                                                         
node.modifiers.append(SelectExpressionModifier
                      (expression = 'StructureType==3'))

theOutput=node.compute(3)
print(node.source.attributes['Timestep'])
print(node.output.attributes['Timestep'])
print(theOutput.attributes['Timestep'])

13
Support Forum / Accessing ovito source for histogram
« on: February 09, 2018, 08:23:10 PM »
Dear Dr.Stukowski,

I want to access how OVITO GUI works when it outputs histogram data.
Specifically, I want to figure out what the output format is. It is because the last floating number of histogram data in the following has one less decimal, and I couldn't mimic this behavior in my scripting version of histogram output. (I am trying to implement automated testing between data outputted from GUI and data from scripting.)

I was able to locate histogram_modifier.py here:
/Applications/Ovito_3.0.0.app/Contents/Resources/python/ovito/modifiers/stdmod/histogram_modifier.py
but this file only specifies how histogram data is created.

Code: [Select]
# Position.X histogram (bin size: 2.01018)
1.09469 2
3.10487 1
5.11505 1
7.12524 0
9.13542 0
11.1456 1
13.1558 1
15.166 1

Thank you,
Kevin

14
Support Forum / Re: Box size in Ovito scripting
« on: February 09, 2018, 05:43:27 PM »
Ahh I see. I just have to use the cell vector anyways. (Since Ovito GUI provides 'Width', 'Length' and 'Height' of box, I thought there may be a function that retrieves the box size, which I couldn't locate on the OVITO documentation. I guess the GUI provides box sizes using by calculating elements in the cell vector.)

PS. By the way, I think the cell origin has to be considered to get the exact box size(unless it's 0).

Thank you again for answering this somewhat trivial question.

15
Support Forum / Re: Box size in Ovito scripting
« on: February 09, 2018, 04:53:14 PM »
Thank you for the reply.


Yes I could use cell vector and then calculate box size using elements in the cell vector as follows:
I was just wondering if there is a function that directly retrieves box size rather than cell vector.


Code: [Select]
cell = node.source.cell                                               
cellSize = cell.matrix
boxLo = cellSize[2][3]                                         
boxHi = cellSize[2][2]                                 
boxSize = boxHi - boxLo 

Pages: [1] 2