[petsc-users] Roles of ksp_type and pc_type

Matthew Knepley knepley at gmail.com
Thu Nov 20 07:45:48 CST 2014


On Thu, Nov 20, 2014 at 7:37 AM, Massimiliano Leoni <
leoni.massimiliano1 at gmail.com> wrote:

> Hi Matt, thanks for your reply.
>
> In data mercoledì 19 novembre 2014 06:19:05, Matthew Knepley ha scritto:
> > It looks to me like you have memory corruption in a different part of the
> > code. I
> > would build a debugging version, and consider running under valgrind.
> I think I got what's happening.
> I found out this morning that if I set ksp_type multiplicative in the
> source
> code, with PCFieldSplitSetType, it works!
> This suggests that I am messing in the code with the relative positions of
> {KSP|PC}SetFromOptions, SetUp and the rest.
>
> Ksp_view confirms that PETSc actually does what I want, and ksp_monitor
> shows
> different iterations, which means that I am actually influencing something.
>

Great, I am glad something is working. This is tricky, and it is why in our
own code
we have moved almost completely to an options driven configuration, with
SetUp()
called automatically by the solver. I have not been able to come up with a
better option.

  Thanks,

     Matt


> > Here is a sample run
> >
> >   cd src/snes/examples/tutorials
> >   make ex62
> >   ./ex62 -run_type full -refinement_limit 0.00625 -bc_type dirichlet
> > -interpolate 1 -vel_petscspace_order 2 -pres_petscspace_order 1 -ksp_type
> > fgmres -ksp_gmres_restart 100 -ksp_rtol 1.0e-9 -pc_type fieldsplit
> > -pc_fieldsplit_type schur -pc_fieldsplit_schur_factorization_type full
> > -fieldsplit_pressure_ksp_rtol 1e-10 -fieldsplit_velocity_ksp_type gmres
> > -fieldsplit_velocity_pc_type lu -fieldsplit_pressure_pc_type jacobi
> > -snes_monitor_short -ksp_monitor_short -snes_converged_reason
> > -ksp_converged_reason -snes_view -show_solution 0
>
> I can confirm this works for me as well, of course.
>
> >   Thanks,
> >
> >      Matt
>
> Thanks for the help!
> Massimiliano
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141120/f5ff8230/attachment-0001.html>


More information about the petsc-users mailing list