Dear Hong and Matthew, I looked at the interface file for umfpack, while I did not understand all the things inside very clearly. I just began to read petsc manual three days ago.
I guess the interface file is used to call the functions in umfpack to solve the linear system. But the default matrix format in umfack should be csc, and I did get how the interface handle this problem. My matrix conversion problem is generally solved. The crucial point is that you need to count the number of the non-zero entries in each row and use that information to do the preallocation. I go forward to try some linear solvers now. The matrix generated with my problem is a little poor, resulting from a mixed finite element method, asymmetric and indefinite. And the inclusion of irregular boundary makes it worse. This is actually one reason I began with a direct solver. If you have any suggestions on solve this kinds of linear systems, please tell me. Thank you very much. Best Regard, Kai > Message: 3 > Date: Wed, 9 Nov 2011 08:44:24 -0600 > From: Hong Zhang <hzhang at mcs.anl.gov> > Subject: Re: [petsc-users] How to use other matrix directly in petsc? > To: PETSc users list <petsc-users at mcs.anl.gov> > Message-ID: > <CAGCphBsnmj0uvTnvcWvg=TCBiNhzuiBF8CAw1p3uKZjiyE7ySw at mail.gmail.com > > > Content-Type: text/plain; charset=ISO-8859-1 > > Bao: > You may look at petsc-umfpack interface > ~petsc/src/mat/impls/aij/seq/umfpack/umfpack.c > > It seems umfpack use csr format, same as petsc aij format. > > Hong > > > Dear all, > > I have been writing a serial FEM code with a direct linear solver > umfpack, > > which is pretty easy to use. The problem is the memory required turned > to be > > very big and I can not afford it. > > So I want to turn to PETSC to use ?some iterative solver. > > I have written the the whole matrix assembly process with?coordinates > list > > format. The matrix can be converted to CSC format to use umfpack. > > When I tried to use MatSetValues to generate the Matrix for petsc, it > turned > > out to be really slow. > > I am wondering if there is some?efficient?way to convert the generated > > matrix ( with COO, or CSC, or even CSR ) properly to make it usable for > > PETSC. > > Since the code at the moment is serial, the methods working for serial > petsc > > will be OK. > > And I do many matrix manipulation( some may not easy with petsc) during > the > > matrix assembly, so I do not want to rewrite the whole assembling process > > with petsc at the moment. > > I just want to convert the matrix generated to the format the petsc can > use. > > It can save much time. > > Thank you very much. > > > > Best Regards, > > Kai > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111110/dc547971/attachment.htm>
