[petsc-users] Providing matrix vector product yourself for matrix free in SNES

Jed Brown jedbrown at mcs.anl.gov
Wed Dec 21 09:08:51 CST 2011


On Wed, Dec 21, 2011 at 08:54, <E.T.A.vanderWeide at utwente.nl> wrote:

> Thanks, this is working. The only problem I still have is that I have to
> store much more than just a vector in context of MATSHELL in order to carry
> out the matrix vector multiplication. I basically need all the contents of
> an object of a certain class. I tried to store the this pointer of the
> object in the context of MATSHELL, but then I get an error. So it looks
> like it is not allowed to pass the this pointer to MatShellSetContext, is
> that correct?


How are you calling MatShellSetContext() and what is the error? You can
pass "this", but the callback should be either a standalone function or a
static member function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111221/fa4cb8fb/attachment.htm>


More information about the petsc-users mailing list