Thanks for your input.
In the meantime, I replaced the matrix multiplication
res = A^_{-1}*B
by solving 'p' linear systems
A*res[p] = B[p],
where p is the number of columns of the matrix B.

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

As stated, what I tried is to use the operator= according to
LAPACKFullMatrix<double> new_matrix = my_system_matrix .
However, there is an error message
"error: conversion from ‘dealii::SparseMatrix<double>’ to non-scalar type
‘dealii::LAPACKFullMatrix<double>’ requested
   LAPACKFullMatrix<double> new_matrix = tangent_matrix"

How can I fix this?

Best
Simon


Am Mo., 22. Aug. 2022 um 08:45 Uhr schrieb Wolfgang Bangerth <
bange...@colostate.edu>:

> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/4Swu5xeNU3U/unsubscribe.
> To unsubscribe from this group and all its topics, 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
> .
>

-- 
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/CAM50jEtTnxmS5Wwnr9QMcL95uEx%2BJqQmbRuXFyLYb5bQrrZh2Q%40mail.gmail.com.

Reply via email to