On Mon, Jan 23, 2012 at 10:11, Michael Povolotskyi <[email protected]>wrote:
> Sorry, I made a mistake in my previous e-mail.
> The situation is as follows:
> when I use flag -snes_mf the code does not crash.
> But if I want to use my jacobian routine, then it crashes.
>
Does this happen with libmesh examples? Inside of
PetscNonlinearSolver::solve(), there is
// 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);
}
You might set a Jacobian routine using (see miscellaneous_ex3.C)
system.nonlinear_solver->jacobian = compute_jacobian;
If this doesn't help you track down the problem, perhaps try using a
debugger to see why this->jacobian is not set in
PetscNonlinearSolver::solve().
------------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users