Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/maxwell2d-lumerical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Maxwell2D Lumerical Workflow

on:
workflow_dispatch:
inputs:
doc-build:
required: false
default: false
type: boolean
description: 'Whether to build the documentation'
workflow_call:
inputs:
doc-build:
required: false
default: false
type: boolean
description: 'Whether to build the documentation'
push:
branches:
- main
pull_request:
paths:
- 'maxwell2d-lumerical/**'

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
ANSYS_RELEASE_FOR_DOCS: 25.2.0
# AWP_ROOT252: 'C:\Program Files\ANSYS Inc\v252'
MAIN_PYTHON_VERSION: '3.12'
# ON_CI: true
RUN_DOC_BUILD: false

jobs:

maxwell2d-lumerical:
name: Maxwell2D Lumerical
runs-on: [self-hosted, Windows, pyansys-workflows]
strategy:
fail-fast: false
matrix:
ansys-release: [25.1, 25.2]
steps:
- name: Checkout code
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
with:
sparse-checkout: |
maxwell2d-lumerical
doc

- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.6.0
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

# - name: Set up environment variables
# shell: bash
# run: |
# VERSION="${{ matrix.ansys-release }}"
# ANSYS_RELEASE_SHORT="${VERSION%.*}"
# echo "ANSYS_RELEASE_SHORT=$ANSYS_RELEASE_SHORT" >> $GITHUB_ENV
# ANSYS_RELEASE_COMPACT="${ANSYS_RELEASE_SHORT//./}"
# echo "ANSYS_RELEASE_COMPACT=$ANSYS_RELEASE_COMPACT" >> $GITHUB_ENV

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m venv .venv
source .venv/Scripts/activate
pip install -r maxwell2d-lumerical/requirements_${{ matrix.ansys-release }}.txt

- name: Run the workflow script
shell: bash
run: |
source .venv/Scripts/activate
python maxwell2d-lumerical/wf_ml_01_ion_trap_modelling.py

- name: (DOCS) Check if docs should be built
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && inputs.doc-build
shell: bash
run: |
echo "Requested to build docs..."
if [ "${{ matrix.ansys-release }}" = "$ANSYS_RELEASE_FOR_DOCS" ]; then
echo "Building docs"
echo "RUN_DOC_BUILD=true" >> $GITHUB_ENV
else
echo "Not building docs - since not primary release"
echo "RUN_DOC_BUILD=false" >> $GITHUB_ENV
fi

- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS}})
if: ${{ env.RUN_DOC_BUILD == 'true' }}
env:
BUILD_DOCS_SCRIPT: 'maxwell2d-lumerical/wf_ml_01_ion_trap_modelling.py'
shell: bash
run: |
.venv/Scripts/activate
cd doc
pip install -r requirements.txt
./make.bat html

- name: (DOCS) Adapt the documentation paths
if: ${{ env.RUN_DOC_BUILD == 'true' }}
shell: bash
run: |
find . -type f -exec sed -i 's|C:\\Users\\ansys\\actions-runner\\_work\\pyansys-workflows\\pyansys-workflows\\doc\\source\\examples\\maxwell2d-lumerical\\images\\|./images/|g' {} +

- name: (DOCS) Upload docs artifacts
if: ${{ env.RUN_DOC_BUILD == 'true' }}
uses: actions/upload-artifact@v4
with:
name: maxwell2d-lumerical-docs
path: |
doc/_build/
doc/source/examples/maxwell2d-lumerical/
overwrite: true
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ for every part of the simulation process. The available workflows are:
- For geometry: Ansys SpaceClaim / Ansys Discovery / Ansys Geometry Service
- For meshing: Ansys Fluent Meshing
- For simulation: Ansys Fluent Solver

- [Geometry, mechanical and post-processing](https://github.com/ansys/pyansys-workflows/tree/main/geometry-mechanical-dpf): this workflow demonstrates how to
create a printed circuit board (PCB) geometry, mesh, run steady state and transient thermal analysis,
and post-process using DPF. The geometry generated is a simple PCB with multiple chips.
Expand All @@ -35,17 +36,21 @@ for every part of the simulation process. The available workflows are:
- For geometry: Ansys SpaceClaim / Ansys Discovery / Ansys Geometry Service
- For simulation: Ansys Mechanical
- For post-procesing: Ansys Data Processing Framework

- [Fluent and mechanical analysis](https://github.com/ansys/pyansys-workflows/tree/main/fluent-mechanical): this workflow demonstrates how to perform a Conjugate Heat Transfer (CHT) analysis for an exhaust manifold to simulate heat transfer between solid and fluid domains, calculate heat transfer coefficients (HTCs) and temperature distribution, and export results for thermo-mechanical analysis. The thermo-mechanical assessment is then performed to evaluate the exhaust manifold's performance under thermal cycling, aiding in design optimization for durability
The involved Ansys products are:
- For fluids analysis: Ansys Fluent
- For thermal analysis: Ansys Mechanical

- [Speos and optiSLang robustness analysis](https://github.com/ansys/pyansys-workflows/tree/main/speos-optislang): this workflow performs a robustness
study to evaluate how variations in LED source power and position influence lightguide performance using PySpeos and PyOptiSLang. The analysis quantifies performance
through key metrics such as RMS contrast, average luminance, and the number of failed regulations.
The involved Ansys products are:
- For optical analysis: Ansys Speos
- For robustness analysis: Ansys optiSLang

- [Maxwell2D and Lumerical ion trap modelling](https://github.com/ansys/pyansys-workflows/tree/main/maxwell2d-lumerical): this workflow ...

## How to run the workflows

All workflows are structured in the same way, with a Python script for each part of the simulation process.
Expand Down
2 changes: 2 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ def examples_gallery_dirs_and_filename_pattern():
"../../geometry-mesh",
"../../geometry-mesh-fluent",
"../../speos-optislang",
"../../maxwell2d-lumerical",
]
gallery_dirs = [
"examples/fluent-mechanical",
"examples/geometry-mechanical-dpf",
"examples/geometry-mesh",
"examples/geometry-mesh-fluent",
"examples/speos-optislang",
"examples/maxwell2d-lumerical",
]

return examples_dirs, gallery_dirs, filename_pattern
Expand Down
4 changes: 4 additions & 0 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ Workflow examples
.. include:: examples/speos-optislang/index.rst
:start-line: 1
:end-before: .. toctree

.. include:: examples/maxwell2d-lumerical/index.rst
:start-line: 1
:end-before: .. toctree
1 change: 1 addition & 0 deletions maxwell2d-lumerical/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
outputs
Loading
Loading