Pile Result Script Examples#

Download the SupportResult.fez for this example.

Code Snippet: Get Support Pile Results#
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
        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"\t\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=60089)
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None))) 
interpreter = RS2Interpreter(port=60089)
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")

stages = [1, 2]

results = model.GetPileResults(stages)

for stageNum, allPileResults in results.items():
    print(f"Stage {stageNum} Pile Results\n")
    for singlePileResult in allPileResults:
        pileID = singlePileResult.entity_id
        print(f"\tPile Unique ID = {pileID}")

        joint_result = singlePileResult.joint_result
        print(f"\tJoint Result for Pile with ID {pileID}:\n")
        OutputJointResult(joint_result)

        liner_result = singlePileResult.liner_result
        print(f"\tLiner Result for Pile with ID {pileID}:\n")
        OutputLinerResult(liner_result)

model.close()

interpreter.closeProgram()

Output#

Stage 1 Pile Results

	Pile Unique ID = Pile0
	Joint Result for Pile with ID Pile0:

		Joint Unique ID = Pile0
		Joint Element Results:

		Start X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479
		Distance = 1.8927167468140547, Normal Stress = -0.92443, Shear Stress = 0.28125, Confining Stress = 1021.4
		Normal Displacement = -4.6221e-05, Shear Displacement = 0.00010601666666666666, Yielded = False

	Liner Result for Pile with ID Pile0:

		Liner Unique ID = Pile0
		Liner Element Results:

		Composite Layer = 2147483647, Node Start = 18, Node End = 6
		Start X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479
		Distance = 1.8927167468140547, Axial Force 1 = 4.7223, Axial Force-Mid = 4.1487
	Axial Force 2 = 3.5751, Moment 1 = 2.2078, Moment-Mid = 2.2078
	Moment 2 = 2.2078, Shear Force = -3.4994, Shear Force-Mid = -6.8834e-15
	Shear Force 2 = 3.4994, Displacement Total 1 = 0.0005066427731646825, Displacement Total - Mid = 0.0004672696088983318
	Displacement Total 2 = 0.00043808455422326867, Displacement X 1 = 0.00027064, Displacement X-Mid = 0.00018693
	Displacement X2 = 9.2443e-05, Displacement Y1 = -0.0004283, Displacement Y-Mid = -0.00042825
	Displacement Y2 = -0.00042822, 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 = 0.0
	Temperature-Mid = 0.0, Temperature 2 = 0.0

Stage 2 Pile Results

	Pile Unique ID = Pile0
	Joint Result for Pile with ID Pile0:

		Joint Unique ID = Pile0
		Joint Element Results:

		Start X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479
		Distance = 1.8927167468140547, Normal Stress = -0.69699, Shear Stress = 0.12483, Confining Stress = 930.99
		Normal Displacement = -3.484973333333334e-05, Shear Displacement = 6.241666666666667e-05, Yielded = False

	Liner Result for Pile with ID Pile0:

		Liner Unique ID = Pile0
		Liner Element Results:

		Composite Layer = 2147483647, Node Start = 18, Node End = 6
		Start X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479
		Distance = 1.8927167468140547, Axial Force 1 = -2.4216, Axial Force-Mid = -2.8941
	Axial Force 2 = -3.3667, Moment 1 = 1.6646, Moment-Mid = 1.6646
	Moment 2 = 1.6646, Shear Force = -2.6384, Shear Force-Mid = -4.996e-15
	Shear Force 2 = 2.6384, Displacement Total 1 = 0.0005836992266932003, Displacement Total - Mid = 0.0005845855236866545
	Displacement Total 2 = 0.000587707600938596, Displacement X 1 = -9.6168e-06, Displacement X-Mid = 3.4102e-05
	Displacement X2 = 6.9699e-05, Displacement Y1 = 0.00058362, Displacement Y-Mid = 0.00058359
	Displacement Y2 = 0.00058356, 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 = 0.0
	Temperature-Mid = 0.0, Temperature 2 = 0.0