Skip to content

Commit

Permalink
Add SU2-based tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisH committed Apr 12, 2024
1 parent 340b447 commit 45650f2
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 5 deletions.
10 changes: 5 additions & 5 deletions perpendicular-flap/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ cases:
run: ./run.sh
component: openfoam-adapter

# fluid-su2:
# participant: Fluid
# directory: ./fluid-su2
# run: ./run.sh
# component: su2-adapter
fluid-su2:
participant: Fluid
directory: ./fluid-su2
run: ./run.sh
component: su2-adapter

solid-calculix:
participant: Solid
Expand Down
16 changes: 16 additions & 0 deletions tools/tests/component-templates/su2-adapter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
build:
context: {{ dockerfile_context }}
args:
{% for key, value in build_arguments.items() %}
- {{key}}={{value}}
{% endfor %}
target: su2_adapter
depends_on:
prepare:
condition: service_completed_successfully
volumes:
- {{ run_directory }}:/runs
command: >
/bin/bash -c "id &&
cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' &&
{{ run }} | tee {{ case_folder }}.log 2>&1"
20 changes: 20 additions & 0 deletions tools/tests/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,23 @@ calculix-adapter:
CALULIX_ADAPTER_REF:
description: Version of Calculix-Adapter to use
default: "master"

su2-adapter:
repository: https://github.com/precice/su2-adapter
template: components-templates/su2-adapter.yaml # TODO
build_arguments:
PRECICE_REF:
description: Version of preCICE to use
default: "main"
PLATFORM:
description: Dockerfile platform used
default: "ubuntu_2204"
TUTORIALS_REF:
description: Tutorial git reference to use
default: "master"
SU2_VERSION:
description: Version of SU2 to use
default: "7.5.1"
SU2_ADAPTER_REF:
description: Version of SU2-Adapter to use
default: "master"
24 changes: 24 additions & 0 deletions tools/tests/dockerfiles/ubuntu_2204/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,27 @@ RUN git clone https://github.com/precice/calculix-adapter.git && \
git checkout ${CALULIX_ADAPTER_REF} &&\
make CXX_VERSION=${CALULIX_VERSION} ADDITIONAL_FFLAGS="-fallow-argument-mismatch" -j $(nproc) && \
ln -s /home/precice/calculix-adapter/bin/ccx_preCICE /home/precice/.local/bin/ccx_preCICE

FROM precice_dependecies as su2_adapter
COPY --from=precice /home/precice/.local /home/precice/.local
USER root
ARG SU2_VERSION
USER precice

# Download and build SU2 (We could also use pre-built binaries from the SU2 releases)
WORKDIR /home/precice
RUN wget https://github.com/su2code/SU2/archive/refs/tags/${SU2_VERSION}.tar.gz && \
tar xvzf ${SU2_VERSION}.tar.gz && \
rm -fv ${SU2_VERSION}.tar.gz
ARG SU2_ADAPTER_REF
WORKDIR /home/precice
ENV SU2_RUN="/home/precice/SU2_RUN/bin"
ENV SU2_HOME="/home/precice/SU2_${SU2_VERSION}"
ENV PATH="/home/precice/su2-adapter/run:$SU2_RUN:$PATH"
ENV PYTHONPATH="$SU2_RUN:$PYTHONPATH"
RUN git clone https://github.com/precice/su2-adapter.git && \
cd su2-adapter && \
git checkout ${SU2_ADAPTER_REF} &&\
./su2AdapterInstall &&\
./meson.py build -Denable-pywrapper=true --prefix=$SU2_RUN &&\
./ninja -C build install
10 changes: 10 additions & 0 deletions tools/tests/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,13 @@ test_suites:
- fluid-openfoam
- solid-openfoam
reference_result: ./flow-over-heated-plate/reference-results/fluid-openfoam_solid-openfoam.tar.gz
- path: perpendicular-flap
case_combination:
- fluid-openfoam
- solid-calculix
reference_result: ./perpendicular-flap/reference-results/fluid-openfoam_solid-calculix.tar.gz
- path: perpendicular-flap
case_combination:
- fluid-su2
- solid-fenics
reference_result: ./perpendicular-flap/reference-results/fluid-su2_solid-fenics.tar.gz

0 comments on commit 45650f2

Please sign in to comment.