[petsc-users] MatCreateComposite

Nachiket Gokhale gokhalen at gmail.com
Wed Oct 24 18:32:00 CDT 2012


I have matrices K and M  and I am trying to create the matrix

D = K -  (w^2) M    where w is a scalar.

I am trying to do this using matscale of M and then using MatComposite
and MatCompositeMerge.  However,  I am not clear about the
documentation of MatCreateComposite.

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateComposite.html

It says the output parameter is A, however I don't see A in the call.
Perhaps the output is Mat?  Also, the documentation says that nmat is
the number of matrices to put in, but I see only one argument - does
this function take variable number of arguments? I haven't seen Petsc
functions like this in the past ...

Also, the call in the example seems ex9.c is

 67:     MatCreateComposite(PETSC_COMM_WORLD,3,A,&B);

So, there are three matrices to put in but only one (A) is put in.  I
don't quite understand this either.

Any help would be appreciated,

Thanks,

-Nachiket


More information about the petsc-users mailing list