Skip to content

FIX: split the workflow #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 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
68 changes: 66 additions & 2 deletions .github/workflows/geometry-mechanical-dpf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
docker rm $dockerContainers
}

mech-dpf:
name: Mechanical - Dpf
mechanical:
name: Mechanical
runs-on: ubuntu-latest-8-cores
needs: geometry
strategy:
Expand Down Expand Up @@ -131,6 +131,61 @@ jobs:
xvfb-run mechanical-env python geometry-mechanical-dpf/02_mechanical.py > pymechlogs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pymechlogs${{ matrix.ansys-release }}.txt

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

- name: Stop any remaining containers
if: always()
run: |
$dockerContainers = docker ps -a -q
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
docker stop $dockerContainers
docker rm $dockerContainers
}


dpf:
name: Data Processing Framework
runs-on: ubuntu-latest-8-cores
needs: mechanical
strategy:
fail-fast: false
matrix:
ansys-release: [24.1, 24.2]
container:
image: 'ghcr.io/ansys/mechanical:${{ matrix.ansys-release }}.0'
options: --entrypoint /bin/bash
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: 'geometry-mechanical-dpf'

- name: Set up Python
run: |
apt update
apt install --reinstall ca-certificates
apt install software-properties-common -y
add-apt-repository ppa:deadsnakes/ppa -y
apt install -y python${{ env.MAIN_PYTHON_VERSION }} python${{ env.MAIN_PYTHON_VERSION }}-venv
python${{ env.MAIN_PYTHON_VERSION }} -m venv /env

- name: Install dependencies
run: |
. /env/bin/activate
python -m pip install --upgrade pip
pip install -r geometry-mechanical-dpf/requirements_${{ matrix.ansys-release }}.txt

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

- name: Run the PyDPF script
run: |
. /env/bin/activate
Expand All @@ -142,3 +197,12 @@ jobs:
with:
name: pymechanical-dpf-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

- name: Stop any remaining containers
if: always()
run: |
$dockerContainers = docker ps -a -q
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
docker stop $dockerContainers
docker rm $dockerContainers
}
6 changes: 3 additions & 3 deletions geometry-mechanical-dpf/03_dpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def find_files(directory, extension):
# -- Transien thermal results --
#
# Create model
model = dpf.Model(transient_rth_file[0])
print(steady_state_model)
transient_model = dpf.Model(transient_rth_file[0])
print(transient_model)

# Get temperature distribution
temp = model.results.temperature.on_last_time_freq.eval()[0]
temp = transient_model.results.temperature.on_last_time_freq.eval()[0]

# Plot the the temperature for ic-1
if GRAPHICS_BOOL:
Expand Down
Loading