{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.00433, "end_time": "2026-03-19T15:24:03.623723", "exception": false, "start_time": "2026-03-19T15:24:03.619393", "status": "completed" }, "tags": [] }, "source": [ "(Support Joint Results Example)=\n", "# Joint Result Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001375, "end_time": "2026-03-19T15:24:03.627358", "exception": false, "start_time": "2026-03-19T15:24:03.625983", "status": "completed" }, "tags": [] }, "source": [ "Download the [SupportResults.fez](https://github.com/Rocscience/rs2-scripting/blob/main/docs/example_code/example_models/SupportResults.fez) for this example." ] }, { "cell_type": "code", "execution_count": 1, "id": "efd68734", "metadata": { "execution": { "iopub.execute_input": "2026-03-19T15:24:03.630401Z", "iopub.status.busy": "2026-03-19T15:24:03.630140Z", "iopub.status.idle": "2026-03-19T15:24:09.261688Z", "shell.execute_reply": "2026-03-19T15:24:09.260444Z" }, "papermill": { "duration": 5.63466, "end_time": "2026-03-19T15:24:09.262900", "exception": false, "start_time": "2026-03-19T15:24:03.628240", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Stage 1 Joint Results\n", "\n", "\tJoint Unique ID = External boundary0\n", "\tJoint Element Results:\n", "\n", "\tStart X-Coord = 11.949843172111, Start Y-Coord = 16.8602900357032, End X-Coord = 7.66165679261041, End Y-Coord = 16.0080637205343\n", "\tDistance = 2.186025624140804, Normal Stress = 4.0118, Shear Stress = 0.06408, Confining Stress = None\n", "\tNormal Displacement = 3.98454459388709e-05, Shear Displacement = 9.518369020371651e-07, Yielded = False\n", "\n", "\tStart X-Coord = 7.66165679261041, Start Y-Coord = 16.0080637205343, End X-Coord = 3.37347041310981, End Y-Coord = 15.1558374053654\n", "\tDistance = 6.558076872422411, Normal Stress = 5.5995, Shear Stress = -0.064085, Confining Stress = None\n", "\tNormal Displacement = 3.567238008880944e-05, Shear Displacement = -9.650382373340867e-07, Yielded = False\n", "\n", "\tJoint Unique ID = Joint boundary0\n", "\tJoint Element Results:\n", "\n", "\tStart X-Coord = 2.917735202249, Start Y-Coord = 13.0941781181379, End X-Coord = 6.48770615356857, End Y-Coord = 13.767303954077\n", "\tDistance = 1.8164382032066397, Normal Stress = 301.5, Shear Stress = 18.694, Confining Stress = None\n", "\tNormal Displacement = 0.0003597035162463307, Shear Displacement = 0.00034176638278219496, Yielded = False\n", "\n", "\tStart X-Coord = 6.48770615356857, Start Y-Coord = 13.767303954077, End X-Coord = 9.38694273650449, End Y-Coord = 14.3139613569202\n", "\tDistance = 5.108038014502138, Normal Stress = 286.85, Shear Stress = 70.918, Confining Stress = None\n", "\tNormal Displacement = 0.00042772133456998217, Shear Displacement = 0.001089937591138087, Yielded = False\n", "\n", "\tStart X-Coord = 9.38694273650449, Start Y-Coord = 14.3139613569202, End X-Coord = 12.2861793194404, End Y-Coord = 14.8606187597633\n", "\tDistance = 8.05836123067984, Normal Stress = 248.94, Shear Stress = 68.214, Confining Stress = None\n", "\tNormal Displacement = 0.00029805069143089665, Shear Displacement = 0.000887685823484493, Yielded = False\n", "\n", "\tJoint Unique ID = Pile0\n", "\tJoint Element Results:\n", "\n", "\tStart X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479\n", "\tDistance = 1.8927167468140547, Normal Stress = -0.92443, Shear Stress = 0.28125, Confining Stress = 1021.4\n", "\tNormal Displacement = -4.6221e-05, Shear Displacement = 0.00010601666666666666, Yielded = False\n", "\n", "Stage 2 Joint Results\n", "\n", "\tJoint Unique ID = Joint boundary0\n", "\tJoint Element Results:\n", "\n", "\tStart X-Coord = 2.917735202249, Start Y-Coord = 13.0941781181379, End X-Coord = 6.48770615356857, End Y-Coord = 13.767303954077\n", "\tDistance = 1.8164382032066397, Normal Stress = 51.711, Shear Stress = 26.07, Confining Stress = None\n", "\tNormal Displacement = 1.737090431927168e-05, Shear Displacement = 0.00039828176446499885, Yielded = False\n", "\n", "\tStart X-Coord = 6.48770615356857, Start Y-Coord = 13.767303954077, End X-Coord = 9.38694273650449, End Y-Coord = 14.3139613569202\n", "\tDistance = 5.108038014502138, Normal Stress = None, Shear Stress = None, Confining Stress = None\n", "\tNormal Displacement = None, Shear Displacement = None, Yielded = False\n", "\n", "\tStart X-Coord = 9.38694273650449, Start Y-Coord = 14.3139613569202, End X-Coord = 12.2861793194404, End Y-Coord = 14.8606187597633\n", "\tDistance = 8.05836123067984, Normal Stress = None, Shear Stress = None, Confining Stress = None\n", "\tNormal Displacement = None, Shear Displacement = None, Yielded = False\n", "\n", "\tJoint Unique ID = Pile0\n", "\tJoint Element Results:\n", "\n", "\tStart X-Coord = 9.00086957359009, Start Y-Coord = 11.5846033227529, End X-Coord = 9.00086957359009, End Y-Coord = 7.79916982912479\n", "\tDistance = 1.8927167468140547, Normal Stress = -0.69699, Shear Stress = 0.12483, Confining Stress = 930.99\n", "\tNormal Displacement = -3.484973333333334e-05, Shear Displacement = 6.241666666666667e-05, Yielded = False\n", "\n" ] } ], "source": [ "from rs2.interpreter.RS2Interpreter import RS2Interpreter\n", "import os\n", "\n", "RS2Interpreter.startApplication(port=60087)\n", "current_dir = os.path.dirname(os.path.abspath(\"\")) \n", "interpreter = RS2Interpreter(port=60087)\n", "model = interpreter.openFile(rf\"{current_dir}\\example_models\\SupportResults.fez\")\n", "\n", "stages = [1, 2]\n", "\n", "results = model.GetJointResults(stages)\n", "\n", "for stageNum, allJointResults in results.items():\n", " print(f\"Stage {stageNum} Joint Results\\n\")\n", " for singleJointResult in allJointResults:\n", " jointID = singleJointResult.entity_id\n", " print(f\"\\tJoint Unique ID = {jointID}\")\n", " joint_element_results = singleJointResult.joint_element_results\n", " print(\"\\tJoint Element Results:\\n\")\n", " for jointResult in joint_element_results:\n", " start_x = jointResult.start_x\n", " start_y = jointResult.start_y\n", " end_x = jointResult.end_x\n", " end_y = jointResult.end_y\n", " distance = jointResult.distance\n", " normal_stress = jointResult.normal_stress\n", " shear_stress = jointResult.shear_stress\n", " confining_stress = jointResult.confining_stress\n", " normal_displacement = jointResult.normal_displacement\n", " shear_displacement = jointResult.shear_displacement\n", " yieldedStatus = jointResult.yielded\n", " print(f\"\\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}\")\n", " print(f\"\\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}\")\n", " print(f\"\\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\\n\")\n", "\n", "model.close()\n", "\n", "interpreter.closeProgram()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.0" }, "papermill": { "default_parameters": {}, "duration": 10.145744, "end_time": "2026-03-19T15:24:12.463048", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\results\\joint_result_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\results\\joint_result_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:24:02.317304", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }