Composite Result Script Examples#
Download the SupportResult.fez for this example.
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
def OutputJointResult(singleJointResult):
jointID = singleJointResult.entity_id
print(f"\t\tJoint Unique ID = {jointID}")
joint_element_results = singleJointResult.joint_element_results
print("\t\tJoint Element Results:\n")
for jointResult in joint_element_results:
start_x = jointResult.start_x
start_y = jointResult.start_y
end_x = jointResult.end_x
end_y = jointResult.end_y
distance = jointResult.distance
normal_stress = jointResult.normal_stress
shear_stress = jointResult.shear_stress
confining_stress = jointResult.confining_stress
normal_displacement = jointResult.normal_displacement
shear_displacement = jointResult.shear_displacement
yieldedStatus = jointResult.yielded
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}")
print(f"\t\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\n")
def OutputLinerResult(singleLinerResult):
linerID = singleLinerResult.entity_id
print(f"\t\tLiner Unique ID = {linerID}")
liner_element_results = singleLinerResult.liner_element_results
print("\t\tLiner Element Results:\n")
for linerResult in liner_element_results:
composite_layer = linerResult.composite_layer
node_start = linerResult.node_start
node_end = linerResult.node_end
start_x = linerResult.start_x
start_y = linerResult.start_y
end_x = linerResult.end_x
end_y = linerResult.end_y
distance = linerResult.distance
axial_force1 = linerResult.axial_force1
axial_force_mid = linerResult.axial_force_mid
axial_force2 = linerResult.axial_force2
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
shear_force1 = linerResult.shear_force1
shear_force_mid = linerResult.shear_force_mid
shear_force2 = linerResult.shear_force2
displacement_total1 = linerResult.displacement_total1
displacement_total_mid = linerResult.displacement_total_mid
displacement_total2 = linerResult.displacement_total2
displacement_x1 = linerResult.displacement_x1
displacement_x_mid = linerResult.displacement_x_mid
displacement_x2 = linerResult.displacement_x2
displacement_y1 = linerResult.displacement_y1
displacement_y_mid = linerResult.displacement_y_mid
displacement_y2 = linerResult.displacement_y2
axi_sym_force1 = linerResult.axi_sym_force1
axi_sym_force_mid = linerResult.axi_sym_force_mid
axi_sym_force2 = linerResult.axi_sym_force2
axi_sym_moment1 = linerResult.axi_sym_moment1
axi_sym_moment_mid = linerResult.axi_sym_moment_mid
axi_sym_moment2 = linerResult.axi_sym_moment2
beam_yield = linerResult.beam_yield
temperature1 = linerResult.temperature1
temperature_mid = linerResult.temperature_mid
temperature2 = linerResult.temperature2
print(f"\t\tComposite Layer = {composite_layer}, Node Start = {node_start}, Node End = {node_end}")
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\tDistance = {distance}, Axial Force 1 = {axial_force1}, Axial Force-Mid = {axial_force_mid}")
print(f"\tAxial Force 2 = {axial_force2}, Moment 1 = {moment1}, Moment-Mid = {moment_mid}")
print(f"\tMoment 2 = {moment2}, Shear Force = {shear_force1}, Shear Force-Mid = {shear_force_mid}")
print(f"\tShear Force 2 = {shear_force2}, Displacement Total 1 = {displacement_total1}, Displacement Total - Mid = {displacement_total_mid}")
print(f"\tDisplacement Total 2 = {displacement_total2}, Displacement X 1 = {displacement_x1}, Displacement X-Mid = {displacement_x_mid}")
print(f"\tDisplacement X2 = {displacement_x2}, Displacement Y1 = {displacement_y1}, Displacement Y-Mid = {displacement_y_mid}")
print(f"\tDisplacement Y2 = {displacement_y2}, Axial Symmetry Force 1 = {axi_sym_force1}, Axial Symmetry Force-Mid = {axi_sym_force_mid}")
print(f"\tAxial Symmetry Force2 = {axi_sym_force2}, Axial Symmetry Moment 1 = {axi_sym_moment1}, Axial Symmetry Moment-Mid = {axi_sym_moment_mid}")
print(f"\tAxial Symmetry Moment2 = {axi_sym_moment2}, Beam Yield = {beam_yield}, Temperature 1 = {temperature1}")
print(f"\tTemperature-Mid = {temperature_mid}, Temperature 2 = {temperature2}\n")
RS2Interpreter.startApplication(port=60086)
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter(port=60086)
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
# Composite is removed in stage 2
stages = [1]
results = model.GetCompositeResults(stages)
for stageNum, allCompositeResults in results.items():
print(f"Stage {stageNum} Composite Results\n")
for singleCompositeResult in allCompositeResults:
compositeID = singleCompositeResult.entity_id
print(f"\tComposite Unique ID = {compositeID}")
joint_result = singleCompositeResult.joint_result
print(f"\tJoint Result for Composite with ID {compositeID}:\n")
OutputJointResult(joint_result)
liner_result = singleCompositeResult.liner_result
print(f"\tLiner Result for Composite with ID {compositeID}:\n")
OutputLinerResult(liner_result)
model.close()
interpreter.closeProgram()
Output#
Stage 1 Composite Results
Composite Unique ID = External boundary0
Joint Result for Composite with ID External boundary0:
Joint Unique ID = External boundary0
Joint Element Results:
Start X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343
Distance = 2.186025624140804, Normal Stress = 4.0118, Shear Stress = 0.06408, Confining Stress = None
Normal Displacement = 3.98454459388709e-05, Shear Displacement = 9.518369020371651e-07, Yielded = False
Start X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654
Distance = 6.558076872422411, Normal Stress = 5.5995, Shear Stress = -0.064085, Confining Stress = None
Normal Displacement = 3.567238008880944e-05, Shear Displacement = -9.650382373340867e-07, Yielded = False
Liner Result for Composite with ID External boundary0:
Liner Unique ID = External boundary0
Liner Element Results:
Composite Layer = 1, Node Start = 55, Node End = 56
Start X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343
Distance = 2.186025624140804, Axial Force 1 = -21.786, Axial Force-Mid = -69.567
Axial Force 2 = -117.35, Moment 1 = -44.105, Moment-Mid = -125.36
Moment 2 = -206.62, Shear Force = -97.7, Shear Force-Mid = -37.172
Shear Force 2 = 23.356, Displacement Total 1 = 0.003946398950942492, Displacement Total - Mid = 0.004270172877062473
Displacement Total 2 = 0.00421677623309561, Displacement X 1 = -0.0024462, Displacement X-Mid = -0.0023542
Displacement X2 = -0.0023702, Displacement Y1 = -0.0030968, Displacement Y-Mid = -0.0035626
Displacement Y2 = -0.0034876, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 1, Node Start = 56, Node End = 57
Start X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654
Distance = 6.558076872422411, Axial Force 1 = -129.95, Axial Force-Mid = -82.383
Axial Force 2 = -34.811, Moment 1 = -195.16, Moment-Mid = -113.91
Moment 2 = -32.647, Shear Force = -7.6313, Shear Force-Mid = 37.172
Shear Force 2 = 81.975, Displacement Total 1 = 0.00421677623309561, Displacement Total - Mid = 0.0037635805186019334
Displacement Total 2 = 0.0031993783021080826, Displacement X 1 = -0.0023702, Displacement X-Mid = -0.0025066
Displacement X2 = -0.0027354, Displacement Y1 = -0.0034876, Displacement Y-Mid = -0.0028074
Displacement Y2 = -0.0016594, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 2, Node Start = 55, Node End = 56
Start X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343
Distance = 2.186025624140804, Axial Force 1 = -21.786, Axial Force-Mid = -69.567
Axial Force 2 = -117.35, Moment 1 = -44.105, Moment-Mid = -125.36
Moment 2 = -206.62, Shear Force = -97.7, Shear Force-Mid = -37.172
Shear Force 2 = 23.356, Displacement Total 1 = 0.003946398950942492, Displacement Total - Mid = 0.004270172877062473
Displacement Total 2 = 0.00421677623309561, Displacement X 1 = -0.0024462, Displacement X-Mid = -0.0023542
Displacement X2 = -0.0023702, Displacement Y1 = -0.0030968, Displacement Y-Mid = -0.0035626
Displacement Y2 = -0.0034876, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 2, Node Start = 56, Node End = 57
Start X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654
Distance = 6.558076872422411, Axial Force 1 = -129.95, Axial Force-Mid = -82.383
Axial Force 2 = -34.811, Moment 1 = -195.16, Moment-Mid = -113.91
Moment 2 = -32.647, Shear Force = -7.6313, Shear Force-Mid = 37.172
Shear Force 2 = 81.975, Displacement Total 1 = 0.00421677623309561, Displacement Total - Mid = 0.0037635805186019334
Displacement Total 2 = 0.0031993783021080826, Displacement X 1 = -0.0023702, Displacement X-Mid = -0.0025066
Displacement X2 = -0.0027354, Displacement Y1 = -0.0034876, Displacement Y-Mid = -0.0028074
Displacement Y2 = -0.0016594, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 3, Node Start = 55, Node End = 56
Start X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343
Distance = 2.186025624140804, Axial Force 1 = -0.01552, Axial Force-Mid = -0.089266
Axial Force 2 = -0.16301, Moment 1 = -9.5518, Moment-Mid = -82.658
Moment 2 = -155.76, Shear Force = -46.551, Shear Force-Mid = -33.442
Shear Force 2 = -20.334, Displacement Total 1 = 0.004102127103101511, Displacement Total - Mid = 0.004239848027936851
Displacement Total 2 = 0.004168850800880262, Displacement X 1 = -0.0024026, Displacement X-Mid = -0.0023639
Displacement X2 = -0.0023836, Displacement Y1 = -0.0033249, Displacement Y-Mid = -0.0035197
Displacement Y2 = -0.0034202, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 3, Node Start = 56, Node End = 57
Start X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654
Distance = 6.558076872422411, Axial Force 1 = -0.16632, Axial Force-Mid = -0.092584
Axial Force 2 = -0.018849, Moment 1 = -151.97, Moment-Mid = -78.864
Moment 2 = -5.7581, Shear Force = 25.54, Shear Force-Mid = 33.442
Shear Force 2 = 41.345, Displacement Total 1 = 0.004168850800880262, Displacement Total - Mid = 0.0037437916942586434
Displacement Total 2 = 0.0032744505157354265, Displacement X 1 = -0.0023836, Displacement X-Mid = -0.0025116
Displacement X2 = -0.0026933, Displacement Y1 = -0.0034202, Displacement Y-Mid = -0.0027763
Displacement Y2 = -0.0018623, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 4, Node Start = 55, Node End = 56
Start X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343
Distance = 2.186025624140804, Axial Force 1 = -0.01552, Axial Force-Mid = -0.089266
Axial Force 2 = -0.16301, Moment 1 = -9.5518, Moment-Mid = -82.658
Moment 2 = -155.76, Shear Force = -46.551, Shear Force-Mid = -33.442
Shear Force 2 = -20.334, Displacement Total 1 = 0.004102127103101511, Displacement Total - Mid = 0.004239848027936851
Displacement Total 2 = 0.004168850800880262, Displacement X 1 = -0.0024026, Displacement X-Mid = -0.0023639
Displacement X2 = -0.0023836, Displacement Y1 = -0.0033249, Displacement Y-Mid = -0.0035197
Displacement Y2 = -0.0034202, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Composite Layer = 4, Node Start = 56, Node End = 57
Start X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654
Distance = 6.558076872422411, Axial Force 1 = -0.16632, Axial Force-Mid = -0.092584
Axial Force 2 = -0.018849, Moment 1 = -151.97, Moment-Mid = -78.864
Moment 2 = -5.7581, Shear Force = 25.54, Shear Force-Mid = 33.442
Shear Force 2 = 41.345, Displacement Total 1 = 0.004168850800880262, Displacement Total - Mid = 0.0037437916942586434
Displacement Total 2 = 0.0032744505157354265, Displacement X 1 = -0.0023836, Displacement X-Mid = -0.0025116
Displacement X2 = -0.0026933, Displacement Y1 = -0.0034202, Displacement Y-Mid = -0.0027763
Displacement Y2 = -0.0018623, Axial Symmetry Force 1 = None, Axial Symmetry Force-Mid = None
Axial Symmetry Force2 = None, Axial Symmetry Moment 1 = None, Axial Symmetry Moment-Mid = None
Axial Symmetry Moment2 = None, Beam Yield = False, Temperature 1 = -18.0
Temperature-Mid = -18.0, Temperature 2 = -18.0
Note
Since the element type for the model is 3-noded triangular, liner results are outputted at two nodes per liner element: start node and end node. If the model uses quadratic element type, liner result are outputted at three nodes per element. See the Liner Results Overview topic for more information.