Multiply SparseMatrix and a Vector

18 views
Skip to first unread message

Nitish Anand

unread,
Aug 24, 2017, 10:14:56 AM8/24/17
to deal.II User Group
Hello,

I wish to multiply a PETSeWrapper::MPI::SparseMatrix with a Vector<double>. I would be glad if someone can point to the right material to do this efficiently.

Thanks in advance.

--Nitish

Nitish Anand

unread,
Aug 24, 2017, 10:17:36 AM8/24/17
to deal.II User Group
Errata: PETSc 

Jean-Paul Pelteret

unread,
Aug 24, 2017, 10:21:59 AM8/24/17
to deal.II User Group
Dear Nitish,

Well, in the documentation to vmult it states that when
the current object represents a parallel distributed matrix (of type PETScWrappers::MPI::SparseMatrix), then both vectors have to be distributed vectors as well
. So I suspect that what you need to do is to create a pair of distributed vectors and then simply copy the data from the deal.II vector to the PETSc one using operator=.

Does this help?

Regards,
Jean-Paul

Nitish Anand

unread,
Aug 24, 2017, 11:03:57 AM8/24/17
to deal.II User Group
In fact, that was the issue.. Works well now. :) Thanks ! 
Reply all
Reply to author
Forward
0 new messages