As I want to keep my code structure as before applying SNES, I defined a
 FieldContext and pass my data like element and face values into this 
context by pointing there addresses of elements and faces of the field 
like this:<br>
<br>typedef struct {<br>     element* e; <br>     face* f; <br>     flow* flw; <br>}FieldCtx;<br><br>and then:<br>    <br>FC.e = e;                         <br>FC.f = f;
<br>FC.flw = flw;<br><br>and pass FieldContext into SNESSetFunction and SNESSetJacobian.<br><br>Here I checked that all my routine work as before except one (related to convective flux) which I really do not know why the values just for this routine is not match as before.<br>
<div class="gmail_quote"><br></div><br>