Skip to content

Commit 5c4434f

Browse files
authored
Merge pull request ITHACA-FV#612 from giovastabile/update_submodules
ENH: updated to OF2506
2 parents 73dd675 + a578c22 commit 5c4434f

File tree

6 files changed

+80
-1
lines changed

6 files changed

+80
-1
lines changed

.compileOF2506.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
docker pull ithacafv/openfoam2506-muq2-pytorch
3+
docker run -ti -d --name foam2506 -v "${PWD}":/home/ofuser/app:rw ithacafv/openfoam2506-muq2-pytorch /bin/bash
4+
docker exec foam2506 /bin/bash -c "source /usr/lib/openfoam/openfoam2506/etc/bashrc; cd /home/ofuser/app; git config --global --add safe.directory /home/ofuser/app; source etc/bashrc; git submodule update --init; ./Allwclean; ./Allwmake -taumq"

.github/workflows/of2512.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: OF2506
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
include:
17+
- name: "OpenFOAM 2506"
18+
install: "cd ."
19+
compile: ./.compileOF2506.sh
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v1
24+
- name: install OF
25+
run: ${{ matrix.install}}
26+
- name: make
27+
run: ${{ matrix.compile}}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<a href="https://www.codacy.com/gh/ithaca-fv/ITHACA-FV/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ithaca-fv/ITHACA-FV&amp;utm_campaign=Badge_Grade">
1414
<img alt="Codacy Badge" src="https://app.codacy.com/project/badge/Grade/f51e1de0fd7c42a6a0be13889cbd4b0e">
1515
</a>
16+
</p>
1617

1718
### 0. Introduction
1819
**ITHACA-FV** is an implementation in **OpenFOAM** of several reduced order modelling techniques. **ITHACA-FV** is designed for [**OpenFOAM v2412**](https://www.openfoam.com/news/main-news/openfoam-v2412/) but it can be easily adapted also to other versions of OpenFOAM.

dockerfiles/OF2412/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ clean:
33
rm -f hello
44

55
build:
6-
docker build --build-arg myuser=$(shell whoami) --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t ithacafv/openfoam2412 -f ./Dockerfile .
6+
docker build --build-arg myuser=$(shell whoami) --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t ithacafv/openfoam2506-muq2-pytorch -f ./Dockerfile .
77

88
run: build
99
xhost +"local:docker" && \

dockerfiles/OF2506/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Start from the ubuntu Openfoam 2106 image
2+
FROM opencfd/openfoam-dev:2506
3+
USER root
4+
ARG PYTHON_VERSION=3.7
5+
ENV PATH="/root/miniconda3/bin:${PATH}"
6+
7+
RUN rm /etc/apt/sources.list.d/openfoam.list && \
8+
cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
9+
grep -v -e "openfoam" /etc/apt/sources.list.backup > /etc/apt/sources.list && \
10+
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
11+
apt-get update && \
12+
apt-get install -yy -q pwgen npm nodejs cmake git wget bzip2 unzip && \
13+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
14+
15+
# Anaconda installing
16+
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
17+
bash Miniconda3-latest-Linux-x86_64.sh -b && \
18+
rm Miniconda3-latest-Linux-x86_64.sh && \
19+
. /root/miniconda3/etc/profile.d/conda.sh && \
20+
export PATH=/root/miniconda3/bin:$PATH && \
21+
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.7.1%2Bcpu.zip && \
22+
unzip libtorch-cxx11-abi-shared-with-deps-2.7.1+cpu.zip && \
23+
rm libtorch-cxx11-abi-shared-with-deps-2.7.1+cpu.zip && \
24+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
25+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \
26+
conda install -y -c conda-forge muq cmake && \
27+
conda clean -y --all
28+
ENV TORCH_LIBRARIES=/libtorch
29+
ENV MUQ_LIBRARIES=/root/miniconda3
30+
RUN echo 'source /usr/lib/openfoam/openfoam2412/etc/bashrc' >> ~/.bashrc
31+

dockerfiles/OF2506/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ME=$(shell whoami)
2+
clean:
3+
rm -f hello
4+
5+
build:
6+
docker build --build-arg myuser=$(shell whoami) --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t ithacafv/openfoam2506-muq2-pytorch -f ./Dockerfile .
7+
8+
run: build
9+
xhost +"local:docker" && \
10+
docker run -ti --rm \
11+
-v "${HOME}:/home/${ME}" \
12+
-e DISPLAY=${DISPLAY} \
13+
--security-opt seccomp=unconfined \
14+
ubuntu-apc
15+
16+

0 commit comments

Comments
 (0)