<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><div>Dear PETSc Developers,</div><div><br></div><div>I hope this message finds you well. My name is René Chenard, and I am a Research Professional at Université Laval. We are currently working on implementing a wrapper for the SNES in our project and are seeking guidance on incorporating callbacks at different stages of the resolution process.</div><div><br></div><div>Specifically, our objective is to implement a callback that triggers at the initiation of every nonlinear iteration and another that activates at the conclusion of each nonlinear iteration. In our exploration, we discovered the potential use of SNESSetUpdate and SNESSetConvergenceTest for this purpose.</div><div><br></div><div>However, we encountered a challenge with SNESSetUpdate, as it seems to be ineffective for the ngmres and anderson solver types, the latter of which appears to be based on the implementation of ngmres. We are reaching out to seek clarification on whether this behavior is intentional and to explore alternative approaches that might better suit our needs.</div><div><br></div><div>To facilitate a clearer understanding of our observations, we have prepared a reproduction example in the file named test_snes.c. This file outlines the specific scenarios where we encountered challenges with SNESSetUpdate and provides a context for our inquiries.</div><div><br></div><div>Here are our specific questions:</div><div><br></div><div>1. Is SNESSetUpdate designed to function uniformly across all types of SNES solvers?</div><div>2. What would be the recommended approach to implement custom callbacks around every nonlinear iteration, especially considering the apparent limitations with SNESSetUpdate for certain solver types?</div><div>3. We observed a discrepancy in the iteration/step numbering between the update function (set by SNESSetUpdate) and the convergence function (set by SNESSetConvergenceTest). Could you provide clarification on this, considering the documentation's description of SNESSetUpdate as the function "called at the beginning of every iteration of the nonlinear solve"?</div><div><br></div><div>We genuinely appreciate your expertise in this matter, and your insights will be invaluable in guiding our implementation. Thank you in advance for your consideration and support.</div><div><br></div><div>Warm regards,</div><div><br></div><div>—René Chenard</div><div>Research Professional at Université Laval</div><div><a href="mailto:rene.chenard.1@ulaval.ca">rene.chenard.1@ulaval.ca</a></div></div><div><br></div></body></html>