> On Jun 22, 2016, at 2:42 AM, Justin Chang <[email protected]> wrote: > > Hi all, > > I am looking at the SNES tutorials ex9.c and ex58.c and am wondering why > SNESVISetComputeVariableBounds() is called instead of just > SNESVISetVariableBounds(). When would it be appropriate to use only using the > latter?
It is sort of similar to KSPSetOperators() and KSPSetComputeOperators(). The first is perhaps conceptually simpler since it is based on the old "subroutine library" model where you pass data to a subroutine and it does something and returns while the second is like a "call-back" library where during the time the library "does something" it comes back and asks the user for something. I think you can always reproduce the "subroutine library" approach with the "call-back" approach so in some sense the SNESVISetVariableBounds() is not needed. Barry Matt has always wanted to get rid of KSPSetOperators() and always use the call back approach for solvers; I've resisted because many people like the simplicity of not providing callbacks. > > Thanks, > Justin
