PETSc

Watch the Video

Linux

Download the software package from the solvers repository and unpack it in some temporary directory:

wget https://github.com/downloads/hpfem/solvers/petsc-3.1-p8.spkg --no-check-certificate
tar -jxvf petsc-3.1-p8.spkg
rm petsc-3.1-p8.spkg
cd petsc-3.1-p8

In order to install the library into say ~/solvers/petsc (you may choose any path you like, provided that you have write access to it; the target directory will be created if it doesn’t exist), type now into the terminal:

./standalone-install ~/solvers/petsc

For advanced configuration possibilities, please read the manual or visit the PETSc home page.

Once the library has been built and installed, you may delete the temporary directory with the unpacked package to save some disk space.

Now go to the directory with Hermes. Create the file CMake.vars with the following lines (or append to the existing one):

set(WITH_PETSC YES)
set(PETSC_ROOT ~/solvers/petsc) #(or your own installation destination)
set(PETSC_ARCH linux-cxx)

Finally execute:

rm CMakeCache.txt
cmake .
make

Find more about Using PETSC in Hermes.

Using PETSC in Hermes

You may now select SOLVER_PETSC as the matrix solver for your finite element problem, as detailed in the Poisson tutorial, or use it just to solve a standalone matrix problem Ax = b as in the Using Matrix Solvers tutorial.

Table Of Contents

Previous topic

Mumps

Next topic

SuperLU