Extracting elements of a SparseMatrix

16 views
Skip to first unread message

Wasim Niyaz Munshi ce21d400

unread,
Jan 17, 2023, 8:42:43 AM1/17/23
to deal.II User Group
Hello everyone. I am trying to plot load displacement curves for an elasticity problem.
For this I need to extract the non-zero elements of my sparse stiffness matrix. I tried something like system_matrix[I][j] to extract the ij-th entry but it seems this doesn't work for the SparseMatrix.
 Can anyone help me with this?

Thanks and regards
Wasim

Wolfgang Bangerth

unread,
Jan 17, 2023, 7:43:22 PM1/17/23
to dea...@googlegroups.com
Wasim -- yes, this is the wrong syntax to extract elements from a sparse
matrix. Fortunately, the documentation of the class offers a number of ways to
access matrix elements:
https://dealii.org/developer/doxygen/deal.II/classSparseMatrix.html

Best
W.

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


Reply all
Reply to author
Forward
0 new messages