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
24 changes: 12 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
doc-build: true

# TODO: enable when issues in PyMechanical are resolved
# geometry-mechanical-dpf:
# uses: ./.github/workflows/geometry-mechanical-dpf.yml
# secrets: inherit
# with:
# doc-build: true
geometry-mechanical-dpf:
uses: ./.github/workflows/geometry-mechanical-dpf.yml
secrets: inherit
with:
doc-build: true

fluent-mechanical:
uses: ./.github/workflows/fluent-mechanical.yml
Expand All @@ -50,8 +50,8 @@ jobs:
compile-docs:
runs-on: ubuntu-latest
# TODO: enable when issues in PyMechanical are resolved
# needs: [geometry-mesh, geometry-mesh-fluent, geometry-mechanical-dpf, fluent-mechanical, speos-optislang]
needs: [geometry-mesh, geometry-mesh-fluent, fluent-mechanical, speos-optislang]
needs: [geometry-mesh, geometry-mesh-fluent, geometry-mechanical-dpf, fluent-mechanical, speos-optislang]
# needs: [geometry-mesh, geometry-mesh-fluent, fluent-mechanical, speos-optislang]
steps:
- name: Checkout code
uses: actions/[email protected]
Expand Down Expand Up @@ -82,11 +82,11 @@ jobs:
path: doc/

# TODO: enable when issues in PyMechanical are resolved
# - name: Download artifacts for geometry-mechanical-dpf
# uses: actions/download-artifact@v6
# with:
# name: geometry-mechanical-dpf-docs
# path: doc/
- name: Download artifacts for geometry-mechanical-dpf
uses: actions/download-artifact@v5
with:
name: geometry-mechanical-dpf-docs
path: doc/

- name: Download artifacts for fluent-mechanical
uses: actions/download-artifact@v6
Expand Down
114 changes: 98 additions & 16 deletions .github/workflows/geometry-mechanical-dpf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
PYANSYS_WORKFLOWS_CI: true
ANSYS_RELEASE_FOR_DOCS: 25.1
ANSYS_DPF_ACCEPT_LA: 'Y'

jobs:

Expand Down Expand Up @@ -130,8 +131,8 @@ jobs:
docker rm -f $dockerContainers
}

mech-dpf:
name: Mechanical - Dpf
mechanical:
name: Mechanical
runs-on: public-ubuntu-latest-8-cores
needs: [geometry, is-only-docs-required]
strategy:
Expand Down Expand Up @@ -174,27 +175,30 @@ jobs:

- name: Run the PyMechanical script
env:
NUM_CORES: 1
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 2
# ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
# ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 0
PYTHONUNBUFFERED: 1
run: |
. /.venv/bin/activate
xvfb-run mechanical-env python geometry-mechanical-dpf/wf_gmd_02_mechanical.py > pymechlogs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pymechlogs${{ matrix.ansys-release }}.txt

- name: Run the PyDPF script
- name: List all files including hidden ones
run: |
. /.venv/bin/activate
xvfb-run python geometry-mechanical-dpf/wf_gmd_03_dpf.py > pydpflogs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pydpflogs${{ matrix.ansys-release }}.txt
echo "Listing all files (including hidden) under geometry-mechanical-dpf/outputs"
find geometry-mechanical-dpf/outputs -print
echo "Detailed file listing:"
find geometry-mechanical-dpf/outputs -type f -exec ls -lah {} +

- name: Store the outputs
uses: actions/upload-artifact@v5
with:
name: geometry-mechanical-dpf-workflow-mechanical-dpf-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

path: |
geometry-mechanical-dpf/outputs/
geometry-mechanical-dpf/outputs/**/*
include-hidden-files: true
- name: (DOCS) Download the docs artifacts
uses: actions/download-artifact@v6
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
Expand All @@ -216,16 +220,93 @@ jobs:
uv pip install -r ./doc/requirements.txt
xvfb-run mechanical-env make -C doc html > pymech-docs-logs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pymech-docs-logs${{ matrix.ansys-release }}.txt
- name: (DOCS) Adapt the documentation paths
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
run: |
find . -type f -exec sed -i 's|/__w/pyansys-workflows/pyansys-workflows/doc/source/examples/geometry-mechanical-dpf/images|./images/|g' {} +

- name: (DOCS) Upload docs artifacts
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
uses: actions/upload-artifact@v4
with:
name: geometry-mechanical-dpf-docs-stage-mechanical
path: |
outputs/
doc/_build/
doc/source/examples/geometry-mechanical-dpf/
overwrite: true

dpf:
name: Dpf
runs-on: public-ubuntu-latest-8-cores
needs: [mechanical, is-only-docs-required]
strategy:
fail-fast: false
matrix:
ansys-release: ${{ needs.is-only-docs-required.outputs.only-docs == 'true' && fromJSON('[25.1]') || fromJSON('[24.1, 24.2, 25.1]') }}
steps:

- name: Update dependencies
run: |
sudo apt update
sudo apt install -y xvfb git curl make

- name: Checkout code
uses: actions/[email protected]
with:
sparse-checkout: |
geometry-mechanical-dpf
doc

- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install requirements"
run: pip install -r geometry-mechanical-dpf/requirements_${{ matrix.ansys-release }}.txt

- name: Check out the mechanical outputs
uses: actions/download-artifact@v5
with:
name: geometry-mechanical-dpf-workflow-mechanical-dpf-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

- name: Set numeric ANSYS version
run: echo "ANSYS_VERSION=${{ matrix.ansys-release }}" | tr -d '.' >> $GITHUB_ENV
- name: "Install DPF"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
with:
dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
ANSYS_VERSION: ${{ env.ANSYS_VERSION }}

- name: "Check licences of packages"
uses: ansys/pydpf-actions/[email protected]
- name: Run the PyDPF script
run: |
python geometry-mechanical-dpf/wf_gmd_03_dpf.py

- name: Store the outputs
uses: actions/upload-artifact@v4
with:
name: geometry-mechanical-dpf-workflow-mechanical-dpf-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

- name: (DOCS) Download the docs artifacts
uses: actions/download-artifact@v5
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
with:
name: geometry-mechanical-dpf-docs-stage-mechanical
path: doc

- name: (DOCS) Build the documentation for the DPF script (only on ${{ env.ANSYS_RELEASE_FOR_DOCS }})
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
env:
BUILD_DOCS_SCRIPT: 'geometry-mechanical-dpf/wf_gmd_03_dpf.py'
run: |
. /.venv/bin/activate
uv pip install -r ./doc/requirements.txt
xvfb-run make -C doc html > dpf-docs-logs${{ matrix.ansys-release }}.txt 2>&1 || true
cat dpf-docs-logs${{ matrix.ansys-release }}.txt
pip install -r ./doc/requirements.txt
xvfb-run make -C doc html

- name: (DOCS) Adapt the documentation paths
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
Expand All @@ -238,6 +319,7 @@ jobs:
with:
name: geometry-mechanical-dpf-docs
path: |
outputs/
doc/_build/
doc/source/examples/geometry-mechanical-dpf/
overwrite: true
2 changes: 1 addition & 1 deletion geometry-mechanical-dpf/requirements_24.1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ansys-geometry-core[all]==0.7.6
ansys-mechanical-core==0.11.34
ansys-dpf-core[plotting]==0.12.2
ansys-dpf-core[plotting]==0.14.2
3 changes: 2 additions & 1 deletion geometry-mechanical-dpf/requirements_24.2.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ansys-geometry-core[all]==0.7.6
ansys-mechanical-core==0.11.34
ansys-dpf-core[plotting]==0.12.2
ansys-dpf-core[plotting]==0.14.2

12 changes: 10 additions & 2 deletions geometry-mechanical-dpf/wf_gmd_02_mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,19 @@ def display_image(image_name):
#
transient_solution.Solve(True)

# TODO :Remove once completed
# Export mesh image
Tree.Activate([transient_temperature_result])
ExtAPI.Graphics.Camera.SetFit()
ExtAPI.Graphics.ExportImage(
os.path.join(OUTPUT_DIR, "temperature.png"), image_export_format, settings_720p
)

###############################################################################
# Save files and close Mechanical
# -------------------------------
# Mechanical file (mechdb) contains results for each analysis
#
app.save(os.path.join(OUTPUT_DIR, "pcb.mechdb"))
project_directory = ExtAPI.DataModel.Project.ProjectDirectory
app.exit()
print(f"Mechanical file saved to: {OUTPUT_DIR / 'pcb.mechdb'}")
app.close()
Loading