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.

Topics - Constanze Kalcher

Pages: [1]
Support Forum / User survey
« on: October 02, 2018, 10:36:06 AM »
Dear OVITO Users,

we are currently conducting a user survey and would love to hear your thoughts or feedback on how we can improve your experience with the OVITO software. The information you provide will help us understand better who uses OVITO and which future developments can further increase the usefulness of the software. Please take a minute to fill out the following online form.

Thank you!

Let's say you want to calculate the average value of a particle property for only a subset of atoms, for example the shear strain.
First you may want to use one of the Selection modifiers, e.g., Expression select, Select particle type, Slice or Manual selection to select the atoms of interest.

Then, insert a Python script modifier that calculates the mean value of the per-atom shear strain of your selection and saves it as a global attribute.
Code: [Select]
from import *
import numpy as np

def modify(frame, input, output):
    shear_strain = input.particle_properties["Shear Strain"].array
    selection = input.particle_properties["Selection"].array
    output.attributes["Average shear strain"] = np.mean( shear_strain[selection == 1] )

Global attributes can be exported as Calculation Results Text File output file format.

Pages: [1]