ABOUT OPERATING PETScWrappers::MPI::SparseMatrix

11 views
Skip to first unread message

xs...@berkeley.edu

unread,
Aug 30, 2020, 2:20:41 AM8/30/20
to deal.II User Group
Hi, I declared two same scale matrix A and B using PETScWrappers::MPI::SparseMatrix and assign values on these two matrixes. I want to do some operation on them to get another matrix C which equals h*A+B. How should I get the matrix C? Thank you very much.

Xiang

Wolfgang Bangerth

unread,
Aug 30, 2020, 5:40:14 PM8/30/20
to dea...@googlegroups.com
This should work:

C = B;
C.add (h, A);

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

xs...@berkeley.edu

unread,
Aug 31, 2020, 1:25:25 AM8/31/20
to deal.II User Group
Thank you very much.

Best,

Xiang

Reply all
Reply to author
Forward
0 new messages