This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How do I get the PETScTAOSolver for FEniCS?

0 votes

I am trying out some Python code (specifically FEniCS Variational Damage and Fracture / fracture/demo_quasi_static/demo_damage_QS.py).

However, I'm running into the following error:

NameError: name 'PETScTAOSolver' is not defined

It appears I need to install tao4py, but none of the following worked:

apt-cache search tao4py  # failed to find the package
sudo pip install tao4py  # failed to find package

Checking further, it appears that this link to TAO redirects to the PETSc, so am I right to assume that if I have PETSc on my Ubuntu system, I would also have TAO? Since I have petsc4py would tao4py be also present? I'm wondering if the following pull request: PETSc TAO solver interface for nonlinear optimisation problems is relevant here.

I'm also open to using one of the default solvers if linking to the TAO solver is too difficult. The other question is whether I need to be on the latest versions of FEniCS (dolphin.__version__ is 1.6.0) or PETSc (dpkg -s petsc-dev is 3.4.2). To get to the latest versions, I'm also open to a solution using Docker for FEniCS, but I'm not sure which of the 4 images to choose.

asked Mar 9, 2016 by nathaniel FEniCS Novice (150 points)

1 Answer

0 votes

I suppose that you've installed FEniCS via PPA. You could try the docker approach (the stable version works fine), where you have a relatively recent version of PETSc that includes Tao, and thus the PETScTAOSolver interface.

answered Mar 25, 2016 by tianyikillua FEniCS User (1,620 points)
...