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 ... 10
1
Dear Bahman,

it depends on what you would like to do specifically, but if you have used the Wigner-Seitz defect analysis modifier you will have created two global attributes "WignerSeitz.vacancy_count" and "WignerSeitz.interstitial_count". Global attributes can be easily exported to a text file using the File-export function "Table of values" in the GUI.
https://ovito.org/manual_testing/particles.modifiers.wigner_seitz_analysis.html

-Constanze

2
Support Forum / Re: Affine mapping of the simulation cell
« on: June 12, 2019, 12:16:36 PM »
Dear Bahman,

if you don't have periodic boundary conditions in z-directions and also the size of your simulation is changing than this option should not be applied.

-Constanze

3
Hello,

I'm wondering is there any particular reason you're using an outdated version of OVITO?
In OVITO 2.9 you could use the Compute bond length modifier for that.
https://ovito.org/manual/particles.modifiers.compute_bond_lengths.html,
whereas in OVITO 3.0 the latter has been removed since it can be done with the Compute property modifier, as you were already trying to do.
https://ovito.org/manual_testing/particles.modifiers.compute_property.html

-Constanze

4
Support Forum / Re: Regarding Wiegner Seit modifier
« on: June 09, 2019, 03:53:51 PM »
Dear Bahman,

the difference is that you are referring to the OVITO 2.9 manual, whereas ovito.org/manual_testing is the manual of the latest developer version.
You'll see this if you follow the links to the documentation of the respective OVITO versions on the download page.
https://ovito.org/index.php/download

-Constanze

5
Support Forum / Re: How to View only the Particles which I selected
« on: June 07, 2019, 12:02:36 PM »
Dear Masato,

I'm note sure I understand the issue correctly, what do you mean by "backcalculate" the particles?
If you only want to view a certain particle type or monomer type for example, you could use the Select particle type modifier to select the particle types you don't need and then delete them.
If you want to visualize particles with a specific particle identifier only (let's say ID = 10), you can simply use the Expression select modifier to select all others:
Expression: "ParticleIdentifier != 10"
and then apply the Delete selected particles modifier on your selection. Does that answer your question?
The same could be achieved by applying an Expression selection "ParticleIdentifier == 10" in conjunction with the Invert selection modifier and then Delete selected particles modifier.

-Constanze

6
Hi shanis,

yes, the number of clusters can of course vary in every frame. Which clusters would you like to further examine? From your first post I assumed that it's the biggest five. Seems that that's not the case.

 
-Constanze

7
Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: June 04, 2019, 11:17:03 AM »
Hi,
no this is not how that works. The neighbor expression is really:
NeighborExpression: @MoleculeID == MoleculeID
Also, I assume the cutoff needs to be much larger, in order to assure that you're not missing any neighboring atoms. However, it seems like the Compute property modifier caused even more confusion.

So I suggest you to try to solve this with a python script like I explained above and let us know if you're stuck.

-Constanze

8
Hello Peter,

this might be helpful
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

and also the link to the OVITO code if you're interested in the technical details:
https://gitlab.com/stuko/ovito/blob/master/src/core/utilities/linalg/Quaternion.h#L283-318

-Constanze

9
Hello shanis,

1. can you explain why it does not work for you? In principle you should be able to loop over all frames and clusters without any problem.
2. If you like you can upload that problematic frame for us here so we can try to understand the problem. For now, in order to avoid your analysis script to crash you could use a try/except python statement.

-Constanze

10
Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: June 04, 2019, 10:05:46 AM »
Dear jaguarjom123,

you're right, the code snippet I posted above was meant for ovito 3. And yes, the error in line 16 was a typo, thanks for pointing that out. I corrected that in the above version.
Concerning your second question, I think it's easiest if you loop over all particles and then - based on the particle property "Molecule ID" you created - check how many atoms (and atom types) belong to each molecule. That way you can easily distinguish H2O2 and HO e.g.

If you're not comfortable with the python scripting interface yet, you could try to achieve the same by using the Compute property modifier. As an example, this will count the number of atoms within the neighborhood of a particle that share the same property Molecule ID as the central particle.
Expression: 0
NeighborExpression: @MoleculeID == MoleculeID

-Constanze


11
Support Forum / Re: Visulaise the Molecule in dump xyz lammps file
« on: May 24, 2019, 02:25:45 PM »
Dear jaguarjom123,

you would need to develop your own custom python script modifier function for that. In principle you could use the example function I posted above and modify it such that it also assigns a property "Molecule type" based on the number of neighbors that are found for each atom.
Then, within your selection of molecules close to the nanoparticle, you could specfically look for certain molecule types.

-Constanze

12
Hi benjy,

you're right, unfortunately this is not documented yet. But when you use import_file(), you should be able to pass
Code: [Select]
rescale_reduced_coords = False
-Constanze

13
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.

-Constanze

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.


14
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.
-Constanze

15
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 ovito.data 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
                    molecule_counter+=1
           

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.

-Constanze

16
Hi,

yes, have a look at the manual for the python scripting interface:
http://ovito.org/manual/python/introduction/file_io.html
or
http://ovito.org/manual_testing/python/introduction/file_io.html 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.
#node.modifiers.append(...)

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

-Constanze

17
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?

-Constanze

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

http://ovito.org/manual_testing/python/modules/ovito_pipeline.html#ovito.pipeline.Modifier


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

-Constanze

19
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.

-Constanze

20
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"])

-Constanze

21
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".

-Constanze


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

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:
https://ovito.org/manual_testing/particles.modifiers.create_bonds.html
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.
-Constanze

23
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?

-Constanze

24
Hi,
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
http://www.ovito.org/manual_testing/python/modules/ovito_modifiers.html#ovito.modifiers.ClusterAnalysisModifier
Does that work for you?

-Constanze

25
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?

-Constanze


26
Hello,

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.

-Constanze

27
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]

-Constanze

28
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?

-Constanze

29
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(clusterselect_modifier)
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()
    print(pipeline.output.attributes['ConstructSurfaceMesh.solid_volume'])

-Constanze

30
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.

-Constanze

Pages: [1] 2 3 ... 10