On Mon, Jan 23, 2012 at 11:11 AM, Michael Povolotskyi
<mpovo...@purdue.edu> wrote:
> Dear Libmesh developers/users,
> with your help I fixed the problem with the nonlinear Newton solver.
> The problem was I was using the old style APIs where one has to define
> the matvec functor.
> Apparently this does not work now.
> The workaround was to define the residual and the jacobian functors.
>
> I would suggest to remove the old API.

The API (which is really just a naked function pointer, unless I
missed something) comes from the base class, so we could remove it,
but it's possible the Trilinos NOX solver still uses this interface...
I'm not too familiar with the code.

I think the issue could be this if-statement in petsc_nonlinear_solver.C:

   // Only set the jacobian function if we've been provided with
something to call.
   // This allows a user to set their own jacobian function if they want to
   if (this->jacobian || this->jacobian_object ||
this->residual_and_jacobian_object)
   {
     ierr = SNESSetJacobian (_snes, jac->mat(), jac->mat(),
__libmesh_petsc_snes_jacobian, this);
     CHKERRABORT(libMesh::COMM_WORLD,ierr);
   }


Should we also call SNESSetJacobian() in some capacity if (_matvec != NULL)?

By providing a _matvec function pointer, the user is apparently
declaring that it will provide both residual and Jacobian.

-- 
John

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to