[petsc-users] Yet another inversion question
Umut Tabak
u.tabak at tudelft.nl
Sat May 1 15:27:15 CDT 2010
Dear all,
I need some terms in my algorithm such as
A^{-1} B
so and inverted matrix multiplied by another one(A and B pretty sparse,
however inversion makes all the sparsity lost). Explicit inverse is not
the way to go, however I thought of solving for the columns of B thorugh
KSP and put them into another matrix as columns(which might be expensive
as well I am not sure)and eventually I will get the term I would like. I
know these kinds of terms should be avoided if possible but for the
moment I can not avoid them so what would be the best way to compute
this dense symmetric resulting matrix.
I did a first try to solve for the columns of B, with the umfpack
interface and direct solve, which seemed to be fastest on a matrix of
size 5544( to solve for all the columns of B). About 1m11sec. to do the
above mentioned solves. I was wondering if there some more efficient
ways to make this operation faster than what I could accomplish now.
Otherwise I should leave this way of thinking.
Sth like,
for(PetscInt indx=0; indx<c; indx++)
{
//cout << "Column : " << indx << endl;
// retrieve column
MatGetColumnVector(Mss, u, indx);
/*
Solve linear system
*/
ierr = KSPSolve(ksp,u,x);CHKERRQ(ierr);
}
Best regards,
Umut
More information about the petsc-users
mailing list