Skip to content

Commit 7c32c77

Browse files
authored
Merge branch 'ITHACA-FV:master' into tutorial_parallelization
2 parents 08064b7 + bbc95ce commit 7c32c77

File tree

198 files changed

+252
-35279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+252
-35279
lines changed

.compileOF2412.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/openfoam2412-muq2-pytorch
3+
docker run -ti -d --name foam2412 -v "${PWD}":/home/ofuser/app:rw ithacafv/openfoam2412-muq2-pytorch /bin/bash
4+
docker exec foam2412 /bin/bash -c "source /usr/lib/openfoam/openfoam2412/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"

.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/of2412.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: OF2412
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 2412"
18+
install: "cd ."
19+
compile: ./.compileOF2412.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}}

.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}}

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@
55
[submodule "src/thirdparty/Eigen"]
66
path = src/thirdparty/Eigen
77
url = https://gitlab.com/libeigen/eigen.git
8+
[submodule "src/thirdparty/spectra"]
9+
path = src/thirdparty/spectra
10+
url = https://github.com/yixuan/spectra.git
11+
[submodule "src/thirdparty/OptimLib"]
12+
path = src/thirdparty/OptimLib
13+
url = https://github.com/kthohr/optim.git

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414
<img alt="Codacy Badge" src="https://app.codacy.com/project/badge/Grade/f51e1de0fd7c42a6a0be13889cbd4b0e">
1515
</a>
1616
</p>
17-
<p align="center">
18-
<a href="https://github.com/ithaca-fv/ITHACA-FV/actions?query=workflow%3AOF1812"><img alt="OF1812" src="https://github.com/ithaca-fv/ITHACA-FV/workflows/OF2212/badge.svg"></a>
19-
</p>
2017

2118
### 0. Introduction
2219
**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.
2320

2421
**ITHACA-FV** can also be used as a basis for more advanced projects that would like to assess the capability of reduced order models in their existing **OpenFOAM**-based software, thanks to the availability of several reduced order methods and algorithms.
2522

26-
Linear and non-linear algebra operations which are not already implemented in OpenFOAM are performed with the external library [**Eigen**](http://eigen.tuxfamily.org/index.php?title=Main_Page). The source code of Eigen 3.3.7 is provided together with ITHACA-FV and is located in the [src/thirdyparty/Eigen](./src/thirdparty/Eigen) folder. For the EigenValue decomposition it is also possible to rely on the [**Spectra-0.7.0**](https://spectralib.org/) library and the source code is provided in the [src/thirdyparty/spectra](./src//thirdparty/spectra) folder. Numerical optimization can be performed using the external library [**OptimLib**](https://www.kthohr.com/optimlib.html) and the header based source code is provided in the [src/thirdyparty/OptimLib](./src/thirdparty/OptimLib) folder.
23+
Linear and non-linear algebra operations which are not already implemented in OpenFOAM are performed with the external library [**Eigen**](http://eigen.tuxfamily.org/index.php?title=Main_Page). Eigen 3.4 is provided as a git submodule together with ITHACA-FV and is located in the [src/thirdyparty/Eigen](./src/thirdparty/Eigen) folder. For the EigenValue decomposition it is also possible to rely on the [**Spectra-1.2.0**](https://spectralib.org/) library and the source code, as a git submodule, is provided in the [src/thirdyparty/spectra](./src//thirdparty/spectra) folder. Numerical optimization can be performed using the external library [**OptimLib**](https://www.kthohr.com/optimlib.html) and the header based source code, as a git submodule, is provided in the [src/thirdyparty/OptimLib](./src/thirdparty/OptimLib) folder.
2724

28-
**ITHACA-FV** has been tested on ubuntu 16.04, CentOS 7, ArchLinux but can be easily compiled on any linux distribution with a compiled version of OpenFOAM 2106, OpenFOAM 2212, OpenFOAM 2306, OpenFOAM 2312, OpenFOAM 2406, and OpenFOAM 2412.
25+
**ITHACA-FV** has been tested on several versions of ubuntu, CentOS 7, ArchLinux but can be easily compiled on any linux distribution with a compiled version of OpenFOAM 2106, OpenFOAM 2212, OpenFOAM 2306, OpenFOAM 2312, OpenFOAM 2406, OpenFOAM 2412 and OpenFOAM 2506.
2926

3027
### 1. Prerequisites
3128
**ITHACA-FV** requires
@@ -35,12 +32,13 @@ Linear and non-linear algebra operations which are not already implemented in Op
3532
* [**OpenFOAM 2312**](https://www.openfoam.com/news/main-news/openfoam-v2312) or
3633
* [**OpenFOAM 2406**](https://www.openfoam.com/news/main-news/openfoam-v2406) or
3734
* [**OpenFOAM 2412**](https://www.openfoam.com/news/main-news/openfoam-v2412) or
35+
* [**OpenFOAM 2506**](https://www.openfoam.com/news/main-news/openfoam-v2506)
3836

3937

4038
### 2. Installation and usage
4139
First of all you need to source the bashrc file of your installation **OpenFOAM**. This is of course depending on the location of your OpenFOAM installation and of your particular version of OpenFOAM
4240
```
43-
source $HOME/OpenFOAM/OpenFOAM-v2106/etc/bashrc
41+
source $HOME/OpenFOAM/OpenFOAM-v2506/etc/bashrc
4442
```
4543
Then navigate to the folder where you want to install ITHACA-FV such as, for example, your HOME folder
4644
```
@@ -75,8 +73,9 @@ source etc/bashrc
7573

7674
In the near future the ITHACA-FV will also be linked with the pytorch package for machine learning. Some basic functions are already available. In order to compile these additional functionalities one will need to have torch installed and compile the library with the `-m` options. Moreover one will need to install a version of libtorch with ABI enabled. The one available at the following link for example has it:
7775
```
78-
curl https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.4.0%2Bcpu.zip > libtorch.zip && \
79-
unzip libtorch.zip -d opt/ && \
76+
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.7.1%2Bcpu.zip > libtorch.zip && \
77+
unzip libtorch.zip && \
78+
export TORCH_LIBRARIES=libtorch
8079
```
8180

8281
For a brief description of the classes and methods, you can check the official ITHACA-FV doxygen [documentation](https://ithaca-fv.github.io/ITHACA-FV).

applications/POD/Make/options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ EXE_INC = \
3434
-I$(LIB_ITHACA_SRC)/thirdparty/spectra/include \
3535
-Wno-comment \
3636
-w \
37-
-std=c++14
37+
-std=c++17
3838

3939
EXE_LIBS = \
4040
-lturbulenceModels \

applications/extract_time_evolution/Make/options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ EXE_INC = \
2525
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
2626
-I$(LIB_SRC)/functionObjects/forces/lnInclude \
2727
-w \
28-
-std=c++14
28+
-std=c++17
2929

3030
EXE_LIBS = \
3131
-lturbulenceModels \

dockerfiles/OF2412/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:2412
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 pybind11 && \
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/OF2412/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ME=$(shell whoami)
2+
clean:
3+
rm -f hello
4+
5+
build:
6+
docker build -t ithacafv/openfoam2412-muq2-pytorch -f ./Dockerfile .
7+
8+
run:
9+
docker run -it ithacafv/openfoam2412-muq2-pytorch bash

0 commit comments

Comments
 (0)