Modifiers

AffineTransformationModifier

Scripting interface of the Affine transformation modifier:

PropertyData typeDefault valueDescription
transformationAffineTransformationIdentity matrixThe 3 x 4 affine transformation matrix. Used only if relativeMode==true. The fourth matrix column specifies the translation vector.
targetCellAffineTransformationZero matrixThe target simulation cell shape. Used only if relativeMode==false. This is a 3x4 matrix. The first three columns specify the cell vectors. The fourth column specifies the origin of the simulation box.
relativeModebooleantrueIf true, the matrix transformation is used to transform particles. If false, the affine transformation is computed by the modifier from the current simulation cell shape and the target shape matrix targetCell.
applyToSimulationBoxbooleanfalseControls whether the simulation cell shape is affected by the modifier.
applyToParticlesbooleantrueControls whether the particle positions are affected by the modifier.
applyToSurfaceMeshbooleanfalseControls whether a surface mesh is affected by the modifier.
selectionOnlybooleanfalseSet this to true to transform only selected particles.

Example:

// Set up a shear transformation matrix. Start by creating an identity transformation matrix:
m = new AffineTransformation()
// Set XZ shear component to 0.1. The XZ element is stored in row 0 and column 2 of the matrix.
m.setElement(0, 2, 0.1)

// Apply affine transformation modifier:
ovito.selectedNode.applyModifier(new AffineTransformationModifier({ 
	applyToSimulationBox : true,
	transformation : m
}))

WARNING: The following does NOT work, because setElement() acts on a copy of the transformation matrix:

mod = new AffineTransformationModifier()
mod.transformation.setElement(0, 2, 0.1)

AmbientOcclusionModifier

Scripting interface of the Ambient occlusion modifier:

PropertyData typeDefault valueDescription
intensitynumber0.7Controls the strength of the shading effect. Valid range: [0.0,1.0]
samplingCountinteger20Number of exposure samples to compute
bufferResolutioninteger3Render buffer resolution. Valid range: [1,4]

AssignColorModifier

Scripting interface of the Assign color modifier:

PropertyData typeDefault valueDescription
colorColorColor(0.3,0.3,1.0)The RGB color that will be assigned to selected particles.
keepSelectionbooleanfalseControls whether the modifier clears the current particle selection or not.

AtomicStrainModifier

Scripting interface of the Atomic strain modifier:

PropertyData typeDefault valueDescription
cutoffnumber3.0The range of neighbors.
eliminateCellDeformationbooleanfalseControls whether the simulation cell is adjusted prior to the strain calculation.
assumeUnwrappedCoordinatesbooleanfalseControls the use of the minimum image convention for particles that have crossed a periodic boundary.
calculateDeformationGradientsbooleanfalseEnables the output of all elements of the atomic deformation gradient tensors.
calculateStrainTensorsbooleanfalseEnables the output of all elements of the atomic strain tensors.
selectInvalidParticlesbooleantrueEnables the selection of particles for which the atomic strain tensor could not be computed.
invalidParticleCountintegerread-onlyNumber of particles for which the atomic strain tensor could not be computed.
referenceConfigurationLinkedFileObject The reference configuration of the particles.

Example:

modifier = new AtomicStrainModifier({ cutoff : 3.4 })
modifier.referenceConfiguration.load("simulation.0.dump")
ovito.selectedNode.applyModifier(modifier)

BondAngleAnalysisModifier

Scripting interface of the Bond-angle analysis modifier:

PropertyData typeDefault valueDescription
structureCountsArrayread-onlyArray with the number of identified particles per structure type. This array gets filled when the modifier performs the analysis. The following constants can be used to access the array (see example below): OTHER, FCC, HCP, BCC, ICO.

Example:

ovito.selectedNode.applyModifier(modifier = new BondAngleAnalysisModifier())
wait()
print("Number of FCC atoms: " + modifier.structureCounts[BondAngleAnalysisModifier.FCC])

CalculateDisplacementsModifier

Scripting interface of the Displacement vectors modifier:

PropertyData typeDefault valueDescription
eliminateCellDeformationbooleanfalseControls whether the simulation cell is adjusted prior to the displacement calculation.
assumeUnwrappedCoordinatesbooleanfalseDisables the use of the minimum image convention for particles that have crossed a periodic boundary.
referenceFrameNumberinteger0The frame to use as reference configuration if the reference file contains multiple timesteps.
useReferenceFrameOffsetbooleanfalseEnables a sliding reference frame.
referenceFrameOffsetinteger-1When using a sliding reference frame this sets the offset between the reference frame and the current frame.
vectorDisplayVectorDisplay The vector display object controlling the display of displacement arrows.
referenceConfigurationLinkedFileObject The reference configuration.

Example:

modifier = new CalculateDisplacementsModifier({ eliminateCellDeformation : true })
modifier.referenceConfiguration.load("simulation.0.dump")
modifier.vectorDisplay.isEnabled = true
ovito.selectedNode.applyModifier(modifier)

CentroSymmetryModifier

Scripting interface of the Centrosymmetry parameter modifier:

PropertyData typeDefault valueDescription
numNeighborsinteger12Number of particle neighbors taken into account for computing the centrosymmetry value.

ClusterAnalysisModifier

Scripting interface of the Cluster analysis modifier:

PropertyData typeDefault valueDescription
cutoffnumber3.2The maximum distance between particles belonging to the same cluster.
clusterCountintegerread-onlyAfter the cluster analysis has been performed, this property field contains the number of identified cluster.

ColorCodingModifier

Scripting interface of the Color coding modifier:

PropertyData typeDefault valueDescription
sourcePropertystring The particle property to be used for coloring.
startValuenumber Start of property value range. Is mapped to the first color.
endValuenumber End of property value range. Is mapped to the last color.
colorOnlySelectedbooleanfalseIf true, colors are only assigned to selected particle while the existing color of other particles is left unchanged.
keepSelectionbooleanfalseNormally, the modifier clears the current particle selection. This flag disables this behavior.
colorGradientColorCodingGradientColorCodingHSVGradientThe color gradient object that is responsible for mapping property values to colors. The following gradient types are available: ColorCodingHSVGradient, ColorCodingGrayscaleGradient, ColorCodingHotGradient, ColorCodingJetGradient.

Example:

ovito.selectedNode.applyModifier(new ColorCodingModifier({
	sourceProperty : "Displacement.X",
	colorGradient : new ColorCodingHotGradient()
}))

CommonNeighborAnalysisModifier

Scripting interface of the Common neighbor analysis modifier:

PropertyData typeDefault valueDescription
adaptiveModebooleantrueActivates the adaptive version of the CNA, which determines the cutoff radius for each particle individually.
cutoffnumber3.2The cutoff radius for the conventional CNA. This is ignored if adaptiveMode==true
structureCountsArrayread-onlyArray with the number of particles found for each structure type. This array gets filled when the modifier performs the analysis. The following constants can be used to access the array (see example below): OTHER, FCC, HCP, BCC, ICO, DIA.

Example:

ovito.selectedNode.applyModifier(modifier = new CommonNeighborAnalysisModifier({
	adaptiveMode : false,
	cutoff : 3.411
}))
wait()
print("Number of FCC atoms: " + modifier.structureCounts[CommonNeighborAnalysisModifier.FCC])

ConstructSurfaceModifier

Scripting interface of the Construct surface mesh modifier:

PropertyData typeDefault valueDescription
radiusnumber4.0Radius of the virtual probe sphere
smoothingLevelinteger8Number of smoothing iterations
onlySelectedParticlesbooleanfalseIf true, the surface is constructed only from selected particles.
surfaceAreanumberread-onlyAfter the modifier has constructed the surface, this output field contains the computed surface area.
solidVolumenumberread-onlyAfter the modifier has constructed the surface, this output field contains the computed solid volume.
totalVolumenumberread-onlyAfter the modifier has constructed the surface, this output field contains volume of the simulation cell.

CoordinationNumberModifier

Scripting interface of the Coordination analysis modifier:

PropertyData typeDefault valueDescription
cutoffnumber3.2The maximum distance up to which two particlea are considered neighbors.

CreateBondsModifier

Scripting interface of the Create bonds modifier:

PropertyData typeDefault valueDescription
uniformCutoffnumber3.2Controls which particle are connected by a bond.

CreateExpressionPropertyModifier

Scripting interface of the Compute property modifier:

PropertyData typeDefault valueDescription
outputPropertystring"Custom property"The name of the output particle property.
onlySelectedParticlesbooleanfalseRestricts the computation of property values to selected particles.
expressionsarray of strings["0"]The list of math expressions. The size of the array must match the number of vector components of the output property.

Example:

ovito.selectedNode.applyModifier(new CreateExpressionPropertyModifier({ 
	outputProperty : "Radius",
	expressions : [ "ParticleType==2 ? 1.6 : 1.2" ] 
}))

FreezePropertyModifier

Scripting interface of the Freeze property modifier:

PropertyData typeDefault valueDescription
sourcePropertystring The particle property to be frozen.
destinationPropertystring The name of the output particle property.

SelectExpressionModifier

Scripting interface of the Expression select modifier:

PropertyData typeDefault valueDescription
expressionstring The Boolean expression

ShowPeriodicImagesModifier

Scripting interface of the Show periodic images modifier:

PropertyData typeDefault valueDescription
showImageXbooleanfalseEnables the generation of copies in the X direction.
showImageYbooleanfalseEnables the generation of copies in the Y direction.
showImageZbooleanfalseEnables the generation of copies in the Z direction.
numImagesXinteger3The number of periodic images to generate in the X direction (including the primary image).
numImagesYinteger3The number of periodic images to generate in the Y direction (including the primary image).
numImagesZinteger3The number of periodic images to generate in the Z direction (including the primary image).
adjustBoxSizebooleanfalseThis flag controls the resizing of the simulation cell.

SliceModifier

Scripting interface of the Slice modifier:

PropertyData typeDefault valueDescription
normalVectorVector(1,0,0)The normal vector of the slicing plane.
distancenumber0The (signed) distance of the slicing plane from the origin along the plane's normal.
sliceWidthnumber0The width of the slice to take.
inversebooleanfalseThis flag flips the orientation of the slicing plane.
createSelectionbooleanfalseIf true, the modifier selects particles instead of deleting them.
applyToSelectionbooleanfalseIf true, the modifier removes/selects only particles that are currently selected.

WignerSeitzAnalysisModifier

Scripting interface of the Wigner-Seitz defect analysis modifier:

PropertyData typeDefault valueDescription
eliminateCellDeformationbooleanfalseControls whether the simulation cell is adjusted to match the reference cell prior to the analysis.
referenceFrameNumberinteger0The frame to use as reference configuration if the reference file contains multiple timesteps.
useReferenceFrameOffsetbooleanfalseEnables a sliding reference frame.
referenceFrameOffsetinteger-1When using a sliding reference frame this sets the offset between the reference frame and the current frame.
referenceConfigurationLinkedFileObject The reference configuration.
vacancyCountintegerread-onlyThis output field contains the number of vacancies identified during the Wigner-Seitz analysis.
interstitialCountintegerread-onlyThis output field contains the number of interstitials identified during the Wigner-Seitz analysis.

Example:

modifier = new WignerSeitzAnalysisModifier({ eliminateCellDeformation : true })
modifier.referenceConfiguration.load("simulation.0.dump")
ovito.selectedNode.applyModifier(modifier)
wait()
print("Found " + modifier.vacancyCount + " vacancies")