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

Xiang Hao haoxiang at yahoo.cn
Wed Jun 15 14:20:07 CDT 2011


Thank you, Jed. It works :)



On Wed, Jun 15, 2011 at 11:08 AM, Jed Brown <jed at 59a2.org> wrote:

> 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/675c86af/attachment.htm>


More information about the petsc-users mailing list