{ "cells": [ { "cell_type": "markdown", "id": "873ec263", "metadata": {}, "source": [ "# How to preview a light expert result" ] }, { "cell_type": "markdown", "id": "f233e4cc", "metadata": {}, "source": [ "This tutorial demonstrates how to review the light expert simulation result." ] }, { "cell_type": "code", "execution_count": 1, "id": "cf3da57c", "metadata": { "execution": { "iopub.execute_input": "2025-04-17T12:01:08.475549Z", "iopub.status.busy": "2025-04-17T12:01:08.475076Z", "iopub.status.idle": "2025-04-17T12:01:09.227191Z", "shell.execute_reply": "2025-04-17T12:01:09.226574Z" } }, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "from ansys.speos.core import LightPathFinder, Project, Speos\n", "from ansys.speos.core.simulation import SimulationInteractive\n", "\n", "# If using docker container\n", "assets_data_path = Path(\"/app\") / \"assets\"\n", "# If using local server\n", "# assets_data_path = Path().resolve().parent.parent / \"tests\" / \"assets\"\n", "# If using a different path\n", "# assets_data_path = Path(\"path/to/downloaded/example/assets\")" ] }, { "cell_type": "markdown", "id": "eec542b3", "metadata": {}, "source": [ "## Create connection with speos rpc server" ] }, { "cell_type": "code", "execution_count": 2, "id": "781c25af", "metadata": { "execution": { "iopub.execute_input": "2025-04-17T12:01:09.229706Z", "iopub.status.busy": "2025-04-17T12:01:09.229238Z", "iopub.status.idle": "2025-04-17T12:01:09.236082Z", "shell.execute_reply": "2025-04-17T12:01:09.235422Z" } }, "outputs": [], "source": [ "speos = Speos(host=\"localhost\", port=50098)" ] }, { "cell_type": "markdown", "id": "8076a755", "metadata": {}, "source": [ "## Create a new project" ] }, { "cell_type": "markdown", "id": "ee2add09", "metadata": {}, "source": [ "In this example, a project is created via reading a pre-defined .speos file." ] }, { "cell_type": "markdown", "id": "68a614a9", "metadata": {}, "source": [ "User can preview the part and mesh information." ] }, { "cell_type": "markdown", "id": "c31b3269", "metadata": {}, "source": [ "By providing viz_args to the preview function, project part can be viewed in a semi-transparent\n", "way." ] }, { "cell_type": "markdown", "id": "6b9e745a", "metadata": {}, "source": [ "It can be found there is volume conflict in this project." ] }, { "cell_type": "code", "execution_count": 3, "id": "1c1983ae", "metadata": { "execution": { "iopub.execute_input": "2025-04-17T12:01:09.238387Z", "iopub.status.busy": "2025-04-17T12:01:09.238045Z", "iopub.status.idle": "2025-04-17T12:01:10.518634Z", "shell.execute_reply": "2025-04-17T12:01:10.518015Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e01debc1e00f40458e2d0cd2e69b03a5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "286c7a5eef63475fbfbcc944d9cb1587": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4ac0378d7fa3438f82ea9d9a9c575e24": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_8e3e1054c5924553a2df55dd800fed5b", "placeholder": "​", "style": "IPY_MODEL_174a4ea0bff24afbb7dc1230d04d0235", "tabbable": null, "tooltip": null, "value": "" } }, "8e3e1054c5924553a2df55dd800fed5b": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "9434a6a00d2d4478a178bd08b2d92604": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null } }, "c485863cf4024df398fc2e7e4f24cb0c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null } }, "e01debc1e00f40458e2d0cd2e69b03a5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_e2679c5bd6df41c2974dd9d85d3f6fd2", "placeholder": "​", "style": "IPY_MODEL_9434a6a00d2d4478a178bd08b2d92604", "tabbable": null, "tooltip": null, "value": "" } }, "e2679c5bd6df41c2974dd9d85d3f6fd2": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }