{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.002061, "end_time": "2026-03-19T15:09:42.575715", "exception": false, "start_time": "2026-03-19T15:09:42.573654", "status": "completed" }, "tags": [] }, "source": [ "(Material Example)=\n", "# Material Properties Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001114, "end_time": "2026-03-19T15:09:42.578783", "exception": false, "start_time": "2026-03-19T15:09:42.577669", "status": "completed" }, "tags": [] }, "source": [ "Download the [ExampleModel.fez](https://github.com/Rocscience/rs2-scripting/blob/main/docs/example_code/example_models/ExampleModel.fez) for this example." ] }, { "cell_type": "code", "execution_count": 1, "id": "efd68734", "metadata": { "execution": { "iopub.execute_input": "2026-03-19T15:09:42.582661Z", "iopub.status.busy": "2026-03-19T15:09:42.582403Z", "iopub.status.idle": "2026-03-19T15:09:54.046807Z", "shell.execute_reply": "2026-03-19T15:09:54.045500Z" }, "papermill": { "duration": 11.468513, "end_time": "2026-03-19T15:09:54.048415", "exception": false, "start_time": "2026-03-19T15:09:42.579902", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from rs2.modeler.RS2Modeler import RS2Modeler\n", "from rs2.modeler.properties.PropertyEnums import *\n", "import os\n", "\n", "current_dir = os.path.dirname(os.path.abspath(\"\")) \n", "RS2Modeler.startApplication(port=60072)\n", "modeler = RS2Modeler(port=60072)\n", "model = modeler.openFile(rf\"{current_dir}\\example_models\\ExampleModel.fez\")\n", "\n", "material = model.getAllMaterialProperties()[0]\n", "\n", "material.InitialConditions.setInitialElementLoading(InitialElementLoadingType.BODY_FORCE_ONLY)\n", "\n", "material.Stiffness.setElasticType(MaterialElasticityTypes.TRANSVERSELY_ISOTROPIC)\n", "material.Stiffness.TransverselyIsotropic.setUseUnloadingCondition(True)\n", "\n", "material.Strength.setFailureCriterion(StrengthCriteriaTypes.HOEK_BROWN)\n", "material.Strength.HoekBrown.setCompressiveStrength(101)\n", "\n", "material.Hydraulic.StaticGroundwater.setStaticWaterMode(StaticWaterModes.PORE_WATER_PRESSURE)\n", "material.Hydraulic.setMaterialBehaviour(MaterialBehaviours.UNDRAINED)\n", "\n", "model.close()\n", "\n", "modeler.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": 16.238594, "end_time": "2026-03-19T15:09:57.536562", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\material\\material_properties_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\material\\material_properties_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:09:41.297968", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }