On Thu, Oct 27, 2011 at 10:05 AM, behzad baghapour < behzad.baghapour at gmail.com> wrote:
> Dear All, > > I want to use SNES for nonlinear Newton Iterations. All of my RHS and > Jacobian Matrix are calculated with my own defined object called "element". > How should I pass my object into SNES functions to calculate required RHS > and Jacobian? > Define functions CalculateRHS() and CalculateJacobian() and pass them to SNES, and pass 'element' as the user context. Then inside that function, you can get 'element' back from the 'ctx' argument. Matt > Thanks, > B. B. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111027/b8b61aff/attachment.htm>
