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

Pages: [1]
Support Forum / Re: Output the shear strain increment
« on: August 05, 2019, 09:34:33 AM »
Hi, Alex,
     As you suggest, I revise the last command as:
Code: [Select]
export_file(node, "delta_yita.txt", "txt/attr", columns=["strain", "yita_per_frame"],
  start_frame = 1, end_frame = 15, multiple_frames = True)code]
But the error still exist.

Support Forum / Output the shear strain increment
« on: August 04, 2019, 01:38:37 PM »
Hi, everyone.
   I try to output the shear strain increment for the whole sample by codes
Code: [Select]
node = import_file("../MGfilm-R100401/simple.MG*.tensile")

modifier = AtomicStrainModifier(cutoff = 10.0,
affine_mapping = CalculateDisplacementsModifier.AffineMapping.ToReference,
output_rotations = True,
use_frame_offset = True)

modifier = SelectExpressionModifier(expression = ' ParticleType!=0  ') #select all

def compute_delta_yita(frame, data):
per_yita = data.particles["Shear Strain"]
selection = data.particles["Selection"]
output.attributes["yita_per_frame"] = np.mean(per_yita[selection == 1])

export_file(node, "delta_yita.txt", "txt/attr",
    columns=["strain", "yita_per_frame"],

But it end up with an error: RuntimeError: Data pipeline evaluation failed: Modifier 'Atomic strain' reported: Requested reference frame -1 is out of
 range. Cannot perform calculation at the current animation time.
How can i avoid this?
I'm using Ovito3.00


Support Forum / Re: Averaging the strain tensor
« on: July 03, 2019, 04:31:35 PM »
Hi, Alex

Now i also try to output the average position of the selected block

Code: [Select]
def averaging_strain_tensors(frame, input, output):
Position = input.particle_properties['Position'].array
Position_X = Position[:,0]
        mean_PositionX = mean()

But i got artificial results for those blocks acrossing the periodic boundary. Clearly, i need to access the "unwarpped" coordinates or the image flags, do Ovito store these values?

Support Forum / Re: Averaging the strain tensor
« on: June 24, 2019, 02:22:35 PM »
Thank you ,Alex. I can access the StrainTensor components now. But  i found that the total numbers in my seleted box is not conserve for each frame. Here is my code:

Code: [Select]
for frame in range(node.source.num_frames):
print('Calculating ',frame, 'frames')

# select a certain block
Select=SelectExpressionModifier(expression = 'Position.X>10 && Position.X<30\
&& Position.Y>10 && Position.Y<30')

# freeze the position of selected block in Frame0
modifier = FreezePropertyModifier(source_property = 'Selection',
  destination_property = 'Selection')
dataset.anim.current_frame = 0

def averaging_strain_tensors(frame, input, output):


the results are:
Calculating  0 frames
1358 -4.05699e-08
Calculating  1 frames
1342 0.000547836
Calculating  2 frames
1338 -0.00055211

then i check produce in graphic mode, it seems the tracking of selected atom had no problem, but the "'SelectExpression.num_selected" are still the value for (expression = 'Position.X>10 && Position.X<30 && Position.Y>10 && Position.Y<30') in each frame.

My question is, which group of atoms had been averaged for tensors in each frame? is the (expression = 'Position.X>10 && Position.X<30 && Position.Y>10 && Position.Y<30') in frame0 being tracked, or the (expression = 'Position.X>10 && Position.X<30 && Position.Y>10 && Position.Y<30') in each frame? If the latter,how should i revise?

Support Forum / Averaging the strain tensor
« on: June 22, 2019, 10:45:29 AM »
Hi, Ovito users,
    I'm trying to average the strain tersor of each atom in a certain selected region. Since i want tracing this region through every frames, BinAndReduce is not what i want. So, i used FreezePropertyModifier to keep traking the selected atoms. But when i try to average the strain tensor, i'm getting a error: "The DataCollection does not contain a particle property with the name 'Strain Tensor.XX'

Code: [Select]
modifier = AtomicStrainModifier(cutoff = 10.0,
output_strain_tensors = True)
modifier.reference.load("reference file")

#select all atoms for test
mod = SelectExpressionModifier(expression = ' ParticleType!=0  ')
modifier = FreezePropertyModifier(source_property = 'Selection',
  destination_property = 'Selection')
dataset.anim.current_frame = 0

def averaging_strain_tensors(frame, input, output):
StrainTensor_XX = input.particle_properties['Strain Tensor.XX'].array
StrainTensor_YY = input.particle_properties['Strain Tensor.YY'].array
StrainTensor_ZZ = input.particle_properties['Strain Tensor.ZZ'].array
StrainTensor_XY = input.particle_properties['Strain Tensor.XY'].array
StrainTensor_XZ = input.particle_properties['Strain Tensor.XZ'].array
StrainTensor_YZ = input.particle_properties['Strain Tensor.YZ'].array
selection = input.particle_properties['Selection'].array
output.attributes["strain"] = frame /5.0
output.attributes['XX_mean'] = numpy.mean(StrainTensor_XX[selection != 0])
output.attributes['YY_mean'] = numpy.mean(StrainTensor_YY[selection != 0])
output.attributes['ZZ_mean'] = numpy.mean(StrainTensor_ZZ[selection != 0])
output.attributes['XY_mean'] = numpy.mean(StrainTensor_XY[selection != 0])
output.attributes['XZ_mean'] = numpy.mean(StrainTensor_XZ[selection != 0])
output.attributes['YZ_mean'] = numpy.mean(StrainTensor_YZ[selection != 0])

Isn't 'Strain Tensor.XX' a particle_properties? But i can find  'Strain Tensor.XX'  in the properties list in the SelectExpressionModifier under graphic mode.

Thank you, Constanze.

Now I understand that Rotation.i = ui*sin(theta/2), where theta is the rotation angle and ui the ith component of unit rotation axis, and Rotation.W = cos(theta/2).

Support Forum / About the quaternion R in atomic strain modifiers.
« on: June 04, 2019, 10:16:12 AM »
Hi, Alex and OVITO users,
     I don't understand how the quaternion R(X, Y, Z, W)  in atomic strain modifiers is obtained from the rotation matrix, specifically, what are the physical meanings of the value of Rotation.X-W respectively? can you guys give me some imformation?


Support Forum / Re: The DXA misjudges the burgers vector
« on: April 17, 2019, 11:49:42 AM »
Thanks, Alex, this works. However, i can not change the extracted dislocations back in to the original orientation by appliying a reverse rotation after DXA analysis.

Support Forum / Re: The DXA misjudges the burgers vector
« on: April 17, 2019, 10:58:49 AM »
Yes, i want to obtain a series of snapshot, in which the dislocations with different Burgers vectors are painted with different colors, while the color for a specify type is uniform in every snapshots. For example, the 1/2[111] is always painted in green.

Now i know that i can judge the Burgers vectors by transforming "spatial Burgers vectors" back into lattice coordinate. So, a simple way to achieve my purpose is to assign the colors for the dislocations with different Burgers vectors manually. Is this possible to realize by a Python script? i need more information about this.


Support Forum / Re: The DXA misjudges the burgers vector
« on: April 17, 2019, 09:20:16 AM »

Thank you for explaining this spurious behavior of DXA. However, what i want to do is, exactly, indentfying different <111> type dislocations. How should i do to achieve it in this case?

Support Forum / The DXA misjudges the burgers vector
« on: April 17, 2019, 05:18:59 AM »
Dear Alex and OVITO users,

i found the DXA sometimes misjudges the burgers vectors of dislocation segments. There is an edge dislocation line with a double super-jog in the first attached figure. This segment is painted in light green since its burgers vector is judged as 1/2[111] by DXA, right along the X-direction.

In the next scene,  this dislocation just glided forwards a little bit and without any dislocation interaction, however, the DXA judged it as a 1/2[11-1] line and painted it in brown (see the second attached figure)

The OVITO version i used is 3.0.0-dev372, but i also encountered this error with 2.9.0. By checking the information in "dislocation" table, i believe this misjudgement is due to some numerical errors: the spatial burgers vector is [2.4739,0.00,0.00] in the first figure and [2.4739,0.00,-0.00] in the next.

How can i fix this to judge the burgers vector correctly by DXA?

best regards,

Support Forum / About the FreezePropertyModifier
« on: April 11, 2019, 10:04:38 AM »
    I'm trying to do analysis on a layer of atoms, which is selectd from the 12th frame of a animation sequence
   i wrote a python script like:
node = import_file("R100401.*collisions.dat")

#select atomic layer
mod5 = SelectExpressionModifier(expression = 'Position.Y>265 || Position.Y<195 ')

modifier = FreezePropertyModifier(source_property = 'Selection',
                                  destination_property = 'Selection')

it went well but when i change the last line to "modifier.take_snapshot(12)", an error massage appears:
AttributeError: 'PyScriptAnimation.AnimationSettings' object has no attribute 'frameToTime'

what the correct syntax is?  :-[

Support Forum / Reading data file without x y z in ITEM line.
« on: November 22, 2017, 12:36:03 PM »
Hi Alex,
    I averaged the atom positions by 'fix ave/atom' command in LAMMPS to eliminate the dynamic fluctuation, and got output files with ITEM line like:
ITEM: ATOMS id type f_ave[1] f_ave[2] f_ave[3] c_eng

where f_ave[1 2 3] are the averaged atoms position in three dimensions. But Ovito can't read this because it seems only 'x y z' can be mapped to the atoms position.  Of course i can use a script to rewrite this line for all files, but that's not so convenient. It's there any more simple way to make Ovito read this kind of files?

Best regards,

Pages: [1]