<div dir="ltr">Dear Sir/Madam:<div><br></div><div>Sorry to bother, but I didn't find any information I need to implement matrix-free functions for SNES after a long time search of the manual and sample codes.</div><div><br></div><div>Suppose I am solving nonlinear equation systems F(x) = 0, I have two choices:</div><div><br></div><div>(1) MatCreateMFFD(snes, matJ):</div><div>This calculate matJ * x with a finite difference scheme. I can create a function to calculate matJ * x, and link it to SNES by SNESSetJacobian. However,  I do not prefer this feature because I am calculating the mat-vec product in another way.</div><div><br></div><div>(2) MatCreateMF(snes, matJ):</div><div>Here, matJ is not defined explicitly. It is some operations (like mat-vec product). must be linked to SNES, and must be linked to SNES through  SNESSetJacobian. </div><div><br></div><div>For KSP solvers, I know that a matshell type can be created and a mat-vec product can be assigned to matJ in this way:</div><div>MatCreateShell( ....)</div><div>MatShellSetOperation(....)</div><div>KSPSetOperators(ksp, matJ, matJ)</div><div><br></div><div>How to do the similar operations for SNES if matJ is already created via MatCreateMF? How to define the mat size and mat-vec product? What other operations are required in a customized function in order to link it to SNES via SNESSetJacobian?</div><div><br></div><div>Thanks a for your help.</div><div><br></div><div>Yongle Du </div><div><br></div><div><br></div><div><br></div><div><br></div></div>