<div dir="ltr">Dear PETSc community,<div><br></div><div>I'm trying to implement a preconditioner used in reservoir modelling, called Constrained Pressure Residual. </div><div>They apply a transformation to the linearised system we get from each Newton step, before solving it. Then a 2-stage multiplicative preconditioner on the transformed system.</div><div><br></div><div>The main problem is implementing step 1 below.</div><div><br></div><div>Let A be the Jacobian, b the residual and K my transformation. <br></div><div>A = [A00 A01; A10 A11].</div><div>The process is roughly like this:</div><div>1) Set Atilde = KA,  btilde = Kb. </div><div> - We want to solve Atilde x =  btilde</div><div><br></div><div>2) Create a 2-stage multiplicative preconditioner using Atilde, btilde</div><div>pc0: This is only applied to the "fieldsplit 1" block of my system.</div><div>B_1 = [0 0; 0 S^-1]</div><div>Where S is a selfp Schur approximation from Atilde</div><div>S =  Atilde11 - Atilde10 * inv(diag(Atilde00))* Atilde01</div><div>pc1: This is a standard ILU on the whole system Atilde</div><div><br></div><div>Currently I'm doing something like this</div><div>Step 1:</div><div>-ksp_type richardson -ksp_max_it 1</div><div>-pc_type python</div><div>Then I create Atilde from KA in PCSetup, and a FGMRES ksp to take care of step 2 with PCApply</div><div><br></div><div><div>Step 2:</div></div><div>pc_type composite </div><div>pc_composite_type multiplicative</div><div>pc_composite_pcs python,ilu,</div><div><br></div><div>Are there better ways of dealing with this transformation?</div><div>To me it looks similar to a 2-step right preconditioner on top of a left preconditioner. </div><div><br></div><div>Regards,</div><div>Ozzy</div></div>