[petsc-users] How to use other matrix directly in petsc?

Hong Zhang hzhang at mcs.anl.gov
Wed Nov 9 08:44:24 CST 2011


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
>
>
>


More information about the petsc-users mailing list