{ "cells": [ { "cell_type": "markdown", "id": "b2a23627", "metadata": {}, "source": [ "# How to preview a light expert result" ] }, { "cell_type": "markdown", "id": "6485d0c6", "metadata": {}, "source": [ "This tutorial demonstrates how to review the light expert simulation result." ] }, { "cell_type": "code", "execution_count": 1, "id": "857c059a", "metadata": { "execution": { "iopub.execute_input": "2025-03-28T09:25:26.294244Z", "iopub.status.busy": "2025-03-28T09:25:26.293738Z", "iopub.status.idle": "2025-03-28T09:25:26.871750Z", "shell.execute_reply": "2025-03-28T09:25:26.871088Z" } }, "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": "072f8168", "metadata": {}, "source": [ "## Create connection with speos rpc server" ] }, { "cell_type": "code", "execution_count": 2, "id": "04556bb1", "metadata": { "execution": { "iopub.execute_input": "2025-03-28T09:25:26.874060Z", "iopub.status.busy": "2025-03-28T09:25:26.873817Z", "iopub.status.idle": "2025-03-28T09:25:26.880419Z", "shell.execute_reply": "2025-03-28T09:25:26.879786Z" } }, "outputs": [], "source": [ "speos = Speos(host=\"localhost\", port=50098)" ] }, { "cell_type": "markdown", "id": "3266256a", "metadata": {}, "source": [ "## Create a new project" ] }, { "cell_type": "markdown", "id": "e4fe55db", "metadata": {}, "source": [ "In this example, a project is created via reading a pre-defined .speos file." ] }, { "cell_type": "markdown", "id": "bf4c8429", "metadata": {}, "source": [ "User can preview the part and mesh information." ] }, { "cell_type": "markdown", "id": "5304d7a8", "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": "fcaf5376", "metadata": {}, "source": [ "It can be found there is volume conflict in this project." ] }, { "cell_type": "code", "execution_count": 3, "id": "7d80ade9", "metadata": { "execution": { "iopub.execute_input": "2025-03-28T09:25:26.882531Z", "iopub.status.busy": "2025-03-28T09:25:26.882167Z", "iopub.status.idle": "2025-03-28T09:25:27.734722Z", "shell.execute_reply": "2025-03-28T09:25:27.734026Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4f5dab15df9d463eb127f32c962ed690", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "5e7d09f1f6044506ab38477fc027d9aa": { "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 } }, "6cf3021a52c04768a91e81bed11cfaee": { "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_5e7d09f1f6044506ab38477fc027d9aa", "placeholder": "​", "style": "IPY_MODEL_733a8195c0a54d6580bebfaac8f0e528", "tabbable": null, "tooltip": null, "value": "" } }, "6e7cb87515df48368ba9e7cbca19bfd7": { "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_f1b4180bf7304024972a25042cafcd7e", "placeholder": "​", "style": "IPY_MODEL_193c3f9dfff54b5ca0bd684d7625c29e", "tabbable": null, "tooltip": null, "value": "" } }, "733a8195c0a54d6580bebfaac8f0e528": { "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 } }, "d1a36cbf85b345c09d2c1dc85825710e": { "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 } }, "f1b4180bf7304024972a25042cafcd7e": { "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 }