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 ... 7
1
Support Forum / Re: Lattice rotation
« on: March 15, 2019, 10:03:25 AM »
Dear Rajdeep,

note that the Affine Transformation modifier takes the transformation matrix that you enter and applies it onto your system. So what you need to enter there is the rotation matrix between your two coordinate systems.

-Constanze


2
Support Forum / Re: SIZE of the clusters
« on: March 15, 2019, 09:51:18 AM »
Hello,

you could select the clusters in question and use the Surface mesh modifier on this selection.
http://ovito.org/manual/particles.modifiers.construct_surface_mesh.html

-Constanze

3
Support Forum / Re: Fatal Python error: deallocating None
« on: March 15, 2019, 09:47:13 AM »
Dear Michelle,

thanks for letting us know, we are looking into this.

-Constanze

4
Support Forum / Re: Problem about using export_file
« on: March 12, 2019, 11:46:34 AM »
Dear Kai,

what's the operating system that you're using? Also could you please copy and paste the exact error message here.

-Constanze

5
Support Forum / Re: Partial radial distribution function (RDF)
« on: March 12, 2019, 11:30:50 AM »
Hello Safy,

yes that's what I find too, see attached partial rdf's. But I don't see any discrepancy between your data and the analysis result. The carbon atoms are just sitting on bcc octahedral lattice sites, right?

-Constanze

6
Support Forum / Re: Partial radial distribution function (RDF)
« on: March 12, 2019, 10:10:12 AM »
Hi Safy,

yes, in principle it works the same way with 3 particle types, just adapt the Neighbor Expression to count the particle type of your choice.

-Constanze

7
Support Forum / Re: Creating histograms of bond lengths
« on: March 12, 2019, 09:51:49 AM »
Hello Sean,

I can see that when you use the Compute property modifier to compute and store the new bond property called "Length" you assign values of 0 to every bond.
What you need to do is to edit the "Expression Field" and replace 0 by BondLength (which should also be visible in the list of available input parameters below the Expression Field).

-Constanze

8
Support Forum / Re: Creating histograms of bond lengths
« on: March 11, 2019, 05:27:57 PM »
Hello,

it's difficult to judge what goes wrong without seeing a screenshot but maybe  your uniform cutoff parameter in the Create Bonds modifiers is too small so no bonds are generated in the first place. Alternatively it could be a syntax mistake in your Compute property modifier. Feel free to upload a screenshot of the modifiers here, then I can help you.

-Constanze

9
Support Forum / Re: Wigner seitz analysis in ovito python script
« on: March 11, 2019, 05:22:25 PM »
Dear ludo,

could you please post the error message you're receiving.

-Constanze

10
Support Forum / Re: Polyhedral Template Matching Reclassification
« on: February 08, 2019, 05:38:20 PM »
Hi Ryan,

for each input particle, the PTM tries to determine a mapping of the local neighborhood to each active candidate structure. If such a mapping exists, a RMSD value is calculated, which is a measure of the spatial deviation from the ideal structure template (the quality of the match). The structural type with the lowest RMSD value is finally assigned to the particle.
You as a user can set a global RMSD cutoff, which limits the assignment of structural types to a range of RMSD values. Particles whose RMSD exceeds the threshold are assigned the "Other" structure type.
So I think what happens in your case is that if you deactivate the HCP structure type, the calculated RMSD values for a another structure type are still below the global cutoff, then they will be marked as such.

https://www.ovito.org/manual_testing/particles.modifiers.polyhedral_template_matching.html

Does that answer your question?

-Constanze

11
Support Forum / Re: Express select
« on: February 08, 2019, 01:22:55 PM »
Dear Ashik,

replace the commas with points, the correct syntax is Position.Z not Position,Z. Also note that the length unit here is Å not nm.

-Constanze

12
Support Forum / Re: Express select
« on: February 08, 2019, 12:25:54 PM »
Dear Ashik,

the Expression select modifier requires you to enter a boolean expression. The syntax supported by the modifier is very similar to the one used by the C programming language, see Manual:
http://ovito.org/manual/particles.modifiers.expression_select.html

If your nanowire is aligned with the z-axis and centered at (0,0,0) try for example:
Code: [Select]
Position.X * Position.X + Position.Y * Position.Y > 190^2 to select all atoms with r > 19 nm.

By the way, in the latest developer version, the Construct surface mesh modifier, also has an option Select particles on the surface, which might be of interest to you.
https://ovito.org/manual_testing/particles.modifiers.construct_surface_mesh.html

-Constanze

13
Hi Zhi-Gang,

in this topic it was discussed how to average different histograms,
http://forum.ovito.org/index.php?topic=450.0,
you can follow a similar approach.

If you want to do it without the GUI, here is an example script for a batch script that calculates time-averaged RDF's:
http://ovito.org/manual_testing/python/modules/ovito_modifiers.html#ovito.modifiers.CoordinationAnalysisModifier

The structure factor is the Fourier transform of the radial distribution function, right? So you could write a python script (you don't even need ovitos for that)
 that post-processes your radial distribution function.

-Constanze

14
Support Forum / Re: Counting specific particle types inside a cluster
« on: February 07, 2019, 08:44:28 PM »
Hi,

if you're using the latest developer version of OVITO the Unwrap trajectories modifier could be of interest to you.
http://www.ovito.org/manual_testing/particles.modifiers.unwrap_trajectories.html

In other cases I've also worked with a combination of the Replicate, Affine Transformation (apply a translation to only the particles not the simulation cell) and Wrap at periodic boundaries modifiers.

It depends on if the molecules are already split at a boundary in the initial frame or not.
Does that work for you?

-Constanze
 

15
Support Forum / Re: Python script slice modifier
« on: February 07, 2019, 12:16:47 PM »
Dear Haomin,

from the code snippet you sent I cannot find any reason why you would get an attribute error
AttributeError: 'ovito.plugins.PyScript.Viewport' object attribute 'camera_dir' is read-only,
so I guess you already resolved that yourself. Let me know if that's not the case.

Concerning the camera position, you chose a parallel projection viewport of type "Ortho".
In this case, the camera position has no influence on the size of the object your viewing.
What you could do is either adapt the field of view (fov) parameter,
Code: [Select]
vp.fov or change to a different viewport of type "Perspective".

One more note, I think you don't need the last line image.save(), you can pass the filename
directly to the the render_image() function instead.

Code: [Select]

vp.render_image( size = (480, 480), \
              background = (0,0,0), \
              renderer = OpenGLRenderer(),\
              filename = "/Users/h ...image{}r.png".format(i) )

-Constanze


16
Support Forum / Re: Render camera_dir problem
« on: February 05, 2019, 09:37:38 PM »
Dear Haomin,

please post the code that's causing you this error.

-Constanze

17
Support Forum / Re: Loop over the frames calculation
« on: February 05, 2019, 09:34:16 PM »
Hi Ali,

to answer your first question, if you simply want to calculate an average of a particle property for each frame you can do it using a custom python script modifier function in the GUI as often discussed in this Forum and explained in the FAQ. The following script (OVITO 3) will calculate the average atomic shear strain, print and save that information as a global attribute for each frame. Global attributes can conveniently be exported to a text file using OVITO's file export function, see Manual https://ovito.org/manual_testing/data_inspector.attributes.html
Code: [Select]
from ovito.data import *
import numpy as np

def modify(frame, data):
    avg_shear_strain = np.mean(data.particles["Shear Strain"])
    print(avg_shear_strain)
    output.attributes["Average shear strain"] = avg_shear_strain

As for your second question, the previous example is a batch script. It's meant to be executed with ovitos (OVITO's script interpreter) from the command line. See the Scripting Manual for more details.
https://ovito.org/manual_testing/python/introduction/running.html
In short, if you have installed OVITO in C:\ProgramFiles, you execute it like this:
Code: [Select]
"C:\Program Files\Ovito\ovitos.exe"or you add that folder to your path variable
Code: [Select]
set PATH=%PATH%;"C:\Program Files\Ovito\"so you don't need to type the whole path every time.
Also don't forget to import the numpy and the ovito.io modules.

-Constanze

18
Support Forum / Re: Loop over the frames calculation
« on: February 05, 2019, 05:18:44 PM »
Hi Ali,

that's not possible at the moment, since the python script modifier in the GUI is part of the pipeline which is evaluated for each frame.
It can't manipulate the pipeline itself that it is part of (e.g. adding/removing modifiers) or otherwise change the global program state.
For more details, I'll refer you to the documentation on custom modifiers:
https://ovito.org/manual_testing/python/introduction/custom_modifiers.html

-Constanze

19
Support Forum / Re: Loop over the frames calculation
« on: February 05, 2019, 10:19:10 AM »
Dear Ali,

you can do it using a small batch script that you need to execute with ovitos.  Say you're calculating a system average of a particle property "My Property" and then also want to average that over different frames. This can be done like this for example:
Code: [Select]
pipeline = import_file("simulation*.dump")
sum = 0.0
for frame in range(pipeline.source.num_frames):
    data = pipeline.compute(frame)
    sum += numpy.average( data.particles["My Property"] )
print( sum/pipeline.source.num_frames )
also see here
http://www.ovito.org/manual_testing/python/introduction/file_io.html

Does that solve your question?

-Constanze

20
Hello,

there is no issue with the way you're performing the analysis, it's rather that for your system it's not that clear to me how you should define a BO3 and BO4 units.
I had a look at your structure and it looks almost amorphous to me, is that the case? The issue is that there is not really a clear criterion that would let you distinguish between 3-fold and 4-fold coordinated B-O units here since there is a wide range of bond lengths of B-O neighbor bonds.
If we simply compare coordination numbers for different cutoffs, you'll find that there is always a broad distribution of coordination numbers (often ranging from 2 to 10) and not only 3-fold and 4-fold ones.
This is also visible in the partial rdfs.
At the moment, I don't have any better suggestions how to tackle this.

-Constanze

21
Support Forum / Re: Distribution of coordination number
« on: February 04, 2019, 02:23:48 PM »
Dear Mahsa,

alright, I had a look at your data. You were asking how to calculate the number of O-atoms (which have a particle type id = 1 as shown in the screenshot) around the Li-atoms (in your case named "Li+" and having a particle type id = 4).

In the python script you posted here you're obviously counting C atoms around O-atoms, because you iterate over particles having a particle type 1 and count how many neighbors of type 2 they have. Bottom line is, you should never just copy and paste a custom python modifier
function without understanding every bit of it.
I know it's quite a steep learning curve in the beginning, so here's the corrected version (for the latest OVITO developer version) as a head start for you:

Code: [Select]
from ovito.data import *
import numpy as np

def modify(frame, data):
    # Prefetch the property array containing the particle type information:
    ptypes = data.particles['Particle Type']
    #Create a new particle property that stores the number of neighbors with particle type 2 and initialize with zeros
    values = np.zeros(data.particles.count, dtype=int)
    new_property = data.particles_.create_property('Li-O Coordination', data=values)
    # Initialize neighbor finder object:
    cutoff = 2.
    finder = CutoffNeighborFinder(cutoff, data)
   
    # Loop over all particles:
    for index in range(data.particles.count):
        #Only iterate over particles of type Li
        Li_type_id = ptypes.type_by_name('Li+').id
        if(ptypes[index] == Li_type_id):
           # Get a list of particle types of all neighbors of the current particle:
            neighbor_types = np.array([ptypes[neigh.index] for neigh in finder.find(index)])
            #Count the number of  O neighbor types and store them in the newly created particle property
            O_type_id = ptypes.type_by_name('O').id
            with new_property:
                new_property[index] = np.count_nonzero(neighbor_types == O_type_id)

In case you are unsure about what particle type id corresponds to what particle type name  the function type_by_name().id is very useful.
https://ovito.org/manual_testing/python/modules/ovito_data.html#ovito.data.Property

Furthermore, you asked if you could distinguish between two different groups of O-atoms. Yes, in your case that's possible because they have a distinguishable feature which is the Molecule Type.
So you have O atoms which have a Particle Type 1 and a Molecule Type 1 ("LIG") and another group of O-atoms which have a Particle Type 1 and a Molecule Type 3 ("tf2") and you
can select the atoms that fulfill both conditions, e.g. just

add a line at the top where you get the molecule types
Code: [Select]
mtypes = data.particles['Molecule Type']
and then e.g. replace the if condition by:

Code: [Select]
if(ptypes[index] == Li_type_id):
           # Get a list of particle types of all neighbors of the current particle:
            neighbor_types = [ ( ptypes[neigh.index], mtypes[neigh.index]) for neigh in finder.find(index)]
            #Count the number of  O neighbor types and store them in the newly created particle property
            print(neighbor_types)
            O_type_id = ptypes.type_by_name('O').id
            tf2_type_id = mtypes.type_by_name('tf2').id
            print(tf2_type_id)
            with new_property:
                new_property[index] = neighbor_types.count( (O_type_id, tf2_type_id))

where you use both the Particle Type and the Molecule Type as criterion in the count function.

Let me know if you have questions,

-Constanze

22
Support Forum / Re: Distribution of coordination number
« on: February 04, 2019, 12:03:29 PM »
Dear Mahsa,

you don't need to upload the whole trajectory, a single shapshot would be enough for me as an example. But yes you can share a download link here or sent a private message to us via the mail support.
The script doesn't seem to be the problem, are you sure the cutoff used for the CutoffNeighborFinder function is appropriate? I'm happy to look into it further once I have access to the data.

-Constanze

23
Support Forum / Re: homogeneous cell deformation IN OVITO 3.0.0
« on: February 04, 2019, 11:58:22 AM »
Dear Bahman,

in OVITO 3.0.0 this feature has been upgraded and renamed to Affine mapping of the simulation cell, see e.g.,
http://ovito.org/manual_testing/particles.modifiers.displacement_vectors.html
and
http://ovito.org/manual_testing/particles.modifiers.atomic_strain.html

-Constanze

24
Hello,

it is difficult for me to diagnose why you obtain certain results without having insight into your data. If you like you can upload an example file here, then I can try to help.
Also, did you opt for the Python script modifier or the Compute property modifier?

Concerning the partial radial distribution functions, yes you can do it using a custom python script modifier, as explained here
http://forum.ovito.org/index.php?topic=131.0,
but it's easiest to just update to the latest developer version of OVITO, where the Coordination analysis modifier in the GUI has a checkbox  "Compute partial RDFs".

-Constanze

25
Support Forum / Re: Distribution of coordination number
« on: February 01, 2019, 10:13:26 AM »
Dear Mahsa,

could you upload an example of your structure here and also paste the python script, then I can help you more easily.

-Constanze

26
Support Forum / Re: Python script slice modifier
« on: January 31, 2019, 11:27:57 AM »
Dear Haomin,

just to confirm, your rendering images programmatically and you're asking about the Slice modifier in the Python API, right?
Note that the Slice modifier takes an argument "normal", which is the normal vector of the slicing plane and by default is set to (1,0,0). You can adapt that to your needs, e.g.

Code: [Select]
from ovito modifiers import SliceModifier
pipeline.modifiers.append( SliceModifier( normal = ( 1, 1, 2)) )
https://ovito.org/manual_testing/python/modules/ovito_modifiers.html#ovito.modifiers.SliceModifier

Edit:   You can then set up the viewport’s virtual camera and e.g. control the viewing direction vector like this:

Code: [Select]
from ovito.vis import Viewport
vp = Viewport(type = Viewport.Type.Ortho, camera_dir = (1, 1, 2))
vp.zoom_all()
https://ovito.org/manual_testing/python/modules/ovito_vis.html,


-Constanze

27
Support Forum / Re: color coding
« on: January 30, 2019, 05:47:09 PM »
Dear Bahman,
in that case I think it’s easier to use the Expression selection modifier in conjunction with the Assign color modifier. So first select all atoms with the desired atomic property value (or value range) and then give this selection a color of your choice.
Does that work for you?
-Constanze

28
Support Forum / Re: The mutable problem in Function
« on: January 30, 2019, 02:05:23 PM »
Hello,

in the latest version you don't need to use two separate "input" and "output" data objects. Now the DataCollection data initially holds the input data objects of the modifier, which were produced by the upstream part of the data pipeline. Your user-defined modifier function is then free to modify the data collection and the data objects stored in it, so simply do it like this:

Code: [Select]
def modify(frame, data):
    data.cell_.pbc = (True, True, False)

-Constanze

29
Support Forum / Re: color coding
« on: January 30, 2019, 01:54:14 PM »
Dear Bahma,

the start and end values in the Color coding modifier
http://www.ovito.org/manual/particles.modifiers.color_coding.html
control the value range for the linear mapping of input values to the [0,1] interval. More detailed, the values of the selected input property are first mapped and clamped to the unit interval [0,1] according to the Start value and End value parameters of the modifier. The normalized values are then mapped to a color using the selected color gradient map and finally assigned to the particles or bonds.

-Constanze

30
Hello Tina,

thanks for uploading the structure. Yes, that the surface atoms will be identified as "Others" is completely expected. Interestingly, inside the cluster there is a mixture of atoms that are identified both as fcc and hcp and the center atom is sitting in a perfect icosahedral environment. Note, that a twin boundary in the fcc structure would be a {111}-hcp plane and I can't really identify that in your cluster, but I think you maybe mean something else by twin boundaries?

Regardless, you can see that there is some sort of symmetry in the arrangement of the of the atoms colored by different structure types. I attached a little video for you that shows your cluster, one time viewed from a "corner atom" and one time the viewing direction is perpendicular to a facet. You can use the Slice modifier
http://ovito.org/manual_testing/particles.modifiers.slice.html
 to slice through your structures like in the animation. I used the functions "Pick three atoms" and "Align plane normal to view direction" to find the correct slicing planes and animated the slice using the auto-key mode.
http://ovito.org/manual_testing/usage.animation.html

-Constanze

Pages: [1] 2 3 ... 7