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

full tao solvers access via dolfin compiled with petsc3.5? A natural pde (box) constrain optimization aproach?

0 votes

Is it possible model variational problems such as

minimize f(u) subject to a(u) = L (and u>=0)

using tao solvers via dolfin compiled with petsc3.5?

How can I put the equality constrains a(u)=L, its gradient and
hessian on tao solvers with dolfin?

The new example of demo folder in dolfin1.5 demo_buckling-tao.py of Tianyi Li
call the tao solver direct with dolfin. But there is only the objective
function without constrains.

from dolfin import *

if not has_petsc_tao():
    print("DOLFIN must be compiled at least with PETSc 3.5 to run this demo.")
    exit(0)

def __init__(self):
    OptimisationProblem.__init__(self)

# Objective function
def f(self, x):
    u.vector()[:] = x
    return assemble(elastic_energy)

# Gradient of the objective function
def F(self, b, x):
    u.vector()[:] = x
    assemble(grad_elastic_energy, tensor=b)

# Hessian of the objective function
def J(self, A, x):
    u.vector()[:] = x
    assemble(H_elastic_energy, tensor=A)

solver = PETScTAOSolver()

solver.parameters["method"] = "tron"
solver.parameters["monitor_convergence"] = True
solver.parameters["report"] = True

solver.solve(BucklingProblem(), u.vector(), u_min.vector(), u_max.vector())

How can I put some (PDE equality optimization) constrains via tao with dolfin?

( Now the new rosembrok.py classical equality constrain optimization example from demo petsc4py3.5 folder call directly tao solvers. )

asked Mar 26, 2015 by Andre Machado FEniCS User (1,040 points)

1 Answer

0 votes

As I said, you can currently by using the PETScTAOSolver interface (see here) solve a bound-constrained or an unconstrained optimisation problem. All the solvers that you mentioned "nm,lmvm,nls,ntr,cg,blmvm,tron" are available via

solver = PETScTAOSolver()
solver.parameters["method"] = "nm,lmvm,nls,ntr,cg,blmvm,tron"

however some of them are designed only for unconstrained problems.

If you want to solve a linear-constrained minimization problem, you may want to look at the "ipm" interior point method solver available in TAO along with some examples at "petsc/src/tao/constrained/examples/tutorials". Unfortunately the interface is not yet done in DOLFIN.

answered Mar 30, 2015 by tianyikillua FEniCS User (1,620 points)

Thank you. It will be nice such kink of interface with more tao optimization solvers!
Unfortunatelly the petsc version of fenics via ppa is not >= 3.5.

...