There are several ways to check the analysis results output as distribution.
This script creates a probe, vector plot, and contour plot.
The probe displays result quantities at a given position as a time series graph.
The vector plot allows you to visually check the flow of result quantities as vector values, while the contour plot allows you to visually check distribution quantities as an isoline plot.
Preconditions
- One or more study have been created that outputs distribution results.
This script runs for the active thermal stress analysis study in the project tree.
Script Function
- Create a probe by specifying two locations.
This script creates a probe for the X component of the contact force.
Since a probe definition requires at least one location, the first location is set by RenamePoint and the second is added by AddLocation. - Create a vector plot for all parts.
Set the result type to pressure.
Set the arrow type to simple cone, the target to the surface, the length to scaled, and the display location to the element face centers. - Create a contour plot for all parts.
Set the result type to the Y component of plastic strain.
Set the display type to shaded that paints out smoothly.
# Copyright (c) 2026 JSOL CORPORATION
#
# This script is released under the MIT License.
# See the full license text at:
# https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/
def createProbeByCoordinate(study, resultType, component):
"""Create a probe of the result type specified by the argument"""
probeDefinition = study.CreateProbe(resultType)
probeDefinition.SetResultType(resultType)
# The 1st argumet of SetResultCoordinate
# Name or index
# The name of the preset coordinate system is fixed according to the language setting.
# The index is specified in a 0-based from the coordinate system definition list order under Project - Model - Coordinate Systems
probeDefinition.SetResultCoordinate(0)
# probeDefinition.SetResultCoordinate(u"Global Rectangular")
probeDefinition.SetComponent(component)
probeDefinition.SetProbeType(u"Coordinate")
probeDefinition.SetLocationCoordinate(0)
# probeDefinition.SetLocationCoordinate(u"Global Rectangular")
probeDefinition.RenamePoint(0, u"PointA")
probeDefinition.SetLocation(0, u"30", u"200", u"0")
probeDefinition.AddLocation(u"50", u"150", u"0", u"PointB")
probeDefinition.SetMoveWithPart(True)
def createVectorWithAllParts(study, resultType):
"""Create a vector plot of the specified result type for all components"""
vectorDefinition = study.CreateVector(resultType)
vectorDefinition.SetResultType(resultType)
vectorDefinition.SetStyle(u"SimpleCone")
vectorDefinition.SetScaled(True)
vectorDefinition.SetPlace(u"FaceCenter")
vectorDefinition.SetVectorType(0)
vectorDefinition.SetNumSkips(u"2")
vectorDefinition.SetDisplayAllParts(True)
def createContourWithAllParts(study, resultType, component):
"""Create a contour plot of the specified result type for all parts"""
contourDefinition = study.CreateContour(resultType)
contourDefinition.SetResultType(resultType)
contourDefinition.SetResultCoordinate(0)
# contourDefinition.SetResultCoordinate(u"Global Rectangular")
contourDefinition.SetComponent(component)
contourDefinition.SetContourType(u"Shading")
contourDefinition.SetDisplayAllParts(True)
app = designer.GetApplication()
study = app.GetCurrentStudy()
resultType = u"ContactForce"
component = u"X"
createProbeByCoordinate(study, resultType, component)
resultType = u"FacePressure"
createVectorWithAllParts(study, resultType)
resultType = u"PlasticStrain"
component = u"Y"
createContourWithAllParts(study, resultType, component)


