On Wed, Nov 23, 2011 at 00:47, behzad baghapour <behzad.baghapour at gmail.com>wrote:
> 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: > > typedef struct { > element* e; face* f; flow* flw; }FieldCtx; > > FC.e = e; > FC.f = f; > FC.flw = flw; > This is mesh topology and geometry or are these state variables? If the latter, then you can't do it this way. You have to evaluate the residual at the state passed into your SNES residual function, not based on whatever is in this other struct. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111123/001a3e3c/attachment.htm>