[petsc-users] Roles of ksp_type and pc_type

Massimiliano Leoni leoni.massimiliano1 at gmail.com
Thu Nov 20 07:37:20 CST 2014


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.

> 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


More information about the petsc-users mailing list