On 8/19/22 13:14, Simon Wiesheier wrote:

I also need the system matrix A for a second purpose, namely
to compute a matrix multiplication:
res = A^{-1} * B ,
where B is another matrix.
-To be more precise, I need the inverse of the 19x19 submatrix
corresponding to the unconstrained DoFs only -- not the inverse of the full system matrix..

Right. But the inverse of the 19x19 matrix is the 19x19 subblock of the 20x20 big matrix. That's because after zeroing out the row and column, you have a block diagonal matrix where the inverse of the matrix consists of the inverses of the individual blocks.

I could not find a function which computes the inverse of a sparse matrix directly (without solving a linear system).
What I tried is,
LAPACKFullMatrix<double> new_matrix = my_system_matrix ,
thence calling the invert function.
But I am not sure if this is the right way to go.

That's one way to go. FullMatrix::gauss_jordan() also computes the inverse of a matrix.


-Also, after calling constraints.distribute_local_to_global(),
does it make sense at all to compute an inverse matrix, given that some rows and columns were set to zero?

Yes -- as mentioned above, you should consider the resulting matrix as block diagonal.

Best
 W.


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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/593cd135-fa19-1572-23a9-53bcfb34aad9%40colostate.edu.

Reply via email to