|
MigFlow requires a linear solver to solve the Navier-Stokes equations. Before starting the installation of MigFlow, make sure you have a recent version of [PETSc](https://www.mcs.anl.gov/petsc/download/index.html) with proper configuration.
|
|
# Installation
|
|
|
|
Migflow can be installed as a python package or compiled from source. In addition to migflow itself, the gmsh mesh generator is required and optionally petsc4py.
|
|
|
|
## Migflow
|
|
|
|
### Python package
|
|
|
|
The easiest way to install migflow is to use the package from [pypi](https://test.pypi.org/project/migflow/) using pip.
|
|
|
|
|
|
Meshes representing the computational domain on which Navier-Stokes equations are discretised are created from .geo files using [GMSH](http://gmsh.info/)
|
|
If you do not have pip installed (check the output of pip --version), follow the [official instruction](https://packaging.python.org/tutorials/installing-packages/) to get it.
|
|
|
|
|
|
|
|
|
|
+ Installation of the mesh generator :
|
|
|
|
|
|
|
|
The continuous equations of the model used in the MigFlow project are solved on unstructured meshes. The msh file format is the only one supported by MigFlow and requires the installation of a specific mesh generator.
|
|
|
|
|
|
|
|
1. Go on [GMSH](http://gmsh.info/) webpage and follow the instruction given in the _Download_ section
|
|
|
|
|
|
|
|
2. Create a path in your .bashrc to launch gmsh with command system
|
|
|
|
- Linux
|
|
|
|
|
|
|
|
export PATH="TheGoodPath/gmsh/build:$PATH"
|
|
|
|
|
|
|
|
- MacOs
|
|
|
|
|
|
|
|
export PATH="/Applications/Gmsh.app/Contents/MacOS:$PATH"
|
|
|
|
|
|
|
|
|
|
Once pip is installed, simply type :
|
|
|
|
```sh
|
|
|
|
pip install -i https://test.pypi.org/simple --user migflow
|
|
|
|
```
|
|
|
|
|
|
+ Installation of MigFlow
|
|
### Compilation from sources
|
|
|
|
If you plan to develop migflow, you'll have to compile it from source (instead of installing the python package).
|
|
|
|
|
|
1. Go on the [gitlab](https://git.immc.ucl.ac.be/fluidparticles/migflow) page dedicated to the project to upload your ssh or https link
|
|
1. Go on the [gitlab](https://git.immc.ucl.ac.be/fluidparticles/migflow) page dedicated to the project to upload your ssh or https link
|
|
|
|
|
... | @@ -40,38 +33,30 @@ Meshes representing the computational domain on which Navier-Stokes equations ar |
... | @@ -40,38 +33,30 @@ Meshes representing the computational domain on which Navier-Stokes equations ar |
|
|
|
|
|
→ For MacOS you possibly need to create this hidden file in your HOME directory
|
|
→ For MacOS you possibly need to create this hidden file in your HOME directory
|
|
|
|
|
|
4. (Optional) Linear Solver:
|
|
|
|
|
|
|
|
MigFlow solves the nonlinear Navier-Stokes equations using a Newton's method equations solver that requires the use of a linear solver. MigFlow has its own linear solver based on LU decomposition but it supports the use of PETSc to fasten time consuming computations.
|
|
|
|
|
|
|
|
a. For Ubuntu and other Unix system it is more convenient to use the PETSc project supported by the official distribution repository:
|
|
## GMSH
|
|
- Ubuntu:
|
|
Meshes representing the computational domain on which Navier-Stokes equations are discretised are created from .geo files using [GMSH](http://gmsh.info/)
|
|
|
|
If you use a package manager, it is recommended to install GMSH from your package manager (e.g. `apt install gmsh` on ubuntu).
|
|
|
|
Otherwise, you can download it from [GMSH website](https://gmsh.info) or install it with pip (`pip install --user gmsh`). Either way, check that the gmsh executable is in your PATH variable.
|
|
|
|
|
|
|
|
## PETSc4py
|
|
|
|
MigFlow uses a linear solver to solve Navier-Stokes.
|
|
|
|
The installation of PETSc4py is optional, if it is not available, migflow will use scipy instead. For large meshes, PETSc4py is faster.
|
|
|
|
|
|
sudo apt install petsc_dev
|
|
Again if you use a package manager and if a PETSc4py package is available, use it. (ubuntu : `apt install python3-petsc4py`).
|
|
|
|
Otherwise, follow the instructions bellow to compile it from sources.
|
|
|
|
|
|
b. For other OS, go on [PETSc](https://www.mcs.anl.gov/petsc/download/index.html) webpage and clone the repository on your computer:
|
|
a. For other OS, go on [PETSc](https://www.mcs.anl.gov/petsc/download/index.html) webpage and clone the repository on your computer:
|
|
|
|
|
|
git clone -b maint https://gitlab.com/petsc/petsc.git petsc
|
|
git clone -b maint https://gitlab.com/petsc/petsc.git petsc
|
|
|
|
|
|
c. Compiling options for PETSc:
|
|
b. Compiling options for PETSc:
|
|
|
|
|
|
cd petsc
|
|
cd petsc
|
|
./configure --with-mpi=0 -with-mpi=0 COPTFLAGS="-O3" --with-fc=0 --with-cxx=0 --with-debugging=0
|
|
./configure --with-mpi=0 -with-mpi=0 COPTFLAGS="-O3" --with-fc=0 --with-cxx=0 --with-debugging=0 --download-petsc4py=1
|
|
|
|
|
|
d. Compile PETSc:
|
|
c. Compile PETSc:
|
|
|
|
|
|
make -j4
|
|
make -j4
|
|
|
|
make -j4 install |
|
e. Compile MigFlow specifying PETSc paths:
|
|
|
|
|
|
|
|
- Ubuntu:
|
|
|
|
|
|
|
|
cd ~/MigFlow/build
|
|
|
|
cmake .. -DENABLE_PETSC=1 -DPETSC_DIR=/usr/lib/petscdir/petsc3.9/ -DPETSC_ARCH=x86_64-linux-gnu-real
|
|
|
|
make
|
|
|
|
|
|
|
|
- Other OS:
|
|
|
|
|
|
|
|
cd ~/MigFlow/build
|
|
|
|
cmake .. -DENABLE_PETSC=1 -DPETSC_DIR=$HOME/petsc -DPETSC_ARCH==seq-real-opt
|
|
|
|
make |
|
|
|
\ No newline at end of file |
|
|