> On Nov 23, 2016, at 4:57 PM, Łukasz Kasza <rpgw...@wp.pl> wrote:
> 
> Dear PETSc Users,
> 
> I want to compute approximate matrix product A^-1*B where A^-1 is 
> approximated by ILU(0) of A matrix for sequential and parallel executions. 
> For sequential code I can use KSP in preonly mode (PCILU works only for 
> sequential code), get the ILU(0) by PCFactorGetMatrix and then call 
> MatMatSolve. However the resulting matrix has to be in dense format because 
> that's the way MatMatSolve works. In my case A^-1*B product is sparse for 
> sure, because ILU(0) has the same sparsity pattern.

   Even though your ILU(0) factorization of A is sparse the resulting A^-1*B 
will almost surely be dense since the triangular solves"fill" in the column 
vector entries in the result.

> Suppose that I 
> will have a factored A matrix for parallel code as well. What is the best way 
> to get the A^-1*B product without creating dense matrices? Is it even 
> possible? 

  Why do you want to form A^-1*B? Or do you want to just use A^-1*B in some 
other computation? Perhaps that can be done "matrix" free by not forming A^-1*B 
but instead doing matrix vector products of A^-1*B  which will be cheap if you 
have an ILU(0) of A.

   Barry

> 
> Best Regards,
> Damian Goik
> 
> 
> 

Reply via email to