Skip to content

Commit

Permalink
Update of readme
Browse files Browse the repository at this point in the history
  • Loading branch information
keileg committed Aug 16, 2019
1 parent b554c0d commit cf5c954
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 81 deletions.
36 changes: 0 additions & 36 deletions Docker.md

This file was deleted.

45 changes: 11 additions & 34 deletions Install.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Setting up a PorePy environment
All developers use the conda distribution of python, and we recommend that conda functionality is applied whenever possible.

Installation of PorePy itself should be straightforward, using pip.
In practice, installing from source is the preferred option to get the newest version of the code - the code hosted on pypi is not always up to date.
Installation of PorePy itself should be straightforward, following the instructions in Readme.md.

To get the code fully working requires a few more steps, as described below.

## Installation on Linux
Instructions are found on the GitHub webpage. The best option is to download the source code from github, and install by `pip install porepy`.
Instructions are found on the GitHub webpage.

## Intall on Windows
The recommended solution for Windows is to use VirtualBox with a Linux image, or equivalent options.
Expand All @@ -17,25 +14,23 @@ to install the dependencies using `conda`, and then `pip install porepy`, prefer
Most likely, parts of PorePy will not work on Windows due to missing libraries etc. This is not fully clear.

## Installation on Mac
Use VirtualBox or similar.

Preliminary trials with a standard installation on Mac has not been successful. None of the devopers use Mac, so testing this has not been a priority.
Install on Mac is possible, but may be a bit complicated. We have little experience with this.


## Docker
There is also a third-party option using Docker containers. For now this should be considered an experimental option.

A Docker image is available, but should be considered experimental for now.

# Setting up GMSH
PorePy currently depends on `GMSH` for meshing of fractured domains.
PorePy depends on `GMSH` for meshing of fractured domains.
Our exprience is that version 4 of Gmsh is much improved compared to earlier versions, in particular for complex geometries.

To make this work, you need gmsh installed on your system, and PorePy needs to know where to look for it.
For Linux users: Gmsh is available through apt-get, but be sure that the version available is >=4.0. If this is not possible, do the manual install below.

Manual install:
First, visit the [Gmsh webpage](http://gmsh.info) and download a suitable version.
Extract, and move the binary (probably located in the subfolder gmsh-x.x.x-Linux/bin or similar) to whereever you prefer.

Our exprience is that version 4 of Gmsh is much improved compared to earlier versions, in particular for complex geometries.

Note to Linux users: Although Gmsh is available through the standard packaging tools, it tends to be hopelessly outdated,
and resulted in severe issues for the fracture meshing last time we checked. Use the GMSH web page instead.

The location of the gmsh file is specific for each user's setup, and is therefore not included in the library.
Instead, to get the path to the gmsh executable, PorePy assumes there is a file called `porepy_config.py` somewhere in `$PYTHONPATH`.
Expand All @@ -50,23 +45,5 @@ Some functionality depends on a point-in-polyhedron test. The PorePy function th
The only robust test, with reasonable installation, we are aware of is available [here](https://github.com/mdickinson/polyhedron/blob/master/polyhedron.py). Unfortunately, the file is not available through pip or conda. Instead, download the file, and place it somewhere in PYTHONPATH with the name robust_point_in_polyhedron.py. The PorePy function is_inside_polyhedron() then acts as a wrapper around this external package.

# Other packages
Others libraries that should be installed are numpy (available on both conda and pip), scipy (conda and pip), networkx (conda and pip, NOTE: version 2.x), meshio (pip only), sympy (conda and pip). In addition libraries like cython, numba, vtk, pymetis and pyamg should be installed to get full functionality.

# Fast unique arrays
Improvements in Numpy's unique function, introduced in numpy version 1.13, can in certain cases speed up PorePy's performance immensely
(we have observed runtimes dropping by orders of magnitude, which of course also shows that the homebrewed code used when numpy is too old is less than optimal).
If you have to use an older version of numpy, you can still use the relevant function by an ugly hack:

1. Download the relevant numpy function from [GitHub](https://github.com/numpy/numpy) (locating it can be somewhat difficult,
try to search for 'unique' and look for a file called `numpy/lib/arraysetopts.py`. Locate the function `unique` within the file,
and copy it.
2. Open a file called `numpy_113_unique.py` somewhere in your `$PYTHONPATH`. Paste the copied unique file, and modify the method name, so that the first few lines looks like this:

import numpy as np

def unique_np1130(ar, return_index=False, return_inverse=False,
return_counts=False, axis=None):

PorePy (specifically `porepy.utils.setmembership.unique_tol_columns`) will now access the copied function when possible.
Others libraries that should be installed found in the file requirements.txt

Needless to say, using a newer version of numpy is preferable.
19 changes: 8 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,23 @@ E. Keilegavlen, A. Fumagalli, R. Berge, I. Stefansson, I. Berre: PorePy: An Open

Other publications done with PorePy can be found [here](./examples/papers).

# Installation
PorePy depends on `numpy`, `scipy` and `networkx`, and (for the moment) also on `meshio`, `sympy` and `matplotlib`. The latter packages may be droped / changed later. To install (on Linux, probably also OSX), use

pip install porepy

We recommend installing from source (see below), rather than pulling from pypi. Installation by pip on Windows may cause problems with buliding the requirements (`numpy` etc) unless conda is used.
# Installation from source

For more detailed install instructions, including how to access GMSH (for meshing), see
[Install](https://github.com/pmgbergen/porepy/blob/develop/Install.md).

PorePy is developed under Python >=3.6.

# From source
To get the most current version, install from github:

git clone https://github.com/pmgbergen/porepy.git

cd porepy

To get the stable (though not very frequently updated) version:
git checkout master

Install
pip install -r requirements.txt

Finally to install PorePy
Expand All @@ -62,10 +60,9 @@ A docker image is available from docker.io/keileg/porepy:
For the moment, Docker support should be considered experimental.

# (Semi-) Optional packages
To function optimally, PorePy should have access to the pypi packages:
* `pymetis` (for mesh partitioning). Will be installed on Linux (not so on Windows, to avoid installation issues for the core package in the case where no C compiler is available).
* Some computationally expensive methods can be accelerated with `Cython` or `Numba`. Cython is automatically installed on many Linux systems, if not, use pip or conda. Numba can be installed using `conda`.
* Visualization by either matplotlib or (preferrable for larger problems) vtk/paraview. To dump data to paraview, a vtk filter must be available; the only solution we have found is from the 'conda' repositories, e.g. 'RUN conda install -c conda-forge vtk'
To function optimally, PorePy should have access to some more packages:
* `pymetis` (for mesh partitioning).
* Some computationally expensive methods can be accelerated with `Cython` or `Numba`.
* We use `shapely` for certain geometry-operations.
* Meshing: currently by [gmsh](http://gmsh.info/doc/texinfo/gmsh.html). For its configuration see [Install](https://github.com/pmgbergen/porepy/blob/develop/Install.md).

Expand Down

0 comments on commit cf5c954

Please sign in to comment.