From: John Peterson <jwpeterson@gm...> - 2012-01-23 18:37:27
On Mon, Jan 23, 2012 at 11:11 AM, Michael Povolotskyi
> 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 ||
ierr = SNESSetJacobian (_snes, jac->mat(), jac->mat(),
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.
Get latest updates about Open Source Projects, Conferences and News.