[petsc-users] Examples on solving linear systems using GMRES and/or matrix-free method

Jed Brown jed at 59A2.org
Wed Jun 15 12:08:35 CDT 2011


On Wed, Jun 15, 2011 at 19:05, Xiang Hao <haoxiang at yahoo.cn> wrote:

> Now, I have a problem when I try to change the above to a c++ version(I
> want to use a class).


Set the class pointer as the application context and use a simple wrapper:

MatMult_Wrapped(Mat A,Vec X,Vec Y) {
  TheClass *cls;
  MatShellGetContext(A,&cls);
  return cls->matmult(A,X,Y);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110615/cf217f15/attachment.htm>


More information about the petsc-users mailing list