Skip to content

Commit

Permalink
Merge pull request #91 from precice/develop
Browse files Browse the repository at this point in the history
Release v202404.0.0
  • Loading branch information
MakisH authored Apr 23, 2024
2 parents 4996945 + 8f4fc38 commit 4ac47a4
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Run vagrant up
run: |
vagrant up --provider=${{ matrix.provider }}
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1 vagrant up --provider=${{ matrix.provider }}
- name: Package Vagrant box
run: vagrant package --base "preCICE-VM" --output preCICE.box
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.vagrant
vagrant
vagrant

# Editors
settings.json
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can afterwards also see and manage the produced VM in VirtualBox.
A few things you may need:

- The username and password are `vagrant`/`vagrant`
- The keyboard layout is US English (QWERTY). You can change this in [`install-basics.sh`](./install-basics.sh) or through the keyboard setting shortcut on `~/Desktop`.
- The keyboard layout is US English (QWERTY). You can change this in [`install-basics.sh`](./provisioning/install-basics.sh) or through the keyboard setting shortcut on `~/Desktop`.
- Find scripts to install additional software on `~/Desktop/shared`.

### What else can I do?
Expand All @@ -40,25 +40,29 @@ A few things you may need:

## What is included?

This box is based on the [generic/ubuntu2004](https://github.com/lavabit/robox/tree/master/scripts/ubuntu2004) base box and installs:
This box is based on the ~~[generic/ubuntu2004](https://github.com/lavabit/robox/tree/master/scripts/ubuntu2004)~~ [bento/ubuntu-20.04](https://github.com/chef/bento) base box and installs:

- Xubuntu-core (Xfce desktop environment) and related tools
- VirtualBox guest additions
- Terminator (a nice split-window terminal emulator, find it in `Applications > System`)
- Git, CMake, ccmake
- Editors: nano, vim, gedit
- preCICE latest for the master branch
- preCICE config visualizer (master)
- Diff viewer: meld
- preCICE latest from the master branch (built in release-with-debug-info mode)
- preCICE config visualizer with its GUI (master)
- preCICE Python bindings (PIP)
- preCICE Julia bindings (Pkg)
- OpenFOAM v2112 and the OpenFOAM-preCICE adapter (master)
- preCICE Rust bindings (Cargo)
- preCICE FMI Runner (PIP)
- preCICE Micro Manager (PIP)
- OpenFOAM v2312 and the OpenFOAM-preCICE adapter (master)
- deal.II 9.3 from the official backports and the deal.II-preCICE adapter (master)
- CalculiX 2.19 from source and the CalculiX-preCICE adapter (master)
- CalculiX 2.20 from source and the CalculiX-preCICE adapter (master)
- FEniCS latest from the FEniCS PPA and the FEniCS-preCICE adapter (PIP)
- Nutils latest from PIP
- SU2 6.0.0 and the SU2-preCICE adapter (master)
- SU2 7.5.1 and the SU2-preCICE adapter (master)
- code_aster 14.6 and the code_aster-preCICE adapter (master)
- DUNE 2.8 and the experimental DUNE-preCICE adapter (master)
- DUNE 2.9.1 and the experimental DUNE-preCICE adapter (main)
- DuMuX 3.8 and the DuMuX-preCICE adapter (v2.0.0)
- ASTE (master)
- Paraview from APT
- Gnuplot
Expand Down Expand Up @@ -117,6 +121,11 @@ vagrant box remove test-box
If you require a more responsive experience, lower overhead, or exotic features such as GPU pass through, then the `libvirt` vagrant box is for you.
This allows you to run the vagrant box via libvirt and QEMU as a Kernerl Virtual Machine (KVM).

> Note
> The libvirt variant does not work with the `bento/ubuntu-20.04` base image, but also the VirtualBox variant does not at the moment work with the `generic/ubuntu2004` image.
> Change the base image in the beginning of the Vagrantfile if you need this feature.
> See https://github.com/precice/vm/issues/83 for details.
To use this box, first install the vagrant plugin `vagrant-libvirt` following the [official installation instructions](https://github.com/vagrant-libvirt/vagrant-libvirt#installation).
Then you follow the normal usage instructions above, but you need to tell vagrant to use the `libvirt` box by passing one additional option:
```
Expand Down
8 changes: 5 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
Vagrant.configure("2") do |config|
# The generic/ images support virtualbox as well as libvirt and hyperv.
# This allows us to create performance oriented images for Linux (libvirt) and Windows (hyperv).
config.vm.box = "generic/ubuntu2004"
# However, it does not build: https://github.com/precice/vm/issues/83
# config.vm.box = "generic/ubuntu2004"
config.vm.box = "bento/ubuntu-20.04"

# We don't want the box to automatically update every time it starts.
# We can instead handle updates internally, without destroying the machine.
Expand Down Expand Up @@ -46,11 +48,11 @@ Vagrant.configure("2") do |config|
# Install solvers, adapters, and related tools
config.vm.provision "shell", path: "provisioning/install-config-visualizer.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-openfoam.sh", privileged: false
config.vm.provision "file", source: "provisioning/prebuilt/swak4Foam/swak4Foam.tar.gz", destination: "~/OpenFOAM/vagrant-v2206/platforms/linux64GccDPInt32Opt/swak4Foam.tar.gz"
config.vm.provision "shell", path: "provisioning/install-dealii.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-calculix.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-fenics.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-nutils.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-fmiprecice.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-micro-manager.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-su2.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-code_aster.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-dune.sh", privileged: false
Expand Down
6 changes: 3 additions & 3 deletions provisioning/.alias
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# preCICE config visualizer
function preciceToPNG(){
cat "${1:-precice-config.xml}" | precice-config-visualizer | dot -Tpng > precice-config.png
precice-config-visualizer -o precice-config.png "${1:-precice-config.xml}"
}

function preciceToPDF(){
cat "${1:-precice-config.xml}" | precice-config-visualizer | dot -Tpdf > precice-config.pdf
precice-config-visualizer -o precice-config.pdf "${1:-precice-config.xml}"
}

function preciceToSVG(){
cat "${1:-precice-config.xml}" | precice-config-visualizer | dot -Tsvg > precice-config.svg
precice-config-visualizer -o precice-config.svg "${1:-precice-config.xml}"
}
1 change: 1 addition & 0 deletions provisioning/install-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sudo apt-get upgrade -qy
# Install the Xfce desktop environment and basic applications
sudo apt-get install -y xubuntu-core^
sudo apt-get install -y thunar xfce4-terminal terminator bash-completion tree atril firefox firefox-locale-en baobab catfish
sudo apt-get install -y python3-dev pipx python-is-python3 python3-venv

# Setup auto-login for the graphical session
# Disabled due to https://github.com/precice/vm/issues/40
Expand Down
28 changes: 17 additions & 11 deletions provisioning/install-config-visualizer.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#!/usr/bin/env bash
set -ex

# Get the config-visualizer from GitHub
if [ ! -d "config-visualizer/" ]; then
git clone --depth=1 --branch master https://github.com/precice/config-visualizer.git
fi
pip3 install --user -e config-visualizer
# Install CLI dependencies
sudo apt-get install -y graphviz
# Install GUI depedencies
sudo apt-get install -y build-essential pkg-config python3-dev libcairo2-dev libgirepository1.0-dev gir1.2-gtk-3.0

# Get the config-visualizer from PIP
PRECICE_CONFIG_VISUALIZER_VERSION=1.1.3
PRECICE_CONFIG_VISUALIZER_GUI_VERSION=0.1.0
pipx install --force precice-config-visualizer==${PRECICE_CONFIG_VISUALIZER_VERSION}
pipx install --force precice-config-visualizer-gui==${PRECICE_CONFIG_VISUALIZER_GUI_VERSION}

# Add the config-visualizer to PATH
echo "export PATH=\"\${HOME}/config-visualizer/bin:\${PATH}\"" >>~/.bashrc
# shellcheck disable=SC2016
echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ~/.bashrc

# By default, there is no `python` executable, there is only `python3`,
# which causes issues to the config-visualizer
sudo apt-get install -y python-is-python3
# Add the GUI in the apps menu
mkdir -p ~/.local/share/applications ~/.local/share/icons

# Install graphviz, which provides dot, an almost required package to make this useful
sudo apt-get install -y graphviz
CV_LOC_SHARE=~/.local/pipx/venvs/precice-config-visualizer-gui==${PRECICE_CONFIG_VISUALIZER_GUI_VERSION}/share
cp $CV_LOC_SHARE/applications/org.precice.config_visualizer.desktop ~/.local/share/applications/
cp $CV_LOC_SHARE/icons/hicolor/scalable/apps/org.precice.config_visualizer.svg ~/.local/share/icons/
5 changes: 5 additions & 0 deletions provisioning/install-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set -ex

sudo apt-get install -y build-essential git cmake cmake-curses-gui

# For the Rust bindings of preCICE, installed by the elastic-tube-1d tutorial
sudo apt-get install -y cargo

sudo apt-get install -y nano vim gedit

sudo apt-get install -y meld

sudo apt-get install -y ipython3
67 changes: 40 additions & 27 deletions provisioning/install-dune.sh
Original file line number Diff line number Diff line change
@@ -1,76 +1,89 @@
#!/usr/bin/env bash
set -ex

# Make a folder to collect all DUNE-related code (-p to allow re-provisioning)
mkdir -p dune && cd dune
# Make a folder to collect all DUNE-related code
mkdir -p dune-dumux && cd dune-dumux

# Get required DUNE modules
# Modules used by DUNE and DuMux
# While the installdumux.py script clones these as well,
# we explicitly clone them to control the versions.
if [ ! -d "dune-common/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/core/dune-common.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/core/dune-common.git
fi

if [ ! -d "dune-istl/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/core/dune-istl.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/core/dune-istl.git
fi

if [ ! -d "dune-localfunctions/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/core/dune-localfunctions.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/core/dune-localfunctions.git
fi

if [ ! -d "dune-grid/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/core/dune-grid.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/core/dune-grid.git
fi

if [ ! -d "dune-geometry/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/core/dune-geometry.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/core/dune-geometry.git
fi

if [ ! -d "dune-functions/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/staging/dune-functions.git
if [ ! -d "dune-foamgrid/" ]; then
# The missing v in the tag in this module originates from the project itself
git clone --depth 1 --branch 2.9.1 https://gitlab.dune-project.org/extensions/dune-foamgrid.git
fi

if [ ! -d "dune-uggrid/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/staging/dune-uggrid.git
if [ ! -d "dune-functions/" ]; then
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/staging/dune-functions.git
fi

if [ ! -d "dune-typetree/" ]; then
git clone --branch v2.8.0 --depth=1 https://gitlab.dune-project.org/staging/dune-typetree.git
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/staging/dune-typetree.git
fi

if [ ! -d "dune-foamgrid/" ]; then
git clone --branch releases/2.8 --depth=1 https://gitlab.dune-project.org/extensions/dune-foamgrid.git
if [ ! -d "dune-uggrid/" ]; then
git clone --depth 1 --branch v2.9.1 https://gitlab.dune-project.org/staging/dune-uggrid.git
fi

# Get the dune-elastodynamics module (solid solver)
# Get the dune-elastodynamics module (solid solver for the plain dune adapter)
if [ ! -d "dune-elastodynamics/" ]; then
git clone --branch master --depth=1 https://github.com/maxfirmbach/dune-elastodynamics.git
git clone --depth 1 --branch master https://github.com/maxfirmbach/dune-elastodynamics.git
fi
(
cd dune-elastodynamics
git pull
)

# Get the DUNE-preCICE adapter
# Get the plain DUNE-preCICE adapter
if [ ! -d "dune-adapter/" ]; then
git clone --branch main --depth=1 https://github.com/precice/dune-adapter.git
git clone --depth 1 --branch main https://github.com/precice/dune-adapter.git
fi
(
cd dune-adapter/dune-precice
git pull
)

# Build all the DUNE and DUNE-preCICE related modules
DUNE_CONTROL_PATH=~/dune ./dune-common/bin/dunecontrol all
./dune-common/bin/dunecontrol all

# Set the DUNE_CONTROL_PATH (DUNE recursively finds modules in this directory)
echo "export DUNE_CONTROL_PATH=\"\${HOME}/dune\"" >> ~/.bashrc
# Get DuMux and the DuMux-preCICE adapter
if [ ! -d "dumux/" ]; then
git clone --depth 1 --branch releases/3.8 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
fi

# Copy the built example code to the tutorials
cp ~/dune/dune-adapter/dune-precice-howto/build-cmake/examples/dune-perpendicular-flap ~/tutorials/perpendicular-flap/solid-dune
# Build DuMux
CMAKE_FLAGS="$CMAKE_FLAGS -DCMAKE_DISABLE_FIND_PACKAGE_Kokkos=TRUE" ./dune-common/bin/dunecontrol --only=dumux all

if [ ! -d "dumux-adapter/" ]; then
git clone --depth 1 --branch v2.0.0 https://github.com/precice/dumux-adapter.git
fi

# Install dune-fem from PIP
# Build the DuMux-preCICE adapter
CMAKE_FLAGS="$CMAKE_FLAGS -DCMAKE_DISABLE_FIND_PACKAGE_Kokkos=TRUE" ./dune-common/bin/dunecontrol --only=dumux-precice all

pip3 install --user dune-fem==2.8
# Set the DUNE_CONTROL_PATH (DUNE recursively finds modules in this directory)
echo "export DUNE_CONTROL_PATH=\"\${HOME}/dune-dumux\"" >> ~/.bashrc

# Copy the built example code to the tutorials
cp ~/dune-dumux/dune-adapter/dune-precice-howto/build-cmake/examples/dune-perpendicular-flap ~/tutorials/perpendicular-flap/solid-dune

# We are done with DUNE, let's do back home
cd ~
5 changes: 5 additions & 0 deletions provisioning/install-fmiprecice.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex

# Install the FMI runner from PIP
pip3 install --user fmiprecice
4 changes: 4 additions & 0 deletions provisioning/install-micro-manager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -ex

pip install --user micro-manager-precice
5 changes: 0 additions & 5 deletions provisioning/install-nutils.sh

This file was deleted.

29 changes: 6 additions & 23 deletions provisioning/install-openfoam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -ex
# Add the signing key, add the repository, update:
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash

# Install OpenFOAM v2206:
sudo apt-get install -y openfoam2206-dev
# Install OpenFOAM v2312:
sudo apt-get install -y openfoam2312-dev
# Enable OpenFOAM by default:
echo ". /usr/lib/openfoam/openfoam2206/etc/bashrc" >> ~/.bashrc
echo ". /usr/lib/openfoam/openfoam2312/etc/bashrc" >> ~/.bashrc

# Get the OpenFOAM-preCICE adapter
if [ ! -d "openfoam-adapter/" ]; then
Expand All @@ -16,26 +16,9 @@ fi
(
cd openfoam-adapter
git pull
openfoam2206 ./Allwmake
openfoam2312 ./Allclean
openfoam2312 ./Allwmake
)

# Get swak4Foam (provides groovyBC, needed for the turek-hron-fsi3 tutorial)
#
# # Option 1: Build from source
# sudo apt-get install -y mercurial
# hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam
# (
# cd swak4Foam
# hg checkout develop
# openfoam2206 ./AllwmakeAll
# )
#
# # Remove some swak4Foam files to save space (approx. 150MB)
# rm -rfv .~swak4Foam
# sudo apt-get purge --autoremove -y mercurial # This also removes Python2, yipieh!
#
# # Option 2: Use pre-built binaries
# # (see Vagrantfile and post-install.sh, rebuild and update for OpenFOAM version other than v2206)

# Build the tutorials partitioned-heat-conduction solver
cd ~/tutorials/partitioned-heat-conduction/openfoam-solver && openfoam2206 wmake
cd ~/tutorials/partitioned-heat-conduction/solver-openfoam && openfoam2312 wmake
Loading

0 comments on commit 4ac47a4

Please sign in to comment.