<div dir="ltr">Dear Hong and Matthew, <br><br>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. <br><br>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. <br>
<br><br>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. <br><br>I go forward to try some linear solvers now. <br>
<br>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. <br>
<br>If you have any suggestions on solve this kinds of linear systems, please tell me. <br><br>Thank you very much. <br><br>Best Regard, <br>Kai <br><br><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Message: 3<br>
Date: Wed, 9 Nov 2011 08:44:24 -0600<br>
From: Hong Zhang <<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] How to use other matrix directly in petsc?<br>
To: PETSc users list <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
Message-ID:<br>
<CAGCphBsnmj0uvTnvcWvg=<a href="mailto:TCBiNhzuiBF8CAw1p3uKZjiyE7ySw@mail.gmail.com" target="_blank">TCBiNhzuiBF8CAw1p3uKZjiyE7ySw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Bao:<br>
You may look at petsc-umfpack interface<br>
~petsc/src/mat/impls/aij/seq/umfpack/umfpack.c<br>
<br>
It seems umfpack use csr format, same as petsc aij format.<br>
<br>
Hong<br>
<br>
> Dear all,<br>
> I have been writing a serial FEM code with a direct linear solver umfpack,<br>
> which is pretty easy to use. The problem is the memory required turned to be<br>
> very big and I can not afford it.<br>
> So I want to turn to PETSC to use ?some iterative solver.<br>
> I have written the the whole matrix assembly process with?coordinates list<br>
> format. The matrix can be converted to CSC format to use umfpack.<br>
> When I tried to use MatSetValues to generate the Matrix for petsc, it turned<br>
> out to be really slow.<br>
> I am wondering if there is some?efficient?way to convert the generated<br>
> matrix ( with COO, or CSC, or even CSR ) properly to make it usable for<br>
> PETSC.<br>
> Since the code at the moment is serial, the methods working for serial petsc<br>
> will be OK.<br>
> And I do many matrix manipulation( some may not easy with petsc) during the<br>
> matrix assembly, so I do not want to rewrite the whole assembling process<br>
> with petsc at the moment.<br>
> I just want to convert the matrix generated to the format the petsc can use.<br>
> It can save much time.<br>
> Thank you very much.<br>
><br>
> Best Regards,<br>
> Kai<br>
><br>
><br>
><br>
<br>
<br>
</blockquote></div><br></div>