[petsc-users] PCFactorSetUpMatSolverPackage with SNES
David Knezevic
david.knezevic at akselos.com
Tue Mar 1 12:52:51 CST 2016
Based on KSP ex52, I use PCFactorSetUpMatSolverPackage in the process of
setting various MUMPS ictnl options. This works fine for me when I'm
solving linear problems.
I then wanted to use PCFactorSetUpMatSolverPackage with the PC from a SNES
object. I tried to do this with the following code (after calling
SNESCreate, SNESSetFunction, and SNESSetJacobian):
KSP snes_ksp;
SNESGetKSP(snes, &snes_ksp);
PC snes_pc;
KSPGetPC(snes_ksp, &snes_pc);
PCFactorSetMatSolverPackage(snes_pc, MATSOLVERMUMPS);
PCFactorSetUpMatSolverPackage(snes_pc);
However, I get a segfault on the call to PCFactorSetUpMatSolverPackage in
this case. I was wondering what I need to do to make this work?
Note that I want to set the MUMPS ictnl parameters via code rather than via
the commandline since sometimes MUMPS fails (e.g. with error -9 due to a
workspace size that is too small) and I need to automatically re-run the
solve with different ictnl values when this happens.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160301/26ef76d8/attachment.html>
More information about the petsc-users
mailing list