Installation#

Via conda-forge#

cashocs is available via the conda package manager, and you can install it (to your currently activated environment) with

conda install -c conda-forge cashocs

Alternatively, you might want to create a new, clean conda environment with the command

conda create -n ENV_NAME -c conda-forge cashocs

where ENV_NAME is the desired name of the new environment.

For more information about conda, please take a look at the conda documentation.

Manual Installation#

  • First, install FEniCS, version 2019.1. Note that FEniCS should be compiled with PETSc and petsc4py. Moreover, note that cashocs is not yet compatible with the new dolfinx, which is currently under development.

  • Then, install meshio, with a h5py version that matches the HDF5 version used in FEniCS, and matplotlib. The version of meshio should be at least 4, but for compatibility it is recommended to use meshio 4.4.

  • You might also want to install Gmsh, version 4.8 or later. cashocs does not necessarily need this to work properly, but it is required for the remeshing functionality.

  • You can install cashocs via the PYPI as follows

    pip install cashocs
    
  • You can install the newest (development) version of cashocs with

    pip install git+https://github.com/sblauth/cashocs.git
    
  • To get the latest (development) version of cashocs, clone this repository with git and install it with pip

    git clone https://github.com/sblauth/cashocs.git
    cd cashocs
    pip install .
    

Note

To verify that the installation was successful, run the tests for cashocs with

python -m pytest tests/

or simply

pytest tests/

from the repository root directory. Note that it might take some time to perform all of these tests for the very first time, as FEniCS compiles the necessary code. However, on subsequent iterations the compiled code is retrieved from a cache, so that the tests are singificantly faster.