[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sparse Matrix Inversion using PETSc
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: Sparse Matrix Inversion using PETSc
- From: "Aron Ahmadia" <aja2111@xxxxxxxxxxxx>
- Date: Wed, 15 Aug 2007 09:21:28 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=kpxRrrpSfNN/G9tmgC/Qg+ZqXEdOq0FCRsIadVilvFXCaWDQdNlrI51MpmxemQ1gvFvk6/Z+Ikoreu+xh8p/sK1kWsz44qnywmg+oH6Wp0mIxSMKlnylsaU1c0wyqTai7Dv7IvKRbFkNPmY9fQX4PrGbCUWV8H6w7Es3MRy2SHM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=IR/2gcj9JSJo4QOJT1Yf56bCDFtS4AAPTiNA0OjnZyj9LPKXm4AKxp4NsjS6Cq4N6kFh8j0KfhfN7r/11iLC6D5PlFzOJBvjTClw+e7aFeoaDkBxu36tZp+YQz+hrKDym4/W1P1W1Ikmnu8G/znBD5QAjT8ympT9TK2il9krXMM=
- In-reply-to: <46C2E836.1090207@ichec.ie>
- References: <46C2E836.1090207@ichec.ie>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
Dear Tim,
It is possible to carry out the explicit inversion of a sparse matrix
using the PETSc framework with the methodology you outlined below. I
would encourage you to consider Cholesky/LU factorizations of the
matrix, which occassionally result in sparser triangular solve times
than an explicit inverse-matrix-vector multiply would.
As for the correct way to do this, I would start with the fastest
methods for multiple right hand sides and reasonably sized matrices, a
direct method such as LU. I'm unaware of any functionality in PETSc
for handling multiple right hand sides, but PETSc will keep the
factorization from a previous direct solve, so A\b2 will be much
faster than A\b1. I think the best bet is a naive for loop over each
of the vectors to assemble the matrix piece by piece.
The PETSc developers may have some more thoughts on this.
Good luck,
~Aron
On 8/15/07, Dr. Timothy Stitt <timothy.stitt@xxxxxxxx> wrote:
> Hi all,
>
> I am currently investigating the best way to perform the inversion of a
> large sparse matrix and came upon the idea of using PETSc as a framework
> for testing various strategies from direct to iterative methods on my
> sample matrices. In this setup for an NxN sparse matrix A I would have N
> rhs's representing the Identity matrix and then solve for X. I wanted to
> experiment with both parallel and serial strategies ranging from LU
> Decomposition using SuperLU, MUMPS etc. to iterative methods using GMRES
> etc. Am I right in thinking that all this can be done in PETSc by
> setting up a core framework and then varying the solver methods etc?
>
> I have looked over the sample KSP Solver codes although they only seem
> to suggest single vectors for x and b. Can this be changed to accept
> multiple vectors? Can anyone suggest a sample code that maybe
> demonstrates the sort of thing I want to achieve...if it is in fact
> possible.
>
> Thanks in advance for any assistance given,
>
> Regards,
>
> Tim.
>
>