[petsc-users] Roles of ksp_type and pc_type

Massimiliano Leoni leoni.massimiliano1 at gmail.com
Thu Nov 13 05:39:21 CST 2014


Hi petsc-users,
  I am relatively new to PETSc and so a few things that you'd call obvious 
still puzzle me. I hope someone can help me clarify this.

Consider the system Ax = b and
	KSPSetOperators(ksp,A,A,...);

now, please correct me wherever I'm wrong:
[1] if I set -ksp_type preonly, -pc_type lu   it solves Ax = b with direct LU 

[2] if I set -ksp_type preonly, -pc_type hypre   it solves Px = b where P is 	
	the AMG preconditioner of A build by HYPRE
	§ Question: how does PETSc solve this?

[3] if I set -ksp_type gmres, -pc_type hypre   it solves Ax = b as
	P^{-1}Ax = P^{-1}b with gmres, where P is again the AMG prec build by 		
	HYPRE.

[4] suppose I have the classic Stokes matrix A = [[C,B^T],[B,O]] and want to 	
	use the block preconditioner P = [[C,O],[O,Mp/nu]]. What I'm doing now is
	KSPSetOperators(ksp,A,P,...);
	set ksp_type gmres, pc_type fieldsplit, inner ksps gmres and inner pcs 		
	hypre, so I expect PETSc to solve Pz = r by blocks,
	C z_u = r_u first, as in [3]
	Mp/nu z_p = r_p later, again as in [3]
	Is this what is actually happening?

[5] what happens instead if I set, in the same situation,
	ksp_type preonly, pc_type fieldsplit, inner ksps gmres and inner pcs ?
	I expect PETSc to solve Px = b with a block method as before. [This 		
	doesn't actually solve Stokes].

I'm sorry for the many questions, I am trying to go through the User Manual 
and will be glad if anyone points me to further resources.

Thanks in advance for any help,
Massimiliano


More information about the petsc-users mailing list