<div dir="ltr"><div><div><div><div><div><div><div><div><div>Dear All,<br><br></div>This message is related to the multiple use of a single KSP solver context.<br><br></div><b>My question is</b>: If I set up a KSP solver is it possible to use it as many times as I require?<br>
<br></div><b>What I mean</b>: If I create a KSP solver called <i>solver</i> and associate with it the required Matrix i.e. the A matrix of the system and the right had side vector b. I then solve the system calling KSPSolve(<i>solver</i>,b,Solution); for example.<br>
<br></div>Say now I want to re-use the same context <i>solver</i> but I supply a different right had side vector b and again call the same command<br>KSPSolve(<i>solver</i>,b,Solution);, is this sufficient to perform the new solve correctly and get a new solution vector x? Will it reuse the before specified matrix A in the system (and the same solver eg. GMRES and preconditioner)? or do I need to recreate a new solver each time? is there any specific behaviour of Petsc I need to be aware off?<br>
<br></div>Solution algorithm is an iterative one and I require to solve 5 different equations at different time-step, the only thing that changes from each time step is the right had side vector of the system. So the matrix A for all the equations are the same at each time step.<br>
<br></div>I hope I explained this good enough. Sorry if this is a trivial questions.<br><br></div>Thanks in advance.<br><br></div>Regards,<br></div>Anthony<br><div><div><div><div><div><br></div></div></div></div></div></div>