Song Gao <[email protected]> writes: > Dear all, > > Happy new year! > > I'm using the matrix-free method to solve NS equations. I call > the SNESSetFunction to set the RHS function. I think SNES also uses that > RHS function to evaluate the matrix vector product. > > But I want to set one function to evaluate the residual, and another > different function to evaluate the matrix vector product. How can I do > that? Does MatMFFDSetFunction do this job?
Yes, you can look at src/snes/examples/tutorials/ex22.c for an example of similar (replace SNESComputeFunction with your desired function).
pgpfSCi0jzoDt.pgp
Description: PGP signature
