Dear Jed, Dave, Matt and others, I just want to let you know that I have successfully applied fieldsplit and Schur complement into the project I'm working on. The code I start up with is ex70.c under SNES/examples/tutorial. Thank you all for your kindly help.
Best, Hui ________________________________________ From: Jed Brown [[email protected]] Sent: Friday, July 18, 2014 10:23 AM To: Sun, Hui; Dave May Cc: [email protected] Subject: RE: [petsc-users] why a certain option cannot be used "Sun, Hui" <[email protected]> writes: > Thank you Jed. After reading ex15, I got some idea of how to define the > PCShell with KSP solver. However, I want to verify with you if the following > procedure is normally what one should do. > 1. Define a ShellPC struct, which includes a MAT object, say Pmat, and a KSP > object, say innerKsp. The context should indeed contain innerKSP. The ShellPC may not need a Mat (you can just pass it down to innerKSP). > 2. PCSetType(pc, PCSHELL) > 3. Create a context for the user defined PC. It is here that we call > KSPSetOperators(innerKsp, Pmat, Pmat) You can do it eagerly or via PCShellSetSetUp(), if you want the shell PC to be more reusable/independent. > 4. Set the user defined routine for applying the preconditioner. It is in > this user-define routine that we call KSPSolver(innerKsp, r, y) > > I'm wondering the way I set up the inner KSP for the PC is standard? Thank > you! Pretty much.
