From: Ataollah Mesgarnejad <amesga1@ti...>  20111205 15:35:16

Dear all, I need to implement an optimization scheme based on TAO(http://www.mcs.anl.gov/research/projects/tao/) in my FE program that I wrote using libmesh. To do so Tao requires me to calculate gradient and hessian(http://www.mcs.anl.gov/research/projects/tao/docs/manualpages/ptaopages/TaoAppSetHessianMat.html) of my objective function therefore, I need a PetscVector and PetscMatrix with the right setup(correct ownership on parallel,..) from my TransientLinearImplicitSystem. I found a way to do this for the gradient since Tao creates the gradient object itself and I only fill it using a local gradient on each element; however, I don't know how I can implement the Hessian? Should I just add a matrix to my system using: SparseMatrix< Number > & libMesh::ImplicitSystem::add_matrix ( const std::string & mat_name) and then pass the PETSc matrix based on that to Tao? If so how can I access the PetscMatrix inside the matrix I added to the system? Or is there another way to do this? Thank you for your time, Ataollah Mesgarnejad PhD Students, Research Assistant Center of Rotating Machinery Louisiana State University 2203 Patrick F. Taylor Hall Baton Rouge,LA 70803 Cell#: (225)6206369 