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 ... 9
Hi benjy,

thank you for uploading the files. When you imported your files with the developer version,  did you deactivate the option "Detect reduced coordinates" in the XYZ-file reader?
Because it seems that this is what causes you problems. That still doesn't explain why ovito would assume that you have reduced coordinates and then scale the coordinates with the given lattice dimensions (x10 in your case) for only some frames as you say, so I will continue looking into this.

But as a quick fix for now, please deactivate the option "Detect reduced coordinates" in the XYZ File reader panel (see attached screenshots) and then use the "Reload data button". Then everything should be imported correctly.
Let me know if that doesn't work for you.


Edit: The explanation for this behavior is that the option "Detect reduced coordinates" will assume your data is in reduced format if all coordinates are within the [0,1] or [-0.5,+0.5]. Now in your very special case of only 3 particles, you have certain frames where that's true (e.g. in the frame in the screenshot).  So you will definitely need to deactivate that auto-detect option.

Hi benjy,
if you like you can upload some example frames of your trajectory here so I can look into this. Also it would be helpful to know what version of OVITO you’re using.

Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: May 22, 2019, 04:50:51 PM »
Dear jaguarjom123,

I had a look at your structure you uploaded and the only information that you have in your data is the atom type and the positions - nothing more. That makes the analysis a little bit more complicated for you.

So in order to be able to calculate how many molecules are close to the surface of your Pt nanoparticle, you first need to teach ovito which atom belongs to which molecule. You could store that information in a particle property "Molecule ID" e.g..
The way to do this is to e.g. use the Create bonds modifier with an appropriate cutoff to identify particles that share a bond with other particles in conjunction with a Python script modifier. Below is an example of a custom python script modifier that checks which atoms are connected through bonds and assigns these groups a unique Molecule ID as particle property.
There is certainly more than one solution to do this, the following is just an example for you to know where to start:
Code: [Select]
from import *
import numpy as np
def modify(frame, data):
    molecule_counter = 1
    molecule_ids = data.particles_.create_property("Molecule Identifier")
    bond_topology = data.particles.bonds.topology  # array with bond topology
    # Create bonds enumerator object.
    bonds_enum = BondsEnumerator(data.particles.bonds)

    # Loop over atoms.
    for particle_index in range(data.particles.count):
        # Loop over bonds of current atom.
        bond_pairs = [ (bond_topology[bond_index][0],bond_topology[bond_index][1]) for bond_index in bonds_enum.bonds_of_particle(particle_index)]
        if len(bond_pairs != 0):
            neighbor_indices = np.unique(bond_pairs)
            if (np.all( [molecule_ids[i] for i in neighbor_indices]) == 0):
                    with molecule_ids:
                        molecule_ids[neighbor_indices] = molecule_counter

Then you could use the Select Type modifier (-> Particle Type 4) and after that the Expand selection with your desired cutoff value. This selects all atoms close to the surface of the sphere (and also inside, but you could delete these later if you don't want to look at them).
You should then apply another Expand selection modifier, this time with the option "bonded to a selected particle" (also increase number of iterations) to make sure you didn't only select half of a molecule with the previous modifier.
Now Invert and then delete the selection.
I attached the resulting picture in a screenshot.



yes, have a look at the manual for the python scripting interface:
or if your using the latest developer version.
In general, you would load your file(-sequence) and set up your pipeline by adding all the modifiers. Then, you can just
loop over all the frames of your loaded animation sequence like this:
Code: [Select]
# Load a sequence of simulation files 'frame0.dump', 'frame1000.dump', etc.
node = import_file("simulation*.dump")

# Set up data pipeline, apply modifiers as needed, e.g.

for frame in range(node.source.num_frames):

    # This loads the input data for the current frame and
    # evaluates the applied modifiers:
    output = node.compute(frame)

    # Work with the computation results


Hi benjy,

I need to know exactly what you're doing during your analysis in order to be able to help you. Seems like your somehow manipulating the positions?


yes, you can disable a modifier by setting its attribute "enabled" to False, see documentation

If you want to delete it altogether, you can use the standard python del operation.


Support Forum / Re: Particle count on multiple selected clusters
« on: May 17, 2019, 05:24:40 PM »
Hi shanis,

do I understand you correctly that you want to export all individual cluster ID's along with your custom property "Cluster size"?
In that case, if you have used numpy.bincount() to calculate the number of C-atoms in your different clusters
Code: [Select]
cluster_sizes = numpy.bincount( data.particles['Cluster'][ptype == C_type_id])
you already got the information you would like to export. "cluster_sizes" is an ndarray of length max(Cluster ID's) +1 that contains a bincount (i.e. the cluster sizes) of each
occuring Cluster ID. You could use numpy.where() to filter out clusters smaller or larger than a certain size
and then e.g. numpy.savetxt() to export this to a textfile.


Support Forum / Re: Particle count on multiple selected clusters
« on: May 17, 2019, 10:44:02 AM »
Hi shanis,

if you use the Expression selection modifier with the expression you posted above, you will select all carbon atoms that belong to clusters which contain more than 100 carbon atoms. You could then continue from there by counting the individual Cluster-ID's (i.e. the number of clusters) within that particle selection, e.g. using numpy.unique()

Code: [Select]
selection = data.particles['Selection']
cluster_ids = data.particles['Cluster']
cluster_count = len( numpy.unique( cluster_ids [ selection == 1] ))
data.attributes["My_cluster_count"] = cluster_count

For each frame, you could then store that information as a global attribute which in the end can be exported using the File export function "txt/attr", e.g.

Code: [Select]
export_file(pipeline, "cluster_count.txt", "txt/attr", multiple_frames = True,
         columns = ["Frame", "My_cluster_count"])


Support Forum / Re: WS analysis
« on: May 14, 2019, 11:32:54 AM »
Dear Karthik,

thanks for uploading the files for me, now I understand what's causing you problems. Note, that the Wigner Seitz defect analysis modifier has two output modes, i.e. the "sites" and "atoms" output modes.

In "sites" output mode, the modifier outputs the sites of the reference configuration together with their computed per-site occupancy numbers. Each site will be associated with a particle property named Occupancy, telling the number of atoms sitting on that site. This integer property subsequently allows you to identify vacancy and interstitial sites. It is important to realize that in this output mode, the displaced configuration gets completely replaced with the reference configuration after performing the WS algorithm.

In "atoms" output mode, in contrast, the modifier will output the atoms of the displaced configuration. Each atom will be assigned a property named Occupancy, now counting how many atoms in total are occupying the same site as the atom itself. Furthermore, the modifier will assign a property named Site Type, which tells for each atom the type of reference site it has been assigned to by the WS algorithm. This information allows to subsequently identify antisites, for example, by comparing the type of an atom to the type of its site. Finally, the algorithm assigns two additional properties named Site Index and Site Identifier to each atom, specifying the index and the unique identifier (if present) of the site to which the atom has been assigned. This information allows you to subsequently identify atoms which have left their original sites, for example. Note, however, that in "atoms" output mode you will not be able to identify vacancy sites, because only the physical atoms are retained. That's why you find 0 elements when you use the expression selection modifier with "Occupancy == 0".

Maybe it becomes more clear with an example: In your case, the Wigner Seitz defect analysis modifier calculated that you have 271 vacancies and 271 interstitials. You can double check that by using the Expression selection modifier:
If you select the output mode: "Sites" in the WS modifier, and then "Occupancy == 0" as expression selection you will get 271. However, to count the interstitials you need to pay attention to how many atoms occupy a site. As for your specific example "Occupancy > 1" selects 270 atoms. That's doesn't mean that there are only 270 interstitials. You have 269 sites with "Occupancy == 2" and 1 site with "Occupancy == 3". The latter site hosts 2 extra atoms, i.e. 269+2 = 271 interstitials.

Moreover, if you choose the "atoms" output mode you will get 2x269 = 538 sites that have a particle property Occupancy equal to 2, since in that mode the property "Occupancy" now tells you how many atoms share the same site as the atom itself. Consequently, for the one site that hosts 3 atoms, there are 3 atoms that fulfill "Occupancy == 3".


Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: May 13, 2019, 11:47:23 AM »

so do you still need to identify the molecules that formed (i.e. which atoms belong to which molecule), or do you have that information in your xyz file? If not, you probably first need to use the "Create bonds" modifier to
take care of that:
Then, you could select the atoms in the center and again use a bond-based criterion, or a Compute property modifier to count the molecules in the vicinity of your selected atoms.

In any case, I need to see the data to give you more specific input.

Support Forum / Re: WS analysis
« on: May 13, 2019, 11:36:18 AM »
Dear Karthik,
you can upload an example file for me here, if you want me to look into this further.

However, did you export the global attributes WignerSeitz.vacancy_count and WignerSeitz.interstitial_count? Note that the latter
counts the total number of excess atoms, summed over all sites of the reference configuration. A site with occupancy=2 has one excess atom. A site with occupancy=3 has two excess atoms, and so forth.
Is that maybe what causes your confusion?


the attribute "ClusterAnalysis.cluster_count" gives you the total number of Clusters produced by the modifier. What you probably meant to do is select Clusters based on their Cluster-ID's. For that you should use the particle property "Cluster", e.g. use the Expression selection modifier with:
Code: [Select]
Cluster > 3and then delete these atoms to show only Clusters 1 to 3.

See also
Does that work for you?


Dear Dong,

your best chance is probably to get the NVIDIA driver running, but I'm afraid I cannot help you with that. Does the same problem appear with other programs, like VMD or Paraview?



the current analysis tools of OVITO don't support more complicated structures like cementite yet. However, if you like you can upload an example file of your dislocation here so we can look into this further.


Support Forum / Re: Particle count on multiple selected clusters
« on: May 10, 2019, 12:24:28 PM »
Dear shanis,

in your above code snippet, you could create a selection based on the cluster ID's and then only loop over particles that have a particle property selection == 1.

Alternatively, you could simply use numpy.bincount() to calculate the number of C atoms in each cluster:
Code: [Select]
def particle_counting(frame, data):
    ptype = data.particles['Particle Type']
    C_type_id = type_property.get_type_by_name('C').id
    cluster_sizes = numpy.bincount( data.particles['Cluster'][ptype == C_type_id])
Since you initially sorted them by size you know which entry corresponds to which Cluster-ID.

Code: [Select]
    cluster_size_property = data.particles_.create_property("ClusterSize", dtype = int, components = 1)
    with cluster_size_property:
        for i in range(len(cluster_sizes)): #Or adapt to your needs...the first three clusters e.g. would be range(1,4)
            cluster_size_property[(ptype == C_type_id ) & ( data.particles['Cluster'] == i) ] = cluster_sizes[i]


Support Forum / Re: WS analysis
« on: May 10, 2019, 12:05:49 PM »
Dear Karthik,

sorry I don't understand yet what the issue is. Could you please elaborate the problem?


Dear shanis,

ah okay, sorry I somehow missed that you would like to get the individual cluster volumes instead. You're right, at the moment this is not possible yet by only applying the Surface mesh modifier once, but it is very likely a feature of the next release. So for now, you will have to use a little workaround, like you already suggested in your previous post, e.g. by looping over the Cluster-ID's and then applying the Surface mesh modifier to each individual cluster, e.g. :

Code: [Select]
clusterselect_modifier = SelectExpressionModifier()
pipeline.modifiers.append(ConstructSurfaceModifier(only_selected = True))
for clusterID in range(1,6):
    my_expression = "Cluster == {}".format(clusterID)
    clusterselect_modifier.expression = my_expression
    data = pipeline.compute()


Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: May 10, 2019, 11:23:26 AM »
Dear jaguarjom123,

no worries, I opened a new topic for you. In principle you can just click on "New Topic" on the Forum main page, and after if is approved by an admin it will be visible to the public.

It is a little difficult to help you without having detailed information on your system, so if you like you can upload an example file here in the forum using the "Attachements" function below the text-editor. That way I can have a look at your system and give you more specific advice.
But as a starting point: You said that your data includes molecule ID's. Note that you can use the Expression selection modifier to select molecules based on their ID's then and even delete all other atoms from the scene. Furthermore, you could calculate the center of mass of each molecule and e.g. use the Generate trajectory lines modifier to visualize their trajectories. You could also use a custom Python script modifier to calculate mean squared displacement etc.
Let me know if you have questions regarding any of those analyses.


Support Forum / Re: DisplacementMagnitude
« on: May 10, 2019, 10:54:35 AM »
Hello Icosta,

thanks for uploading the files. So the problem is that you didn't dump the atom ID's along with the positions etc. And unless you didn't specifically make sure that the atoms in the different snapshots are still sorted by their atom ID's there is no way you can calculate displacements in post-processing. Let me give you an example: Let's call the atom that is in the fifth line of the cfg file atom 5. If there is no particle property "Particle Identifier"-  OVITO then calculates the displacement vector of atom 5 by taking the reference position of the atom in the 5th line in the reference file. However, in your case it is very likely not the same particle. So you're really comparing positions of different particles that's why the displacements you calculated are so large.
So for the future, either dump the ID's or turn on sorting by atom ID's when dumping to avoid these problems.


Support Forum / Re: DisplacementMagnitude
« on: May 09, 2019, 07:37:07 PM »

it seems that there is an issue with your input data. Can you upload the two cfg files here, e.g. the current file and the reference you used? Than I can look into this further tomorrow.


Support Forum / Re: DisplacementMagnitude
« on: May 09, 2019, 07:04:48 PM »

please upload your screenshot here in the forum, using the "Attachments" function below the text editor.  The link you posted here shows a black image, so I can't see what you did.


Support Forum / Re: Problem of launching OVITO 2.9.0 on Centos 6.4
« on: May 06, 2019, 11:48:40 AM »

please follow the instructions on the Download page under Note to users of RHEL and similar Linux distributions,
i.e. download and copy the two *.so files to the lib/ovito/ subdirectory of the OVITO installation. This should fix your error.

However, are you sure that your HPC supports remote 3D visualization? If that's not the case you should use
ovitos (which is OVITO's python scripting interface) instead of the graphical user interface.
for more details.


Dear shanis,

in order to help you, I need to know what makes the five clusters you're trying to select different from the others? For example, if you wanted to get the 5 biggest clusters out of those 10 you could activate the option "Sort clusters by size"
and then create a selection based on their cluster ID's
Code: [Select]
clusterselect_modifier = SelectExpressionModifier(expression = 'Cluster <= 5')]Just let me know a little bit more about your system.


Support Forum / Re: Output position of dislocations using the DXA tool
« on: April 30, 2019, 09:49:54 AM »
Also, if you're familiar with the python scripting interface, you might find this code example useful:
In short, this is how you can access the individual dislocation segments of the dislocation network and print the coordinates of the vertex points.
Code: [Select]
data = node.compute()
for segment in data.dislocations.segments:


Support Forum / Re: How to calculate the defect cluster.
« on: April 29, 2019, 03:05:19 PM »

it is still not fully clear to me what you mean by "measuring the interstitial cluster". Also, please carefully read the description of the Wigner-Seitz defect analysis modifier in the manual:
In the "sites" mode, the modifier outputs the sites of the reference configuration together with their computed per-site occupancy numbers. In that case Occupancy == 1 means there is one atom sitting on that site,
so there is no interstitial atom, on the contrary, it is a regular lattice site. Interstitials are only present when you have an occupation number greater than 1.

As for the Cluster analysis: If you activate the option "Use only selected particles" you will restrict the clustering algorithm to your currently selected particles (in your case all single interstitial sites Occupancy == 2).
Unselected particles will be treated as if they do not exist and will be assigned the special cluster ID 0. So if you wanted to get clusters (defined by your cutoff) of that specific defect type, what you did there works.
Furthermore, in the above manual entry it is explained how to export the cluster sizes.

By the way, if you need to count the number of (specific) defects in the neighborhood of each defect (within a predefined cutoff range) and don't want to write a python script for that you could make use of the Compute property modifier.
This modifier allows you to generate new particle properties and use selective and conditional property assignment, e.g.
    Neighbor expression:
        @Occupancy == 2 && Occupancy == 2
    Cutoff Radius:
will count the number of single interstitial sites in the neighborhood (cutoff = 3 Angström) of each interstitial site and store that in the particle property you defined in "Output property".
Let me know if you were asking for something different.


Support Forum / Re: Output position of dislocations using the DXA tool
« on: April 29, 2019, 02:05:19 PM »

what you could do is export the dislocation lines in the *.ca file-format.

In this file-format you'll find a section DISLOCATIONS that contains the number of dislocation lines extracted by the DXA, followed by the definition of each line.
Each dislocation line definition also contains the coordinates of the vertices that make up the dislocation line.


Support Forum / Re: How to calculate the number of H-Bonds
« on: April 29, 2019, 12:29:36 PM »
Dear Sahar,

I don't have a good understanding of your system yet, but it sounds like you could use the Create bonds modifier with pairwise cutoffs to first find all neighbors of each hydrogen atom within a cutoff of 3.5 Angström.
Then you could have a look at this topic, where it is discussed how to calculate bond angles. In principle you could write a custom python script modifier that calculates bond angles for all Donor-H-Acceptor pairs
and then create a selection for only those pairs that fulfill your bond angle criterion.


Dear zahid,

just so I understand correctly: You would like to count how many atoms have displacement vectors larger than 0.75 Å with respect to your reference state?
Then you would first add a Displacement vector modifier to your pipeline and load the reference state of your choice.
You will see that each particle now has a particle property "Displacement Magnitude" which is the length of the corresponding displacement vector.
In a next step, you can insert an Expression selection modifier at the top of your pipeline and create a selection based on the displacement, e.g.
Code: [Select]
DisplacementMagnitude > 0.75 . You will then see the number of selected atoms below the Expression editor field. It will also appear as Global Attribute under "SelectExpression.num_selected". That means you can export that
information (even the time-series) as a text-file using the built-in file-export function.



with the help of the Voronoi analysis modifier you can compute the Voronoi indices of the Voronoi cell of each atom, which are stored as individual particle property.
Analogous to the procedure in the GUI, in a python script you would simply add the Voronoi analysis modifier to your pipeline and set the option "compute_indices=True".

Also, there is a ready-to-use code example in the manual which shows you how to calculate the distribution of Voronoi polyhedra in your metallic glass:

In order to distinguish between different particle types of the center atoms of each coordination polyhedron you can e.g. create a selection based on their particle type.


Support Forum / Re: Error involving particles xyz positions at 0/
« on: April 25, 2019, 01:49:59 PM »
Hello benjy,

ovito should accept the following argument in the header of your xyz file:
Code: [Select]
cell_origin="-5.0 -5.0 -5.0"

Pages: [1] 2 3 ... 9